geonetwork-ui 2.2.0-dev.ca028047 → 2.2.0-dev.cbcafed5
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/esm2022/libs/api/repository/src/lib/gn4/selection/selection.service.mjs +13 -26
- package/esm2022/libs/common/domain/src/lib/model/search/aggregation.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/search/field.model.mjs +2 -0
- package/esm2022/libs/common/domain/src/lib/model/search/filter.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/search/index.mjs +2 -1
- package/esm2022/libs/common/domain/src/lib/model/search/search.model.mjs +1 -1
- package/esm2022/libs/feature/catalog/src/lib/my-org/my-org.service.mjs +4 -10
- package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +2 -2
- package/esm2022/libs/feature/search/src/index.mjs +4 -1
- package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/feature-search.module.mjs +2 -6
- package/esm2022/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/filter-geometry.token.mjs +4 -0
- package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +7 -3
- package/esm2022/libs/feature/search/src/lib/record-url.token.mjs +4 -0
- package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +2 -2
- package/esm2022/libs/feature/search/src/lib/results-table/results-table.component.mjs +128 -0
- package/esm2022/libs/feature/search/src/lib/state/effects.mjs +6 -4
- package/esm2022/libs/feature/search/src/lib/state/search.facade.mjs +3 -2
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +9 -6
- package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/index.mjs +3 -1
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.mjs +36 -0
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +37 -0
- package/esm2022/libs/ui/search/src/index.mjs +1 -2
- package/esm2022/libs/ui/search/src/lib/ui-search.module.mjs +9 -10
- package/esm2022/libs/util/i18n/src/index.mjs +1 -2
- package/esm2022/translations/de.json +4 -3
- package/esm2022/translations/en.json +5 -4
- package/esm2022/translations/es.json +4 -3
- package/esm2022/translations/fr.json +5 -4
- package/esm2022/translations/it.json +4 -3
- package/esm2022/translations/nl.json +4 -3
- package/esm2022/translations/pt.json +4 -3
- package/fesm2022/geonetwork-ui.mjs +255 -351
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/repository/src/lib/gn4/selection/selection.service.d.ts +4 -5
- package/libs/api/repository/src/lib/gn4/selection/selection.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/search/aggregation.model.d.ts +1 -1
- package/libs/common/domain/src/lib/model/search/aggregation.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/search/field.model.d.ts +2 -0
- package/libs/common/domain/src/lib/model/search/field.model.d.ts.map +1 -0
- package/libs/common/domain/src/lib/model/search/filter.model.d.ts +1 -1
- package/libs/common/domain/src/lib/model/search/filter.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/search/index.d.ts +1 -0
- package/libs/common/domain/src/lib/model/search/index.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/search/search.model.d.ts +2 -3
- package/libs/common/domain/src/lib/model/search/search.model.d.ts.map +1 -1
- package/libs/feature/catalog/src/lib/my-org/my-org.service.d.ts +0 -1
- package/libs/feature/catalog/src/lib/my-org/my-org.service.d.ts.map +1 -1
- package/libs/feature/search/src/index.d.ts +3 -0
- package/libs/feature/search/src/index.d.ts.map +1 -1
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts +3 -3
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/feature-search.module.d.ts +0 -4
- package/libs/feature/search/src/lib/feature-search.module.d.ts.map +1 -1
- package/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.d.ts +3 -2
- package/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/filter-geometry.token.d.ts +4 -0
- package/libs/feature/search/src/lib/filter-geometry.token.d.ts.map +1 -0
- package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts +1 -1
- package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/record-url.token.d.ts +3 -0
- package/libs/feature/search/src/lib/record-url.token.d.ts.map +1 -0
- package/libs/feature/search/src/lib/results-table/results-table.component.d.ts +33 -0
- package/libs/feature/search/src/lib/results-table/results-table.component.d.ts.map +1 -0
- package/libs/feature/search/src/lib/state/effects.d.ts.map +1 -1
- package/libs/feature/search/src/lib/state/search.facade.d.ts +1 -1
- package/libs/feature/search/src/lib/state/search.facade.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +3 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/index.d.ts +1 -0
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/index.d.ts +2 -0
- package/libs/ui/layout/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +14 -0
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts.map +1 -0
- package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts +15 -0
- package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts.map +1 -0
- package/libs/ui/search/src/index.d.ts +0 -1
- package/libs/ui/search/src/index.d.ts.map +1 -1
- package/libs/ui/search/src/lib/ui-search.module.d.ts +15 -15
- package/libs/ui/search/src/lib/ui-search.module.d.ts.map +1 -1
- package/libs/util/i18n/src/index.d.ts +0 -1
- package/libs/util/i18n/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/libs/api/repository/src/lib/gn4/selection/selection.service.ts +14 -38
- package/src/libs/common/domain/src/lib/model/search/aggregation.model.ts +1 -1
- package/src/libs/common/domain/src/lib/model/search/field.model.ts +1 -0
- package/src/libs/common/domain/src/lib/model/search/filter.model.ts +1 -1
- package/src/libs/common/domain/src/lib/model/search/index.ts +1 -0
- package/src/libs/common/domain/src/lib/model/search/search.model.ts +2 -2
- package/src/libs/common/domain/src/lib/model/user/index.ts +1 -0
- package/src/libs/feature/catalog/src/lib/my-org/my-org.service.ts +4 -16
- package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +1 -1
- package/src/libs/feature/search/src/index.ts +3 -0
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +1 -1
- package/src/libs/feature/search/src/lib/feature-search.module.ts +1 -10
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +4 -4
- package/src/libs/feature/search/src/lib/filter-geometry.token.ts +7 -0
- package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.ts +9 -3
- package/src/libs/feature/search/src/lib/record-url.token.ts +4 -0
- package/src/libs/feature/search/src/lib/results-list/results-list.container.component.ts +1 -1
- package/src/libs/feature/search/src/lib/results-table/results-table.component.css +0 -0
- package/src/libs/feature/search/src/lib/results-table/results-table.component.html +112 -0
- package/src/libs/feature/search/src/lib/results-table/results-table.component.ts +164 -0
- package/src/libs/feature/search/src/lib/state/effects.ts +5 -4
- package/src/libs/feature/search/src/lib/state/search.facade.ts +2 -1
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +5 -5
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +12 -4
- package/src/libs/ui/inputs/src/index.ts +1 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/checkbox/checkbox.component.html +0 -1
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +1 -1
- package/src/libs/ui/layout/src/index.ts +2 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.css +0 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.html +1 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.ts +33 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.css +15 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +54 -0
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts +42 -0
- package/src/libs/ui/search/src/index.ts +0 -1
- package/src/libs/ui/search/src/lib/ui-search.module.ts +2 -3
- package/src/libs/util/i18n/src/index.ts +0 -1
- package/translations/de.json +4 -3
- package/translations/en.json +5 -4
- package/translations/es.json +4 -3
- package/translations/fr.json +5 -4
- package/translations/it.json +4 -3
- package/translations/nl.json +4 -3
- package/translations/pt.json +4 -3
- package/translations/sk.json +4 -3
- package/esm2022/libs/ui/search/src/lib/record-table/record-table.component.mjs +0 -145
- package/esm2022/libs/util/i18n/src/lib/testing/test.translate.loader.mjs +0 -24
- package/esm2022/libs/util/i18n/src/lib/testing/test.translate.module.mjs +0 -109
- package/esm2022/libs/util/i18n/src/lib/testing/translations.model.mjs +0 -6
- package/libs/ui/search/src/lib/record-table/record-table.component.d.ts +0 -31
- package/libs/ui/search/src/lib/record-table/record-table.component.d.ts.map +0 -1
- package/libs/util/i18n/src/lib/testing/test.translate.loader.d.ts +0 -17
- package/libs/util/i18n/src/lib/testing/test.translate.loader.d.ts.map +0 -1
- package/libs/util/i18n/src/lib/testing/test.translate.module.d.ts +0 -131
- package/libs/util/i18n/src/lib/testing/test.translate.module.d.ts.map +0 -1
- package/libs/util/i18n/src/lib/testing/translations.model.d.ts +0 -21
- package/libs/util/i18n/src/lib/testing/translations.model.d.ts.map +0 -1
- package/src/libs/ui/search/src/lib/record-table/record-table.component.css +0 -7
- package/src/libs/ui/search/src/lib/record-table/record-table.component.html +0 -215
- package/src/libs/ui/search/src/lib/record-table/record-table.component.ts +0 -149
- package/src/libs/util/i18n/src/lib/testing/test.translate.loader.ts +0 -26
- package/src/libs/util/i18n/src/lib/testing/test.translate.module.ts +0 -235
- package/src/libs/util/i18n/src/lib/testing/translations.model.ts +0 -28
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { TranslateService, TranslateCompiler } from '@ngx-translate/core';
|
|
3
|
-
import { LanguageTranslations, Translations } from './translations.model';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@ngx-translate/core";
|
|
6
|
-
/**
|
|
7
|
-
* The TranslateTestingModule provides the {TranslateModule} as well as a
|
|
8
|
-
* {TranslateService} configured to return translations specific for the
|
|
9
|
-
* test environment.
|
|
10
|
-
*
|
|
11
|
-
* @export
|
|
12
|
-
*/
|
|
13
|
-
export declare class TranslateTestingModule implements ModuleWithProviders<TranslateTestingModule> {
|
|
14
|
-
private _translations;
|
|
15
|
-
private _defaultLanguage;
|
|
16
|
-
private _compiler;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new instance of the {TranslateTestingModule} with translations for the specified language.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
*
|
|
22
|
-
* const ENGLISH_TRANSLATIONS = { greeting: 'Hello' };
|
|
23
|
-
* const translateModule = TranslateTestingModule.withTranslations('en', ENGLISH_TRANSLATIONS);
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
*
|
|
27
|
-
* TranslateTestingModule.withTranslations('en', require('../../assets/i18n/en.json'));
|
|
28
|
-
*
|
|
29
|
-
* @static
|
|
30
|
-
* @param {string} language the language for the translations.
|
|
31
|
-
* @param {Translations} translations the translations to be used in the tests.
|
|
32
|
-
* @returns the new instance that can be used to chain additional configuration.
|
|
33
|
-
* @memberof TranslateTestingModule
|
|
34
|
-
*/
|
|
35
|
-
static withTranslations(language: string, translations: LanguageTranslations): TranslateTestingModule;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a new instance of the {TranslateTestingModule} with the provided translations.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
*
|
|
41
|
-
* const TRANSLATIONS = { en: { greeting: 'Hello' }, es: { greeting: 'Hola' } };
|
|
42
|
-
* const translateModule = TranslateTestingModule.withTranslations(TRANSLATIONS);
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
*
|
|
46
|
-
* TranslateTestingModule.withTranslations(require('./test.i18n.json'));
|
|
47
|
-
*
|
|
48
|
-
* @static
|
|
49
|
-
* @param {Translations} the language translations the translations to be used in the tests.
|
|
50
|
-
* @returns the new instance that can be used to chain additional configuration.
|
|
51
|
-
* @memberof TranslateTestingModule
|
|
52
|
-
*/
|
|
53
|
-
static withTranslations(translations: Translations): TranslateTestingModule;
|
|
54
|
-
get ngModule(): typeof TranslateTestingModule;
|
|
55
|
-
get providers(): {
|
|
56
|
-
provide: typeof TranslateService;
|
|
57
|
-
useValue: TranslateService;
|
|
58
|
-
}[];
|
|
59
|
-
/**
|
|
60
|
-
* Updates the {TranslateTestingModule} instance with additional translations. The
|
|
61
|
-
* translations will be shallowly merged with any existing translations.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
*
|
|
65
|
-
* const ENGLISH_TRANSLATIONS = { en: { greeting: 'Hello' } };
|
|
66
|
-
* const SPANISH_TRANSLATIONS = { en: { greeting: 'Hola' } };
|
|
67
|
-
* const translateModule = TranslateTestingModule.withTranslations(ENGLISH_TRANSLATIONS)
|
|
68
|
-
* .withTranslations(SPANISH_TRANSLATIONS);
|
|
69
|
-
*
|
|
70
|
-
* @param {Translations} translations the additional translations to add to the testing service.
|
|
71
|
-
* @returns the instance that can be used to chain additional configuration.
|
|
72
|
-
* @memberof TranslateTestingModule
|
|
73
|
-
*/
|
|
74
|
-
withTranslations(translations: Translations): TranslateTestingModule;
|
|
75
|
-
/**
|
|
76
|
-
* Updates the {TranslateTestingModule} instance with additional translations for a
|
|
77
|
-
* specified language. The translations will be shallowly merged with any existing translations.
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
*
|
|
81
|
-
* const ENGLISH_TRANSLATIONS = { greeting: 'Hello' };
|
|
82
|
-
* const SPANISH_TRANSLATIONS = { greeting: 'Hola' };
|
|
83
|
-
* const translateModule = TranslateTestingModule.withTranslations('en', ENGLISH_TRANSLATIONS)
|
|
84
|
-
* .withTranslations('es', SPANISH_TRANSLATIONS);
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
*
|
|
88
|
-
* TranslateTestingModule.withTranslations('en', require('../../assets/i18n/en.json'))
|
|
89
|
-
* .withTranslations('es', require('../../assets/i18n/es.json'));
|
|
90
|
-
*
|
|
91
|
-
* @param {string} language the language for which the new translations are being added.
|
|
92
|
-
* @param {LanguageTranslations} translations the translations for the specified language.
|
|
93
|
-
* @returns the instance that can be used to chain additional configuration.
|
|
94
|
-
* @memberof TranslateTestingModule
|
|
95
|
-
*/
|
|
96
|
-
withTranslations(language: string, translations: LanguageTranslations): TranslateTestingModule;
|
|
97
|
-
/**
|
|
98
|
-
* Updates the {TranslationTestingModule} to provide a {TranslateService} that will
|
|
99
|
-
* use the provided {TranslateCompiler} to translate the test translations.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
*
|
|
103
|
-
* TranslateTestingModule.withTranslations('en', {people: '{gender, select, male{He is} female{She is} other{They are}} {how})'})
|
|
104
|
-
* .withCompiler(new TranslateMessageFormatCompiler());
|
|
105
|
-
*
|
|
106
|
-
* @param compiler the compiler to use to compile the test translations.
|
|
107
|
-
* @returns the instance that can be used to chain additional configuration.
|
|
108
|
-
* @memberof TranslateTestingModule
|
|
109
|
-
*/
|
|
110
|
-
withCompiler(compiler: TranslateCompiler): TranslateTestingModule;
|
|
111
|
-
/**
|
|
112
|
-
* Updates the {TranslateTestingModule} to use the provided language as the default language.
|
|
113
|
-
* By default, the default language will be set to the first language provided.
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
*
|
|
117
|
-
* TranslateTestingModule.withTranslations('es', SPANISH_TRANSLATIONS)
|
|
118
|
-
* .withTranslations('en', ENGLISH_TRANSLATIONS)
|
|
119
|
-
* .withDefaultLanguage('en');
|
|
120
|
-
*
|
|
121
|
-
* @param language the new default language for translations.
|
|
122
|
-
* @returns the instance that can be used to chain additional configuration.
|
|
123
|
-
* @memberof TranslateTestingModule
|
|
124
|
-
*/
|
|
125
|
-
withDefaultLanguage(language: string): TranslateTestingModule;
|
|
126
|
-
private addTranslations;
|
|
127
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateTestingModule, never>;
|
|
128
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TranslateTestingModule, never, [typeof i1.TranslateModule], [typeof i1.TranslateModule]>;
|
|
129
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<TranslateTestingModule>;
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=test.translate.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.translate.module.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/i18n/src/lib/testing/test.translate.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,eAAe,CAAA;AAC7D,OAAO,EAKL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;;;AAOzE;;;;;;GAMG;AACH,qBAIa,sBACX,YAAW,mBAAmB,CAAC,sBAAsB,CAAC;IAEtD,OAAO,CAAC,aAAa,CAAmB;IAExC,OAAO,CAAC,gBAAgB,CAAQ;IAEhC,OAAO,CAAC,SAAS,CAAmB;IAEpC;;;;;;;;;;;;;;;;;OAiBG;WACW,gBAAgB,CAC5B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,oBAAoB,GACjC,sBAAsB;IAEzB;;;;;;;;;;;;;;;;OAgBG;WACW,gBAAgB,CAC5B,YAAY,EAAE,YAAY,GACzB,sBAAsB;IAkBzB,IAAW,QAAQ,kCAElB;IAED,IAAW,SAAS;;;QAmBnB;IAED;;;;;;;;;;;;;;OAcG;IACI,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,sBAAsB;IAE3E;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,gBAAgB,CACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,oBAAoB,GACjC,sBAAsB;IAiBzB;;;;;;;;;;;;OAYG;IACI,YAAY,CAAC,QAAQ,EAAE,iBAAiB,GAAG,sBAAsB;IAKxE;;;;;;;;;;;;;OAaG;IACI,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB;IAKpE,OAAO,CAAC,eAAe;yCA7LZ,sBAAsB;0CAAtB,sBAAsB;0CAAtB,sBAAsB;CA8MlC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare type LanguageTranslation = string | string[] | {
|
|
2
|
-
[translationKey: string]: LanguageTranslation;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* LanguageTranslations represents a mapping between a translation key and the translation for that key
|
|
6
|
-
* or to nested translation keys.
|
|
7
|
-
*
|
|
8
|
-
* @export
|
|
9
|
-
*/
|
|
10
|
-
export interface LanguageTranslations {
|
|
11
|
-
[translationKey: string]: LanguageTranslation;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Translations represents a mapping between a language and the translations for that language.
|
|
15
|
-
*
|
|
16
|
-
* @export
|
|
17
|
-
*/
|
|
18
|
-
export interface Translations {
|
|
19
|
-
[language: string]: LanguageTranslations;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=translations.model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translations.model.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/util/i18n/src/lib/testing/translations.model.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,MAAM,mBAAmB,GACnC,MAAM,GACN,MAAM,EAAE,GACR;IAAE,CAAC,cAAc,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAA;AAErD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,cAAc,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAC9C;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAAA;CACzC"}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
<div *ngIf="totalHits" class="">
|
|
3
|
-
<div class="flex records-information">
|
|
4
|
-
<div
|
|
5
|
-
translate
|
|
6
|
-
class="my-8 ml-4 block text-gray-800"
|
|
7
|
-
[translateParams]="{
|
|
8
|
-
displayed: records.length,
|
|
9
|
-
hits: totalHits
|
|
10
|
-
}"
|
|
11
|
-
>
|
|
12
|
-
results.records.hits.displayedOn
|
|
13
|
-
</div>
|
|
14
|
-
<div
|
|
15
|
-
*ngIf="selectedRecords.length > 0"
|
|
16
|
-
class="my-8 ml-6 block text-gray-400 selected-records"
|
|
17
|
-
translate
|
|
18
|
-
[translateParams]="{ amount: selectedRecords.length }"
|
|
19
|
-
>
|
|
20
|
-
results.records.hits.selected
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<div
|
|
25
|
-
class="grid grid-cols-[repeat(3,minmax(0,max-content))] gap-x-4 gap-y-1"
|
|
26
|
-
*ngIf="records[0].name"
|
|
27
|
-
>
|
|
28
|
-
<div class="contents text-sm">
|
|
29
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
30
|
-
<span translate>dashboard.records.userDetail</span>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
33
|
-
<span translate>dashboard.records.username</span>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
36
|
-
<span translate>dashboard.records.userEmail</span>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
<div
|
|
40
|
-
class="contents hover:text-gray-900 text-gray-800 cursor-pointer"
|
|
41
|
-
(click)="recordsSelect.emit([record])"
|
|
42
|
-
*ngFor="let record of records"
|
|
43
|
-
>
|
|
44
|
-
<div class="record-table-col text-16">
|
|
45
|
-
{{ record.name }}
|
|
46
|
-
</div>
|
|
47
|
-
<div class="record-table-col text-16">
|
|
48
|
-
{{ record.username }}
|
|
49
|
-
</div>
|
|
50
|
-
<div class="record-table-col text-16">
|
|
51
|
-
{{ record.emailAddresses[0] }}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div
|
|
57
|
-
class="grid grid-cols-[repeat(6,minmax(0,max-content))] gap-x-4 gap-y-1"
|
|
58
|
-
*ngIf="!records[0].name"
|
|
59
|
-
>
|
|
60
|
-
<div class="contents text-sm">
|
|
61
|
-
<div class="flex justify-center items-center">
|
|
62
|
-
<gn-ui-checkbox
|
|
63
|
-
[checked]="isAllSelected()"
|
|
64
|
-
[indeterminate]="isSomeSelected()"
|
|
65
|
-
(changed)="selectAll()"
|
|
66
|
-
type="default"
|
|
67
|
-
>
|
|
68
|
-
</gn-ui-checkbox>
|
|
69
|
-
</div>
|
|
70
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
71
|
-
<gn-ui-button
|
|
72
|
-
type="light"
|
|
73
|
-
extraClass="px-3 pl-0 space-x-1 text-left"
|
|
74
|
-
(buttonClick)="setSortBy('resourceTitleObject.default.keyword')"
|
|
75
|
-
>
|
|
76
|
-
<span translate>record.metadata.title</span>
|
|
77
|
-
<mat-icon
|
|
78
|
-
class="material-symbols-outlined"
|
|
79
|
-
*ngIf="isSortedBy('resourceTitleObject.default.keyword', 'desc')"
|
|
80
|
-
>
|
|
81
|
-
expand_more</mat-icon
|
|
82
|
-
>
|
|
83
|
-
<mat-icon
|
|
84
|
-
class="material-symbols-outlined"
|
|
85
|
-
*ngIf="isSortedBy('resourceTitleObject.default.keyword', 'asc')"
|
|
86
|
-
>
|
|
87
|
-
expand_less</mat-icon
|
|
88
|
-
>
|
|
89
|
-
</gn-ui-button>
|
|
90
|
-
</div>
|
|
91
|
-
<div translate="" class="record-table-header text-gray-400 flex gap-1">
|
|
92
|
-
record.metadata.formats
|
|
93
|
-
</div>
|
|
94
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
95
|
-
<gn-ui-button
|
|
96
|
-
type="light"
|
|
97
|
-
extraClass="px-3 pl-0 space-x-1"
|
|
98
|
-
(buttonClick)="setSortBy('recordOwner')"
|
|
99
|
-
>
|
|
100
|
-
<span translate>record.metadata.author</span>
|
|
101
|
-
<mat-icon
|
|
102
|
-
class="material-symbols-outlined"
|
|
103
|
-
*ngIf="isSortedBy('recordOwner', 'desc')"
|
|
104
|
-
>
|
|
105
|
-
expand_more</mat-icon
|
|
106
|
-
>
|
|
107
|
-
<mat-icon
|
|
108
|
-
class="material-symbols-outlined"
|
|
109
|
-
*ngIf="isSortedBy('recordOwner', 'asc')"
|
|
110
|
-
>
|
|
111
|
-
expand_less</mat-icon
|
|
112
|
-
>
|
|
113
|
-
</gn-ui-button>
|
|
114
|
-
</div>
|
|
115
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
116
|
-
<gn-ui-button
|
|
117
|
-
type="light"
|
|
118
|
-
extraClass="px-3 pl-0 space-x-1"
|
|
119
|
-
(buttonClick)="setSortBy('changeDate')"
|
|
120
|
-
>
|
|
121
|
-
<span translate>record.metadata.updatedOn</span>
|
|
122
|
-
<mat-icon
|
|
123
|
-
class="material-symbols-outlined"
|
|
124
|
-
*ngIf="isSortedBy('changeDate', 'desc')"
|
|
125
|
-
>
|
|
126
|
-
expand_more</mat-icon
|
|
127
|
-
>
|
|
128
|
-
<mat-icon
|
|
129
|
-
class="material-symbols-outlined"
|
|
130
|
-
*ngIf="isSortedBy('changeDate', 'asc')"
|
|
131
|
-
>
|
|
132
|
-
expand_less</mat-icon
|
|
133
|
-
>
|
|
134
|
-
</gn-ui-button>
|
|
135
|
-
</div>
|
|
136
|
-
<div class="record-table-header text-gray-400 flex gap-1">
|
|
137
|
-
<gn-ui-button
|
|
138
|
-
type="light"
|
|
139
|
-
extraClass="px-3 pl-0 space-x-1"
|
|
140
|
-
(buttonClick)="setSortBy('createDate')"
|
|
141
|
-
>
|
|
142
|
-
<span translate>record.metadata.createdOn</span>
|
|
143
|
-
<mat-icon
|
|
144
|
-
class="material-symbols-outlined"
|
|
145
|
-
*ngIf="isSortedBy('createDate', 'desc')"
|
|
146
|
-
>
|
|
147
|
-
expand_more</mat-icon
|
|
148
|
-
>
|
|
149
|
-
<mat-icon
|
|
150
|
-
class="material-symbols-outlined"
|
|
151
|
-
*ngIf="isSortedBy('createDate', 'asc')"
|
|
152
|
-
>
|
|
153
|
-
expand_less</mat-icon
|
|
154
|
-
>
|
|
155
|
-
</gn-ui-button>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
<div
|
|
159
|
-
class="contents hover:text-gray-900 text-gray-800 cursor-pointer"
|
|
160
|
-
(click)="recordsSelect.emit([record])"
|
|
161
|
-
*ngFor="let record of records"
|
|
162
|
-
>
|
|
163
|
-
<div class="record-table-col">
|
|
164
|
-
<gn-ui-checkbox
|
|
165
|
-
[checked]="isChecked(record)"
|
|
166
|
-
(changed)="handleRecordSelectedChange($event, record)"
|
|
167
|
-
type="default"
|
|
168
|
-
></gn-ui-checkbox>
|
|
169
|
-
</div>
|
|
170
|
-
<div
|
|
171
|
-
[title]="record.title"
|
|
172
|
-
class="record-table-col text-16 self-center"
|
|
173
|
-
>
|
|
174
|
-
{{ record.title }}
|
|
175
|
-
</div>
|
|
176
|
-
<div
|
|
177
|
-
class="record-table-col flex justify-start items-center gap-2 text-16"
|
|
178
|
-
[title]="formats.join(', ')"
|
|
179
|
-
*ngIf="getRecordFormats(record) as formats"
|
|
180
|
-
>
|
|
181
|
-
<span
|
|
182
|
-
class="badge-btn min-w-[45px] text-sm text-white px-2 flex-shrink-0"
|
|
183
|
-
[style.background-color]="getBadgeColor(formats[0])"
|
|
184
|
-
*ngIf="formats[0]"
|
|
185
|
-
>
|
|
186
|
-
{{ formats[0] }}
|
|
187
|
-
</span>
|
|
188
|
-
<span
|
|
189
|
-
class="badge-btn min-w-[45px] text-sm text-white px-2 flex-shrink-0"
|
|
190
|
-
[style.background-color]="getBadgeColor(formats[1])"
|
|
191
|
-
*ngIf="formats[1]"
|
|
192
|
-
>
|
|
193
|
-
{{ formats[1] }}
|
|
194
|
-
</span>
|
|
195
|
-
<div
|
|
196
|
-
class="flex-shrink-0"
|
|
197
|
-
*ngIf="!record.name && formats.slice(2).length > 0"
|
|
198
|
-
>
|
|
199
|
-
<span>+{{ formats.slice(2).length }}</span>
|
|
200
|
-
</div>
|
|
201
|
-
</div>
|
|
202
|
-
<div class="record-table-col flex items-center gap-2 text-16">
|
|
203
|
-
<mat-icon class="material-symbols-outlined"> person </mat-icon>
|
|
204
|
-
<span class="">{{ formatUserInfo(record.extras?.ownerInfo) }}</span>
|
|
205
|
-
</div>
|
|
206
|
-
<div class="record-table-col text-16 self-center">
|
|
207
|
-
{{ dateToString(record.recordUpdated) }}
|
|
208
|
-
</div>
|
|
209
|
-
<div class="record-table-col text-16 self-center">
|
|
210
|
-
{{ dateToString(record.recordCreated) }}
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core'
|
|
2
|
-
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
|
-
import {
|
|
4
|
-
FileFormat,
|
|
5
|
-
getBadgeColor,
|
|
6
|
-
getFileFormat,
|
|
7
|
-
getFormatPriority,
|
|
8
|
-
} from '../../../../../../libs/util/shared/src'
|
|
9
|
-
import { SortByField } from '../../../../../../libs/common/domain/src/lib/model/search'
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'gn-ui-record-table',
|
|
13
|
-
templateUrl: './record-table.component.html',
|
|
14
|
-
styleUrls: ['./record-table.component.css'],
|
|
15
|
-
})
|
|
16
|
-
export class RecordTableComponent {
|
|
17
|
-
@Input() selectedRecords: string[] = []
|
|
18
|
-
@Input() records: any[] = []
|
|
19
|
-
@Input() totalHits?: number
|
|
20
|
-
@Input() sortBy?: SortByField
|
|
21
|
-
@Output() recordClick = new EventEmitter<CatalogRecord>()
|
|
22
|
-
@Output() recordsSelect = new EventEmitter<CatalogRecord[]>()
|
|
23
|
-
@Output() recordsDeselect = new EventEmitter<CatalogRecord[]>()
|
|
24
|
-
@Output() sortByChange = new EventEmitter<SortByField>()
|
|
25
|
-
|
|
26
|
-
dateToString(date: Date): string {
|
|
27
|
-
return date?.toLocaleDateString(undefined, {
|
|
28
|
-
year: 'numeric',
|
|
29
|
-
month: 'long',
|
|
30
|
-
day: 'numeric',
|
|
31
|
-
timeZone: 'UTC',
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getStatus(isPublishedToAll: boolean | unknown) {
|
|
36
|
-
return isPublishedToAll ? 'published' : 'not published'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
formatUserInfo(userInfo: string | unknown): string {
|
|
40
|
-
const infos = (typeof userInfo === 'string' ? userInfo : '').split('|')
|
|
41
|
-
if (infos && infos.length === 4) {
|
|
42
|
-
return `${infos[2]} ${infos[1]}`
|
|
43
|
-
}
|
|
44
|
-
return undefined
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
getRecordFormats(record: CatalogRecord): FileFormat[] {
|
|
48
|
-
if (record.kind === 'service' || !('distributions' in record)) {
|
|
49
|
-
return []
|
|
50
|
-
}
|
|
51
|
-
const formats = Array.from(
|
|
52
|
-
new Set(
|
|
53
|
-
record.distributions.map((distribution) => getFileFormat(distribution))
|
|
54
|
-
)
|
|
55
|
-
).filter((format) => !!format)
|
|
56
|
-
formats.sort((a, b) => getFormatPriority(b) - getFormatPriority(a))
|
|
57
|
-
return formats
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
getBadgeColor(format: FileFormat): string {
|
|
61
|
-
return getBadgeColor(format)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private getOrderForColumn(col: string): 'asc' | 'desc' | null {
|
|
65
|
-
if (!this.sortBy) {
|
|
66
|
-
return null
|
|
67
|
-
}
|
|
68
|
-
let order: 'asc' | 'desc' | null = null
|
|
69
|
-
const sortedArray = Array.isArray(this.sortBy[0])
|
|
70
|
-
? this.sortBy
|
|
71
|
-
: [this.sortBy]
|
|
72
|
-
sortedArray.forEach((sortedCol) => {
|
|
73
|
-
if (sortedCol[1] === col) {
|
|
74
|
-
order = sortedCol[0]
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
return order
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
setSortBy(col: string): void {
|
|
81
|
-
const sortOrder = this.getOrderForColumn(col)
|
|
82
|
-
let newOrder
|
|
83
|
-
if (sortOrder) {
|
|
84
|
-
newOrder = sortOrder === 'asc' ? 'desc' : 'asc'
|
|
85
|
-
} else {
|
|
86
|
-
newOrder = 'asc'
|
|
87
|
-
}
|
|
88
|
-
this.sortByChange.emit([newOrder, col])
|
|
89
|
-
this.sortBy = [newOrder, col]
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
isSortedBy(col: string, order: 'asc' | 'desc'): boolean {
|
|
93
|
-
const sortOrder = this.getOrderForColumn(col)
|
|
94
|
-
return sortOrder === order
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
isChecked(record: CatalogRecord) {
|
|
98
|
-
if (this.selectedRecords.includes(record.uniqueIdentifier)) {
|
|
99
|
-
return true
|
|
100
|
-
}
|
|
101
|
-
return false
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
handleRecordSelectedChange(selected: boolean, record: CatalogRecord) {
|
|
105
|
-
if (!selected) {
|
|
106
|
-
this.recordsDeselect.emit([record])
|
|
107
|
-
this.selectedRecords = this.selectedRecords.filter(
|
|
108
|
-
(val) => val !== record.uniqueIdentifier
|
|
109
|
-
)
|
|
110
|
-
} else {
|
|
111
|
-
this.recordsSelect.emit([record])
|
|
112
|
-
this.selectedRecords.push(record.uniqueIdentifier)
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
selectAll() {
|
|
117
|
-
if (this.isAllSelected()) {
|
|
118
|
-
this.recordsDeselect.emit(this.records)
|
|
119
|
-
this.selectedRecords = []
|
|
120
|
-
} else {
|
|
121
|
-
this.recordsSelect.emit(this.records)
|
|
122
|
-
this.selectedRecords = this.records.map((record) => {
|
|
123
|
-
return record.uniqueIdentifier
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
isAllSelected(): boolean {
|
|
129
|
-
if (this.selectedRecords.length === this.records.length) {
|
|
130
|
-
const allRecords = this.records.filter((record) =>
|
|
131
|
-
this.selectedRecords.includes(record.uniqueIdentifier)
|
|
132
|
-
)
|
|
133
|
-
if (allRecords.length === this.records.length) {
|
|
134
|
-
return true
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return false
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
isSomeSelected(): boolean {
|
|
141
|
-
if (
|
|
142
|
-
this.selectedRecords.length > 0 &&
|
|
143
|
-
this.selectedRecords.length < this.records.length
|
|
144
|
-
) {
|
|
145
|
-
return true
|
|
146
|
-
}
|
|
147
|
-
return false
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { TranslateLoader } from '@ngx-translate/core'
|
|
2
|
-
import { Observable, of as observableOf } from 'rxjs'
|
|
3
|
-
import { Translations, LanguageTranslations } from './translations.model'
|
|
4
|
-
|
|
5
|
-
// IMPORTANT:
|
|
6
|
-
// This was copy-pasted from https://github.com/mwootendev/ngx-translate-plugins/blob/7c6c73c7d16c9519a7bafff939d29fd8ea5e574a/projects/testing/src/lib/test-translate-loader.service.ts
|
|
7
|
-
// because the original package was expecting rxjs 7+ as a peer dep and that was conflicting with many other dependencies
|
|
8
|
-
// FIXME: when rxjs 7 can be used in the project, remove this and do `npm install ngx-translate-testing --save-dev`
|
|
9
|
-
|
|
10
|
-
export class TestTranslateLoader extends TranslateLoader {
|
|
11
|
-
constructor(private _translations: Translations = {}) {
|
|
12
|
-
super()
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns an {Observable} of translations for the specified language. If the
|
|
17
|
-
* language is not recognized, an empty translations object will be returned.
|
|
18
|
-
*
|
|
19
|
-
* @param language the language for which the translations should be retrieved.
|
|
20
|
-
* @returns the translations for the specified
|
|
21
|
-
* language or an empty set of translations if the language is not recognized.
|
|
22
|
-
*/
|
|
23
|
-
public getTranslation(language: string): Observable<LanguageTranslations> {
|
|
24
|
-
return observableOf(this._translations[language] || {})
|
|
25
|
-
}
|
|
26
|
-
}
|