Skip to content

Commit 38f46c0

Browse files
Adrienjcabannes
authored andcommitted
feat(catalog-ui): add create ans override favorite buttons
1 parent 99ae470 commit 38f46c0

5 files changed

Lines changed: 58 additions & 0 deletions

File tree

apps/catalog-ui/docs/components/smart-filter/LinidSmartFilter.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ The component uses the LinID design system through `useUiDesign()` and applies p
110110
| `{uiNamespace}.linid-smart-filter.linid-favorite-panel.content.no-data-icon-section` | `q-item-section` | Avatar section for no-data item |
111111
| `{uiNamespace}.linid-smart-filter.linid-favorite-panel.content.no-data-icon-section` | `q-icon` | Avatar section for no-data item (icon) |
112112
| `{uiNamespace}.linid-smart-filter.linid-favorite-panel.content.no-data-label-section` | `q-item-section` | Label section for no-data item (name) |
113+
| `{uiNamespace}.linid-smart-filter.linid-favorite-panel.content.create-button` | `q-btn` | Create favorite button styling |
114+
| `{uiNamespace}.linid-smart-filter.linid-favorite-panel.content.override-button` | `q-btn` | Override favorite button styling |
113115
| `{uiNamespace}.linid-smart-filter.tree-search-filter-panel` | `GenericTree` | Tree component styling and configuration |
114116
| `{uiNamespace}.linid-smart-filter.tree-search-filter-panel` | `q-btn` | Search button styling |
115117
| `{uiNamespace}.linid-smart-filter.date-search-filter-panel` | `q-input` | Date text input field styling |
@@ -165,6 +167,8 @@ The component uses scoped i18n with the following translation keys:
165167
| `[INSTANCE_ID].LinidSmartFilter.NumberSearchFilterPanel.operators.notEquals` | Negated "equals" label | Radio option label | - |
166168
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.title` | Panel section title | Header title | - |
167169
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.noData` | No data panel section | No data label | - |
170+
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.createFavorite` | Label for create button | QBtn label | - |
171+
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.overrideFavorite` | Label for override button | QBtn label | - |
168172
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.deleteButton` | Label for delete button (optional, defaults to empty string) | QBtn label | - |
169173
| `[INSTANCE_ID].LinidSmartFilter.TreeSearchFilterPanel.searchButton` | Search button label | QBtn label | - |
170174
| `[INSTANCE_ID].LinidSmartFilter.ListSearchFilterPanel.searchButton` | Search button label | QBtn label | - |
@@ -204,6 +208,8 @@ Example:
204208
"LinidFavoritePanel": {
205209
"title": "Favorites",
206210
"noData": "No available favorites",
211+
"createFavorite": "Create Favorite",
212+
"overrideFavorite": "Override Favorite",
207213
"deleteButton": "Delete"
208214
},
209215
"TextSearchFilterPanel": {

apps/catalog-ui/docs/design.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,12 @@ Smart filtering component with toggle-able menu for managing active filters and
436436
},
437437
"no-data-label-section": {
438438
"q-item-section": {}
439+
},
440+
"create-button": {
441+
"q-btn": {}
442+
},
443+
"override-button": {
444+
"q-btn": {}
439445
}
440446
}
441447
},
@@ -858,6 +864,12 @@ A full example showing all CatalogUI components configured together:
858864
},
859865
"no-data-label-section": {
860866
"q-item-section": {}
867+
},
868+
"create-button": {
869+
"q-btn": {}
870+
},
871+
"override-button": {
872+
"q-btn": {}
861873
}
862874
}
863875
},

apps/catalog-ui/docs/i18n.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ The `FormDialog` component uses the following keys for internationalization:
446446
| `[INSTANCE_ID].LinidSmartFilter.NumberSearchFilterPanel.operators.notEquals` | Negated "equals" label | Radio option label | - |
447447
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.title` | Panel section title | Header title | - |
448448
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.noData` | No data panel section | No data label | - |
449+
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.createFavorite` | Label for create button | QBtn label | - |
450+
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.overrideFavorite` | Label for override button | QBtn label | - |
449451
| `[INSTANCE_ID].LinidSmartFilter.LinidFavoritePanel.deleteButton` | Label for delete button (optional, defaults to empty string) | QBtn label | - |
450452
| `[INSTANCE_ID].LinidSmartFilter.TreeSearchFilterPanel.searchButton` | Search button label | QBtn label | - |
451453
| `[INSTANCE_ID].LinidSmartFilter.ListSearchFilterPanel.searchButton` | Search button label | QBtn label | - |
@@ -485,6 +487,8 @@ The `FormDialog` component uses the following keys for internationalization:
485487
"LinidFavoritePanel": {
486488
"title": "Favorites",
487489
"noData": "No available favorites",
490+
"createFavorite": "Create Favorite",
491+
"overrideFavorite": "Override Favorite",
488492
"deleteButton": "Delete"
489493
},
490494
"TextSearchFilterPanel": {
@@ -621,6 +625,8 @@ export default {
621625
LinidFavoritePanel: {
622626
title: 'Favorites',
623627
noData: 'No available favorites',
628+
createFavorite: 'Create Favorite',
629+
overrideFavorite: 'Override Favorite',
624630
deleteButton: 'Delete',
625631
},
626632
TextSearchFilterPanel: {

apps/catalog-ui/src/components/smart-filter/LinidFavoritePanel.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@
3838
{{ t('title') }}
3939
</div>
4040

41+
<div class="q-gutter-sm q-pa-sm linid-favorite-panel--action-buttons">
42+
<q-btn
43+
v-bind="uiProps.createButton"
44+
:label="t('createFavorite')"
45+
:data-cy="`button_create`"
46+
@click="emit('create')"
47+
/>
48+
<q-btn
49+
v-bind="uiProps.overrideButton"
50+
:label="t('overrideFavorite')"
51+
:disable="favorites.length === 0"
52+
:data-cy="`button_override`"
53+
@click="emit('override')"
54+
/>
55+
</div>
56+
4157
<q-separator v-bind="uiProps.titleSeparator" />
4258

4359
<div class="row no-wrap linid-favorite-panel--content">
@@ -159,6 +175,14 @@ const uiProps = computed<LinidFavoritePanelUIProps>(() => ({
159175
`${contentUiNamespace}.delete-section`,
160176
'q-btn'
161177
),
178+
createButton: ui<LinidQBtnProps>(
179+
`${contentUiNamespace}.create-button`,
180+
'q-btn'
181+
),
182+
overrideButton: ui<LinidQBtnProps>(
183+
`${contentUiNamespace}.override-button`,
184+
'q-btn'
185+
),
162186
}));
163187
</script>
164188

apps/catalog-ui/src/types/linidFavoritePanel.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ export interface LinidFavoritePanelUIProps {
9797
* The UI properties for the delete button.
9898
*/
9999
deleteButton: LinidQBtnProps;
100+
/**
101+
* The UI properties for the create button.
102+
*/
103+
createButton: LinidQBtnProps;
104+
/**
105+
* The UI properties for the override button.
106+
*/
107+
overrideButton: LinidQBtnProps;
100108
}
101109

102110
/**
@@ -105,4 +113,6 @@ export interface LinidFavoritePanelUIProps {
105113
export type LinidFavoritePanelOutputs = {
106114
(e: 'apply', favorite: LinidFilterSet): void;
107115
(e: 'delete', favorite: LinidFilterSet): void;
116+
(e: 'create'): void;
117+
(e: 'override'): void;
108118
};

0 commit comments

Comments
 (0)