-
Couldn't load subscription status.
- Fork 15
feat(model-ad): add comparison-tool components (MG-423) #3561
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
base: main
Are you sure you want to change the base?
Conversation
…ledBlocking initial navigation in the same application, which is a contradiction.
| } | ||
|
|
||
| const result = await ComparisonToolConfigCollection.find({ page }).lean().exec(); | ||
| const result = await ComparisonToolConfigCollection.find().lean().exec(); |
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.
get all configs going forward and cache it
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.
Would you mind expanding on the benefits of returning all of the possible configs rather than just the config for a single page?
| shouldShowList() { | ||
| return this.hasSelectedFilters() || this.significanceThresholdActive; | ||
| } | ||
|
|
||
| clearList() { | ||
| this.removeSignificanceThresholdFilter(); | ||
| this.clearSelectedFilters(); | ||
| } | ||
|
|
||
| /* ----------------------------------------------------------------------- */ | ||
| /* Filters | ||
| /* ----------------------------------------------------------------------- */ | ||
| hasSelectedFilters() { | ||
| for (const filter of this.filters) { | ||
| if (filter.options.filter((option) => option.selected).length > 0) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| clearSelectedFilters(option?: GCTFilterOption) { | ||
| if (option) { | ||
| option.selected = false; | ||
| } else { | ||
| for (const filter of this.filters) { | ||
| for (const o of filter.options) { | ||
| o.selected = false; | ||
| } | ||
| } | ||
| } | ||
| this.changeEvent.emit(this.filters); | ||
| } | ||
|
|
||
| /* ----------------------------------------------------------------------- */ | ||
| /* Significance Threshold | ||
| /* ----------------------------------------------------------------------- */ | ||
| removeSignificanceThresholdFilter(): void { | ||
| this.significanceThresholdActive = false; | ||
| this.onremoveSignificanceThresholdFilter.emit(this.significanceThresholdActive); | ||
| } |
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.
this logic should be handled in FilterPanelService in the future (MG-435)
| export const intersectFilterCallback = function (value: any, filters: any): boolean { | ||
| if (filters === undefined || filters === null || filters.length < 1) { | ||
| return true; | ||
| } else if (value === undefined || value === null || filters.length < 1) { | ||
| return false; | ||
| } | ||
|
|
||
| for (const filter of filters) { | ||
| if (value.indexOf(filter) !== -1) { | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
| return false; | ||
| }; | ||
|
|
||
| export const urlLinkCallback = function (value: any, filters: any): boolean { | ||
| console.log('urlLinkCallback', value, filters); | ||
| if (filters === undefined || filters === null || filters.length < 1) { | ||
| return true; | ||
| } else if (value === undefined || value === null || filters.length < 1) { | ||
| return false; | ||
| } | ||
|
|
||
| for (const filter of filters) { | ||
| if (value.link_url && value.link_url.indexOf(filter) !== -1) { | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
| return false; | ||
| }; |
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 are custom filters not found in PrimeNG defaults
| '/explorers-assets/icons/card-arrow.svg', | ||
| '/explorers-assets/icons/close.svg', | ||
| '/explorers-assets/icons/cog.svg', | ||
| '/explorers-assets/icons/column.svg', | ||
| '/explorers-assets/icons/download.svg', | ||
| '/explorers-assets/icons/external-link.svg', | ||
| '/explorers-assets/icons/gct.svg', | ||
| '/explorers-assets/icons/info-circle.svg', | ||
| '/explorers-assets/icons/link.svg', | ||
| '/explorers-assets/icons/pin.svg', | ||
| '/explorers-assets/icons/search.svg', |
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.
adding missing svgs
| button { | ||
| position: absolute; | ||
| top: 0; | ||
| right: 0; | ||
| width: 40px; | ||
| height: 100%; | ||
| cursor: pointer; | ||
|
|
||
| &:hover explorers-svg-icon { | ||
| path { | ||
| fill: var(--color-action-primary); | ||
| } | ||
| } | ||
| } |
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.
This will need to be adjusted in the future as the main-table equivalent in Agora is under this element.
| alert('Filter panel toggled'); | ||
| } | ||
| filterResultsButtonTooltip = input.required<string>(); | ||
| shareUrlButtonTooltip = input.required<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.
The shareUrlButtonTooltip input was removed in #3545 - the tooltip value is now managed in libs/explorers/comparison-tools/src/lib/comparison-tool-header/comparison-tool-share-url-button/comparison-tool-share-url-button.component.ts. See below comment -- if we want to bring back the shareUrlButtonTooltip, then we would need to update the comparison-tool-share-url-button.
| styleUrls: ['./comparison-tool-share-url-button.component.scss'], | ||
| }) | ||
| export class ComparisonToolShareURLButtonComponent { | ||
| tooltip = input(''); |
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.
The tooltip input is currently unused -- if we want to pass in a tooltip value here, we would need to use it in getTooltipText.
|
@sagely1 Please set the assignee to yourself on PRs. List Jira ticket IDs using a single parenthesis "(MG-246) (MG-423)" --> "(MG-246, MG-423)" |
Description
This PR adds CT components and updates the config handling logic.
Related Issues
Changelog
Preview
https://www.loom.com/share/6f86e3dab89a43bcb7eb0df699ef64f1