-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dashboard): Digest liquid helper and popover handler #7439
Conversation
Allow arbitrary variables on the payload namespace after adding at least one variable in a previous control value.
…into pills-for-all-inputs
filters: Filters[]; | ||
}; | ||
|
||
export function useSuggestedFilters(variableName: string, currentFilters: FilterWithParam[]): SuggestionGroup[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These provide filter suggestion based on common variable names, patterns of data
this.templateEngine.registerFilter('json', (value, spaces) => | ||
stringifyDataStructureWithSingleQuotes(value, spaces) | ||
); | ||
this.templateEngine.registerFilter('digest', digest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SokratisVidros any name suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Digest is fine, as it points to the step.
const parserEngine = new Liquid(LIQUID_CONFIG); | ||
|
||
// Register digest filter for validation of digest transformers | ||
parserEngine.registerFilter('digest', () => ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we have 2 version of liquid one in the framework and one in the API, didn't do it in this PR but worth considering consolidating them somehow or exporting from the framework the parser
@scopsy let's rebase this so as to resume implementation and do the final touch ups |
@SokratisVidros done |
* {{ users | digest: 2, "name" }} => For array of {name: string} | ||
* {{ users | digest: 2, "profile.name", "•" }} => "John • Josh and 3 others" | ||
*/ | ||
export function digest(array: unknown, maxNames = 2, keyPath?: string, separator = ', '): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about summarize?
this.templateEngine.registerFilter('json', (value, spaces) => | ||
stringifyDataStructureWithSingleQuotes(value, spaces) | ||
); | ||
this.templateEngine.registerFilter('digest', digest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Digest is fine, as it points to the step.
What changed? Why was the change needed?
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer