@startinblox/components-ds4go 3.0.3 → 3.1.1
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/.storybook/preview.ts +1 -0
- package/biome.json +1 -1
- package/dist/custom-getter-ZPFnoSjt-BCNOlbJZ-CyAxB8aT.js +338 -0
- package/dist/en-BySYJZMr-CWZl5AwU-CWZl5AwU.js +14 -0
- package/dist/fr-BZZDTsmw-CNDWt66j-CNDWt66j.js +14 -0
- package/dist/index-Dmongh3N.js +104995 -0
- package/dist/index.js +1 -3032
- package/dist/quill.snow-C_A_QkE8-D-uedtvC-D-uedtvC.js +13 -0
- package/dist/slimselect-NFLzJMfV-DZ7j6Vsj-DZ7j6Vsj.js +5 -0
- package/package.json +9 -8
- package/src/components/cards/ds4go-card-catalog.ts +132 -0
- package/src/components/catalog/ds4go-catalog-filter-holder.ts +459 -0
- package/src/components/catalog/ds4go-customer-holder.ts +162 -0
- package/src/components/catalog/ds4go-fact-bundle-holder.ts +13 -7
- package/src/components/modal/ds4go-customer-modal.ts +134 -0
- package/src/components/modal/ds4go-fact-bundle-modal.ts +2 -2
- package/src/components/solid-customer-list.ts +195 -0
- package/src/components/solid-dsif-explorer-poc.ts +8 -8
- package/src/components/solid-dsp-connector.ts +12 -4
- package/src/components/solid-fact-bundle-creation.ts +261 -154
- package/src/components/solid-fact-bundle.ts +10 -4
- package/src/helpers/components/orbitComponent.ts +12 -13
- package/src/helpers/i18n/configureLocalization.ts +12 -5
- package/src/helpers/index.ts +0 -2
- package/src/styles/cards/ds4go-card-catalog.scss +149 -0
- package/src/styles/fact-bundle-creation.scss +6 -2
- package/src/styles/modal/ds4go-customer-modal.scss +91 -0
- package/src/styles/modal/ds4go-fact-bundle-modal.scss +1 -1
- package/vite.config.ts +7 -7
- package/src/components/solid-boilerplate.ts +0 -76
- package/src/helpers/components/ResourceMapper.ts +0 -469
- package/src/helpers/components/orbitDspComponent.ts +0 -250
- package/src/helpers/mappings/dsp-mapping-config.ts +0 -545
|
@@ -17,6 +17,13 @@ import ComponentStyles from "@styles/fact-bundle-creation.scss?inline";
|
|
|
17
17
|
import { html, nothing, unsafeCSS } from "lit";
|
|
18
18
|
import { customElement, property, state } from "lit/decorators.js";
|
|
19
19
|
|
|
20
|
+
const formatCase = (str: string) => {
|
|
21
|
+
return str
|
|
22
|
+
.replace(/([A-Z])/g, " $1")
|
|
23
|
+
.replace(/^./, (str) => str.toUpperCase())
|
|
24
|
+
.trim();
|
|
25
|
+
};
|
|
26
|
+
|
|
20
27
|
@customElement("solid-fact-bundle-creation")
|
|
21
28
|
export class SolidFactBundle extends OrbitComponent {
|
|
22
29
|
static styles = [unsafeCSS(ComponentStyles)];
|
|
@@ -36,9 +43,15 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
36
43
|
@state()
|
|
37
44
|
bundleDescription = "";
|
|
38
45
|
|
|
46
|
+
@state()
|
|
47
|
+
bundleCategory = "";
|
|
48
|
+
|
|
39
49
|
@state()
|
|
40
50
|
bundleLanguage = "en";
|
|
41
51
|
|
|
52
|
+
@state()
|
|
53
|
+
step = 0;
|
|
54
|
+
|
|
42
55
|
policyTemplates: { id: string; name: string; policy: OdrlPolicy }[] = [
|
|
43
56
|
{
|
|
44
57
|
id: "policy-open-access",
|
|
@@ -165,6 +178,23 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
165
178
|
this.spliceLength = this.facts.length;
|
|
166
179
|
}
|
|
167
180
|
|
|
181
|
+
_nextStep() {
|
|
182
|
+
if (this.selectedFacts.length > 0) {
|
|
183
|
+
this.step++;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
_reset() {
|
|
188
|
+
this.bundleName = "";
|
|
189
|
+
this.bundleDescription = "";
|
|
190
|
+
this.bundleCategory = "";
|
|
191
|
+
this.bundleLanguage = "en";
|
|
192
|
+
this.bundleAccessPolicy = this.policyTemplates[0].id;
|
|
193
|
+
this.bundleContractPolicy = this.policyTemplates[0].id;
|
|
194
|
+
this.selectedFacts = [];
|
|
195
|
+
this.step = 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
168
198
|
async _createFactBundle() {
|
|
169
199
|
if (!this.bundleName || !(this.selectedFacts.length > 0)) {
|
|
170
200
|
return;
|
|
@@ -177,6 +207,7 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
177
207
|
],
|
|
178
208
|
"@type": ["ldp:Container", "ds4go:FactBundle"],
|
|
179
209
|
name: this.bundleName,
|
|
210
|
+
category: this.bundleCategory,
|
|
180
211
|
description: this.bundleDescription || "",
|
|
181
212
|
"ldp:contains": this.selectedFacts.map((fact: Resource) => ({
|
|
182
213
|
"@id": fact["@id"],
|
|
@@ -217,7 +248,21 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
217
248
|
name: this.bundleName,
|
|
218
249
|
description: this.bundleDescription,
|
|
219
250
|
contenttype: "application/ld+json",
|
|
220
|
-
language: this.bundleLanguage,
|
|
251
|
+
"dcterms:language": this.bundleLanguage,
|
|
252
|
+
category: this.bundleCategory,
|
|
253
|
+
bundleSize: this.selectedFacts.length,
|
|
254
|
+
offeredAccess: "40",
|
|
255
|
+
pricingTier: "premium",
|
|
256
|
+
// "dcat:endpointUrl": "https://api.stg.ds4go.startinblox.com/facts/", // ?
|
|
257
|
+
previewLinks: this.selectedFacts.slice(0, 3).join(", "),
|
|
258
|
+
"dsif:pricing": {
|
|
259
|
+
"dsif:costPerAPICall": 0.15,
|
|
260
|
+
"dsif:setupFee": 50,
|
|
261
|
+
"dsif:billingPeriod": "monthly",
|
|
262
|
+
"dsif:currency": "EUR",
|
|
263
|
+
"dsif:description":
|
|
264
|
+
"Premium tier: 40 API calls/month, ideal for media organizations",
|
|
265
|
+
},
|
|
221
266
|
},
|
|
222
267
|
dataAddress: {
|
|
223
268
|
"@type": "DataAddress",
|
|
@@ -267,28 +312,26 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
267
312
|
const TemsAssetManagement = document.querySelector(
|
|
268
313
|
"solid-tems-assets-management",
|
|
269
314
|
);
|
|
270
|
-
if (TemsAssetManagement) {
|
|
315
|
+
if (TemsAssetManagement?.loadAssets) {
|
|
271
316
|
TemsAssetManagement.loadAssets();
|
|
272
317
|
}
|
|
273
318
|
|
|
274
319
|
const TemsPoliciesManagement = document.querySelector(
|
|
275
320
|
"solid-tems-policies-management",
|
|
276
321
|
);
|
|
277
|
-
if (TemsPoliciesManagement) {
|
|
322
|
+
if (TemsPoliciesManagement?.loadPolicies) {
|
|
278
323
|
TemsPoliciesManagement.loadPolicies();
|
|
279
324
|
}
|
|
280
325
|
|
|
281
326
|
const TemsContractsManagement = document.querySelector(
|
|
282
327
|
"solid-tems-contracts-management",
|
|
283
328
|
);
|
|
284
|
-
if (TemsContractsManagement) {
|
|
329
|
+
if (TemsContractsManagement?.loadData) {
|
|
285
330
|
TemsContractsManagement.loadData();
|
|
286
331
|
}
|
|
287
332
|
}
|
|
288
333
|
|
|
289
|
-
this.
|
|
290
|
-
this.bundleDescription = "";
|
|
291
|
-
this.selectedFacts = [];
|
|
334
|
+
this._reset();
|
|
292
335
|
|
|
293
336
|
const factbundleComponent: any = this.orbit?.components.find(
|
|
294
337
|
(c) => c.type === "fact-bundle",
|
|
@@ -327,6 +370,13 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
327
370
|
}
|
|
328
371
|
}
|
|
329
372
|
|
|
373
|
+
_selectBundleCategory(e: Event) {
|
|
374
|
+
e.preventDefault();
|
|
375
|
+
if (e.target) {
|
|
376
|
+
this.bundleCategory = e.target.value;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
330
380
|
_selectBundleContractPolicy(e: Event) {
|
|
331
381
|
e.preventDefault();
|
|
332
382
|
if (e.target) {
|
|
@@ -370,75 +420,33 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
370
420
|
return html`<tems-viewport>
|
|
371
421
|
<tems-header slot="header" heading=${this.header}>
|
|
372
422
|
<div slot="cta">
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
423
|
+
${this.step === 0
|
|
424
|
+
? html`<tems-button
|
|
425
|
+
type="primary"
|
|
426
|
+
disabled=${this.selectedFacts.length === 0 || nothing}
|
|
427
|
+
label=${msg("Set bundle informations")}
|
|
428
|
+
@click=${this._nextStep}
|
|
429
|
+
></tems-button>`
|
|
430
|
+
: html`<div class="flex">
|
|
431
|
+
<tems-button
|
|
432
|
+
type="link-color"
|
|
433
|
+
label=${msg("Cancel bundle creation")}
|
|
434
|
+
@click=${this._reset}
|
|
435
|
+
></tems-button
|
|
436
|
+
><tems-button
|
|
437
|
+
type="primary"
|
|
438
|
+
disabled=${!allowCreation || nothing}
|
|
439
|
+
label=${msg("Create bundle")}
|
|
440
|
+
@click=${this._createFactBundle}
|
|
441
|
+
></tems-button>
|
|
442
|
+
</div>`}
|
|
379
443
|
</div>
|
|
380
444
|
</tems-header>
|
|
381
445
|
<div slot="content">
|
|
382
446
|
<section class="flex flex-1">
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
type="text"
|
|
387
|
-
label=${msg("Bundle name")}
|
|
388
|
-
placeholder=${msg("Bundle name")}
|
|
389
|
-
required=""
|
|
390
|
-
.value=${this.bundleName}
|
|
391
|
-
@change=${this._updateBundleName}
|
|
392
|
-
></tems-input>
|
|
393
|
-
</div>
|
|
394
|
-
<div>
|
|
395
|
-
<tems-textarea
|
|
396
|
-
rows="4"
|
|
397
|
-
label=${msg("Bundle description")}
|
|
398
|
-
placeholder=${msg("Bundle description")}
|
|
399
|
-
.value=${this.bundleDescription}
|
|
400
|
-
@change=${this._updateBundleDescription}
|
|
401
|
-
></tems-textarea>
|
|
402
|
-
</div>
|
|
403
|
-
<div>
|
|
404
|
-
<tems-input
|
|
405
|
-
type="text"
|
|
406
|
-
label=${msg("Language")}
|
|
407
|
-
placeholder=${msg("Language code (en, de, es, fr...)")}
|
|
408
|
-
hint=${msg("Comma-separated, eg.: en,de,es,fr)")}
|
|
409
|
-
required=""
|
|
410
|
-
.value=${this.bundleLanguage}
|
|
411
|
-
@change=${this._updateBundleLanguage}
|
|
412
|
-
></tems-input>
|
|
413
|
-
</div>
|
|
414
|
-
<div class="select">
|
|
415
|
-
<tems-label label=${msg("Access policy")}></tems-label>
|
|
416
|
-
<select @change=${this._selectBundleAccessPolicy}>
|
|
417
|
-
${this.policyTemplates.map((policy) => {
|
|
418
|
-
return html`<option
|
|
419
|
-
value="${policy.id}"
|
|
420
|
-
?selected="${policy.id === this.bundleAccessPolicy}"
|
|
421
|
-
>
|
|
422
|
-
${policy.name}
|
|
423
|
-
</option>`;
|
|
424
|
-
})}
|
|
425
|
-
</select>
|
|
426
|
-
</div>
|
|
427
|
-
<div class="select">
|
|
428
|
-
<tems-label label=${msg("Contract policy")}></tems-label>
|
|
429
|
-
<select @change=${this._selectBundleContractPolicy}>
|
|
430
|
-
${this.policyTemplates.map((policy) => {
|
|
431
|
-
return html`<option
|
|
432
|
-
value="${policy.id}"
|
|
433
|
-
?selected="${policy.id === this.bundleContractPolicy}"
|
|
434
|
-
>
|
|
435
|
-
${policy.name}
|
|
436
|
-
</option>`;
|
|
437
|
-
})}
|
|
438
|
-
</select>
|
|
439
|
-
</div>
|
|
440
|
-
${selectedFactsCount > 0
|
|
441
|
-
? html`<tems-division type="h4">
|
|
447
|
+
${this.step === 0
|
|
448
|
+
? html`<div>
|
|
449
|
+
<tems-division type="h4">
|
|
442
450
|
<div>
|
|
443
451
|
${msg(
|
|
444
452
|
str`${selectedFactsCount} selected fact${selectedFactsCount > 1 ? "s" : ""}`,
|
|
@@ -459,7 +467,7 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
459
467
|
type: "information",
|
|
460
468
|
});
|
|
461
469
|
}
|
|
462
|
-
return html`<
|
|
470
|
+
return html`<ds4go-card-catalog
|
|
463
471
|
.object=${import.meta.env.DEV ? fact : nothing}
|
|
464
472
|
.header=${fact.name || nothing}
|
|
465
473
|
date=${fact.updated_at || nothing}
|
|
@@ -468,91 +476,190 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
468
476
|
fact,
|
|
469
477
|
)}
|
|
470
478
|
selected=${true}
|
|
471
|
-
></
|
|
479
|
+
></ds4go-card-catalog>`;
|
|
472
480
|
})}
|
|
473
|
-
</div
|
|
474
|
-
: nothing}
|
|
475
|
-
</div>
|
|
476
|
-
${splicedDatas.length > 0 || this.filterFactText
|
|
477
|
-
? html`<div>
|
|
478
|
-
<div>
|
|
479
|
-
<tems-search-bar
|
|
480
|
-
.displayFilters=${false}
|
|
481
|
-
.displaySavedSearch=${false}
|
|
482
|
-
.displayViews=${false}
|
|
483
|
-
.dropdownCardElement=${false}
|
|
484
|
-
.dropdownListElement=${false}
|
|
485
|
-
.dropdownTableElement=${false}
|
|
486
|
-
.dropdownMapElement=${false}
|
|
487
|
-
.displayActiveTags=${false}
|
|
488
|
-
.value=${this.filterFactText}
|
|
489
|
-
@search=${this._searchFacts}
|
|
490
|
-
></tems-search-bar>
|
|
481
|
+
</div>
|
|
491
482
|
</div>
|
|
492
|
-
${splicedDatas.length > 0
|
|
493
|
-
? html
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
return html`<tems-card-catalog
|
|
511
|
-
.object=${import.meta.env.DEV
|
|
512
|
-
? fact
|
|
513
|
-
: nothing}
|
|
514
|
-
.tags=${tags}
|
|
515
|
-
.header=${fact.name || nothing}
|
|
516
|
-
.content=${fact.description || nothing}
|
|
517
|
-
date=${fact.updated_at || nothing}
|
|
518
|
-
@click=${this._toggleFactSelection.bind(
|
|
519
|
-
this,
|
|
520
|
-
fact,
|
|
521
|
-
)}
|
|
522
|
-
></tems-card-catalog>`;
|
|
523
|
-
})}
|
|
483
|
+
${splicedDatas.length > 0 || this.filterFactText
|
|
484
|
+
? html`<div>
|
|
485
|
+
<div>
|
|
486
|
+
<tems-search-bar
|
|
487
|
+
.displayFilters=${false}
|
|
488
|
+
.displaySavedSearch=${false}
|
|
489
|
+
.displayViews=${false}
|
|
490
|
+
.dropdownCardElement=${false}
|
|
491
|
+
.dropdownListElement=${false}
|
|
492
|
+
.dropdownTableElement=${false}
|
|
493
|
+
.dropdownMapElement=${false}
|
|
494
|
+
.displayActiveTags=${false}
|
|
495
|
+
.value=${this.filterFactText}
|
|
496
|
+
@search=${this._searchFacts}
|
|
497
|
+
></tems-search-bar>
|
|
524
498
|
</div>
|
|
525
|
-
${splicedDatas.length
|
|
526
|
-
? html
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
499
|
+
${splicedDatas.length > 0
|
|
500
|
+
? html` <div class="card-grid card-grid-vertical">
|
|
501
|
+
${splicedDatas.map((fact: Resource) => {
|
|
502
|
+
const tags = fact.categories.map(
|
|
503
|
+
(c: Resource) => ({
|
|
504
|
+
name: c.name,
|
|
505
|
+
type: "information",
|
|
506
|
+
}),
|
|
507
|
+
);
|
|
508
|
+
if (tags.length > 3) {
|
|
509
|
+
const overflowTags = tags.length - 3;
|
|
510
|
+
tags.splice(3, overflowTags);
|
|
511
|
+
tags.push({
|
|
512
|
+
name: `+${overflowTags} ${msg("more")}`,
|
|
513
|
+
type: "information",
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return html`<ds4go-card-catalog
|
|
518
|
+
.object=${import.meta.env.DEV
|
|
519
|
+
? fact
|
|
520
|
+
: nothing}
|
|
521
|
+
.tags=${tags}
|
|
522
|
+
.header=${fact.name || nothing}
|
|
523
|
+
.content=${fact.description || nothing}
|
|
524
|
+
date=${fact.updated_at || nothing}
|
|
525
|
+
@click=${this._toggleFactSelection.bind(
|
|
526
|
+
this,
|
|
527
|
+
fact,
|
|
528
|
+
)}
|
|
529
|
+
></ds4go-card-catalog>`;
|
|
530
|
+
})}
|
|
547
531
|
</div>
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
532
|
+
${splicedDatas.length < datas.length
|
|
533
|
+
? html`<div
|
|
534
|
+
class="flex flex-row justify-content-space-between align-items-flex-end"
|
|
535
|
+
>
|
|
536
|
+
<div>
|
|
537
|
+
${msg(
|
|
538
|
+
str`Displaying ${splicedDatas.length} of ${datas.length} result${datas.length > 1 ? "s" : ""}`,
|
|
539
|
+
)}
|
|
540
|
+
</div>
|
|
541
|
+
<div class="flex flex-row gap-400">
|
|
542
|
+
<tems-button
|
|
543
|
+
@click=${this._showMoreResults}
|
|
544
|
+
type="primary"
|
|
545
|
+
size="sm"
|
|
546
|
+
label=${msg("Show more results")}
|
|
547
|
+
></tems-button>
|
|
548
|
+
<tems-button
|
|
549
|
+
@click=${this._showAllResults}
|
|
550
|
+
type="primary"
|
|
551
|
+
size="sm"
|
|
552
|
+
label=${msg("Show all results")}
|
|
553
|
+
></tems-button>
|
|
554
|
+
</div>
|
|
555
|
+
</div>`
|
|
556
|
+
: nothing}`
|
|
557
|
+
: html`${msg("No results found")}
|
|
558
|
+
${this.filterFactText
|
|
559
|
+
? `for "${this.filterFactText}".`
|
|
560
|
+
: ""}`}
|
|
561
|
+
</div>`
|
|
562
|
+
: nothing}`
|
|
563
|
+
: html`<div>
|
|
564
|
+
<div>
|
|
565
|
+
<tems-input
|
|
566
|
+
type="text"
|
|
567
|
+
label=${msg("Bundle name")}
|
|
568
|
+
placeholder=${msg("Bundle name")}
|
|
569
|
+
required=""
|
|
570
|
+
.value=${this.bundleName}
|
|
571
|
+
@change=${this._updateBundleName}
|
|
572
|
+
></tems-input>
|
|
573
|
+
</div>
|
|
574
|
+
<div>
|
|
575
|
+
<tems-input
|
|
576
|
+
type="text"
|
|
577
|
+
label=${msg("Language")}
|
|
578
|
+
placeholder=${msg(
|
|
579
|
+
"Language code (en, de, es, fr...)",
|
|
580
|
+
)}
|
|
581
|
+
hint=${msg("Comma-separated, eg.: en,de,es,fr)")}
|
|
582
|
+
required=""
|
|
583
|
+
.value=${this.bundleLanguage}
|
|
584
|
+
@change=${this._updateBundleLanguage}
|
|
585
|
+
></tems-input>
|
|
586
|
+
</div>
|
|
587
|
+
<div class="select">
|
|
588
|
+
<tems-label label=${msg("Category")}></tems-label>
|
|
589
|
+
<select @change=${this._selectBundleCategory}>
|
|
590
|
+
<option
|
|
591
|
+
value=""
|
|
592
|
+
?selected="${"" === this.bundleCategory}"
|
|
593
|
+
>
|
|
594
|
+
${msg("No category")}
|
|
595
|
+
</option>
|
|
596
|
+
${Array.from(
|
|
597
|
+
new Set(
|
|
598
|
+
this.selectedFacts.flatMap((fact) =>
|
|
599
|
+
fact.categories.map((category: Resource) =>
|
|
600
|
+
formatCase(category.name),
|
|
601
|
+
),
|
|
602
|
+
),
|
|
603
|
+
),
|
|
604
|
+
)
|
|
605
|
+
.filter((i) => i)
|
|
606
|
+
.sort((a, b) => a.localeCompare(b))
|
|
607
|
+
.map(
|
|
608
|
+
(category: string) =>
|
|
609
|
+
html`<option
|
|
610
|
+
value="${category}"
|
|
611
|
+
?selected="${category ===
|
|
612
|
+
this.bundleCategory}"
|
|
613
|
+
>
|
|
614
|
+
${category}
|
|
615
|
+
</option>`,
|
|
616
|
+
)}
|
|
617
|
+
</select>
|
|
618
|
+
</div>
|
|
619
|
+
</div>
|
|
620
|
+
<div>
|
|
621
|
+
<div>
|
|
622
|
+
<tems-textarea
|
|
623
|
+
rows="5"
|
|
624
|
+
label=${msg("Bundle description")}
|
|
625
|
+
placeholder=${msg("Bundle description")}
|
|
626
|
+
.value=${this.bundleDescription}
|
|
627
|
+
@change=${this._updateBundleDescription}
|
|
628
|
+
></tems-textarea>
|
|
629
|
+
</div>
|
|
630
|
+
<div class="select">
|
|
631
|
+
<tems-label
|
|
632
|
+
label=${msg("Access policy")}
|
|
633
|
+
></tems-label>
|
|
634
|
+
<select @change=${this._selectBundleAccessPolicy}>
|
|
635
|
+
${this.policyTemplates.map((policy) => {
|
|
636
|
+
return html`<option
|
|
637
|
+
value="${policy.id}"
|
|
638
|
+
?selected="${policy.id ===
|
|
639
|
+
this.bundleAccessPolicy}"
|
|
640
|
+
>
|
|
641
|
+
${policy.name}
|
|
642
|
+
</option>`;
|
|
643
|
+
})}
|
|
644
|
+
</select>
|
|
645
|
+
</div>
|
|
646
|
+
<div class="select">
|
|
647
|
+
<tems-label
|
|
648
|
+
label=${msg("Contract policy")}
|
|
649
|
+
></tems-label>
|
|
650
|
+
<select @change=${this._selectBundleContractPolicy}>
|
|
651
|
+
${this.policyTemplates.map((policy) => {
|
|
652
|
+
return html`<option
|
|
653
|
+
value="${policy.id}"
|
|
654
|
+
?selected="${policy.id ===
|
|
655
|
+
this.bundleContractPolicy}"
|
|
656
|
+
>
|
|
657
|
+
${policy.name}
|
|
658
|
+
</option>`;
|
|
659
|
+
})}
|
|
660
|
+
</select>
|
|
661
|
+
</div>
|
|
662
|
+
</div>`}
|
|
556
663
|
</section>
|
|
557
664
|
</div>
|
|
558
665
|
</tems-viewport>`;
|
|
@@ -49,6 +49,7 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
49
49
|
{ key: "created_at", value: "created_at", cast: formatDate },
|
|
50
50
|
{ key: "updated_at", value: "updated_at", cast: formatDate },
|
|
51
51
|
{ key: "name", value: "name" },
|
|
52
|
+
{ key: "category", value: "category" },
|
|
52
53
|
{ key: "description", value: "description" },
|
|
53
54
|
];
|
|
54
55
|
|
|
@@ -95,7 +96,9 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
95
96
|
`[uniq="${this.orbit?.getComponent("menu")?.uniq}"]`,
|
|
96
97
|
);
|
|
97
98
|
|
|
98
|
-
this.bundleCreationComponent = this.orbit?.components.find(
|
|
99
|
+
this.bundleCreationComponent = this.orbit?.components.find(
|
|
100
|
+
(c) => c.type === "fact-bundle-creation",
|
|
101
|
+
);
|
|
99
102
|
|
|
100
103
|
return Promise.resolve();
|
|
101
104
|
}
|
|
@@ -145,7 +148,10 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
145
148
|
this.dataSrc = dataSrc;
|
|
146
149
|
}
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
if (this.objects.length > 0) {
|
|
152
|
+
return sort(this.objects, "name", "asc");
|
|
153
|
+
}
|
|
154
|
+
return [];
|
|
149
155
|
},
|
|
150
156
|
args: () => [
|
|
151
157
|
this.defaultDataSrc,
|
|
@@ -225,14 +231,14 @@ export class SolidFactBundle extends OrbitComponent {
|
|
|
225
231
|
</div>
|
|
226
232
|
</tems-header>
|
|
227
233
|
<div slot="content">
|
|
228
|
-
<
|
|
234
|
+
<ds4go-catalog-filter-holder
|
|
229
235
|
.displayFiltering=${this.displayFiltering}
|
|
230
236
|
@search=${this._search}
|
|
231
237
|
.search=${this.search}
|
|
232
238
|
.objects=${datas}
|
|
233
239
|
.resultCount=${this.resultCount}
|
|
234
240
|
.filterCount=${this.filterCount}
|
|
235
|
-
></
|
|
241
|
+
></ds4go-catalog-filter-holder>
|
|
236
242
|
<ds4go-fact-bundle-holder
|
|
237
243
|
.objects=${datas}
|
|
238
244
|
.search=${this.search}
|
|
@@ -98,20 +98,19 @@ export default class extends ComponentObjectsHandler {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
await this._afterAttach();
|
|
103
|
-
|
|
104
|
-
this.ready = true;
|
|
105
|
-
this.dispatchEvent(
|
|
106
|
-
new CustomEvent("component-ready", {
|
|
107
|
-
detail: {
|
|
108
|
-
component: this.component,
|
|
109
|
-
},
|
|
110
|
-
}),
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
return Promise.resolve(true);
|
|
114
101
|
}
|
|
102
|
+
await this._afterAttach();
|
|
103
|
+
|
|
104
|
+
this.ready = true;
|
|
105
|
+
this.dispatchEvent(
|
|
106
|
+
new CustomEvent("component-ready", {
|
|
107
|
+
detail: {
|
|
108
|
+
component: this.component,
|
|
109
|
+
},
|
|
110
|
+
}),
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
return Promise.resolve(true);
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
return Promise.resolve(false);
|
|
@@ -10,8 +10,15 @@ const localizedTemplates: Map<string, any> = new Map(
|
|
|
10
10
|
]),
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
export const { getLocale, setLocale } =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export const { getLocale, setLocale } = !import.meta.env.BASE_URL.includes(
|
|
14
|
+
"cypress",
|
|
15
|
+
)
|
|
16
|
+
? configureLocalization({
|
|
17
|
+
sourceLocale,
|
|
18
|
+
targetLocales,
|
|
19
|
+
loadLocale: async (locale) => localizedTemplates.get(locale),
|
|
20
|
+
})
|
|
21
|
+
: {
|
|
22
|
+
getLocale: () => sourceLocale,
|
|
23
|
+
setLocale: () => {},
|
|
24
|
+
};
|
package/src/helpers/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ComponentObjectHandler } from "@helpers/components/componentObjectHandler";
|
|
2
2
|
import { ComponentObjectsHandler } from "@helpers/components/componentObjectsHandler";
|
|
3
3
|
import OrbitComponent from "@helpers/components/orbitComponent";
|
|
4
|
-
import dspComponent from "@helpers/components/orbitDspComponent";
|
|
5
4
|
import setupCacheInvalidation from "@helpers/components/setupCacheInvalidation";
|
|
6
5
|
import setupCacheOnResourceReady from "@helpers/components/setupCacheOnResourceReady";
|
|
7
6
|
import setupComponentSubscriptions from "@helpers/components/setupComponentSubscriptions";
|
|
@@ -21,7 +20,6 @@ import uniq from "@helpers/utils/uniq";
|
|
|
21
20
|
import CLIENT_CONTEXT from "@src/context.json";
|
|
22
21
|
|
|
23
22
|
export {
|
|
24
|
-
dspComponent,
|
|
25
23
|
CLIENT_CONTEXT,
|
|
26
24
|
filterGenerator,
|
|
27
25
|
filterObjectByDateAfter,
|