@finos/legend-application-marketplace 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js +1 -1
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/pages/DataAPIs/LegendMarketplaceDataAPIs.d.ts.map +1 -1
- package/lib/pages/DataAPIs/LegendMarketplaceDataAPIs.js +11 -8
- package/lib/pages/DataAPIs/LegendMarketplaceDataAPIs.js.map +1 -1
- package/lib/stores/dataAPIs/LegendMarketplaceDataAPIsStore.d.ts +2 -0
- package/lib/stores/dataAPIs/LegendMarketplaceDataAPIsStore.d.ts.map +1 -1
- package/lib/stores/dataAPIs/LegendMarketplaceDataAPIsStore.js +19 -1
- package/lib/stores/dataAPIs/LegendMarketplaceDataAPIsStore.js.map +1 -1
- package/package.json +10 -10
- package/src/__lib__/LegendMarketplaceNavigation.ts +1 -1
- package/src/pages/DataAPIs/LegendMarketplaceDataAPIs.tsx +28 -11
- package/src/stores/dataAPIs/LegendMarketplaceDataAPIsStore.ts +32 -1
|
@@ -117,6 +117,8 @@ const LEGEND_MARKETPLACE_SETTING_KEY_DEPLOYMENT_ID_FILTERS =
|
|
|
117
117
|
'marketplace.data-apis.deploymentIdFilters';
|
|
118
118
|
const LEGEND_MARKETPLACE_SETTING_KEY_SERVICES_VIEW_MODE =
|
|
119
119
|
'marketplace.data-apis.viewMode';
|
|
120
|
+
const LEGEND_MARKETPLACE_SETTING_KEY_SHOW_OWN_SERVICES =
|
|
121
|
+
'marketplace.data-apis.showOwnServicesOnly';
|
|
120
122
|
|
|
121
123
|
export class LegendMarketplaceDataAPIsStore {
|
|
122
124
|
readonly marketplaceBaseStore: LegendMarketplaceBaseStore;
|
|
@@ -124,6 +126,7 @@ export class LegendMarketplaceDataAPIsStore {
|
|
|
124
126
|
searchQuery = '';
|
|
125
127
|
sort: LegendServiceSort = LegendServiceSort.DEFAULT;
|
|
126
128
|
viewMode: ServicesViewMode;
|
|
129
|
+
showOwnServicesOnly: boolean;
|
|
127
130
|
serviceCardStates: LegendServiceCardState[] = [];
|
|
128
131
|
page = 1;
|
|
129
132
|
itemsPerPage = 12;
|
|
@@ -153,12 +156,19 @@ export class LegendMarketplaceDataAPIsStore {
|
|
|
153
156
|
persistedViewMode as ServicesViewMode,
|
|
154
157
|
)
|
|
155
158
|
? (persistedViewMode as ServicesViewMode)
|
|
156
|
-
: ServicesViewMode.
|
|
159
|
+
: ServicesViewMode.TILE;
|
|
160
|
+
|
|
161
|
+
const persistedShowOwn =
|
|
162
|
+
this.marketplaceBaseStore.applicationStore.settingService.getBooleanValue(
|
|
163
|
+
LEGEND_MARKETPLACE_SETTING_KEY_SHOW_OWN_SERVICES,
|
|
164
|
+
);
|
|
165
|
+
this.showOwnServicesOnly = persistedShowOwn ?? false;
|
|
157
166
|
|
|
158
167
|
makeObservable(this, {
|
|
159
168
|
searchQuery: observable,
|
|
160
169
|
sort: observable,
|
|
161
170
|
viewMode: observable,
|
|
171
|
+
showOwnServicesOnly: observable,
|
|
162
172
|
serviceCardStates: observable,
|
|
163
173
|
page: observable,
|
|
164
174
|
itemsPerPage: observable,
|
|
@@ -167,6 +177,7 @@ export class LegendMarketplaceDataAPIsStore {
|
|
|
167
177
|
setSearchQuery: action,
|
|
168
178
|
setSort: action,
|
|
169
179
|
setViewMode: action,
|
|
180
|
+
setShowOwnServicesOnly: action,
|
|
170
181
|
setPage: action,
|
|
171
182
|
setItemsPerPage: action,
|
|
172
183
|
addOwnerFilter: action,
|
|
@@ -200,6 +211,15 @@ export class LegendMarketplaceDataAPIsStore {
|
|
|
200
211
|
);
|
|
201
212
|
}
|
|
202
213
|
|
|
214
|
+
setShowOwnServicesOnly(value: boolean): void {
|
|
215
|
+
this.showOwnServicesOnly = value;
|
|
216
|
+
this.page = 1;
|
|
217
|
+
this.marketplaceBaseStore.applicationStore.settingService.persistValue(
|
|
218
|
+
LEGEND_MARKETPLACE_SETTING_KEY_SHOW_OWN_SERVICES,
|
|
219
|
+
value,
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
203
223
|
setPage(value: number): void {
|
|
204
224
|
this.page = value;
|
|
205
225
|
}
|
|
@@ -300,6 +320,17 @@ export class LegendMarketplaceDataAPIsStore {
|
|
|
300
320
|
get filteredSortedServices(): LegendServiceCardState[] {
|
|
301
321
|
let results = this.serviceCardStates;
|
|
302
322
|
|
|
323
|
+
if (this.showOwnServicesOnly) {
|
|
324
|
+
const currentUser =
|
|
325
|
+
this.marketplaceBaseStore.applicationStore.identityService.currentUser;
|
|
326
|
+
if (currentUser) {
|
|
327
|
+
const userId = currentUser.toLowerCase();
|
|
328
|
+
results = results.filter((card) =>
|
|
329
|
+
card.owners.some((owner) => owner.toLowerCase() === userId),
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
303
334
|
if (this.searchQuery) {
|
|
304
335
|
const query = this.searchQuery.replace(/^\//u, '').toLowerCase();
|
|
305
336
|
results = results.filter(
|