geonetwork-ui 2.2.0-dev.e3947702 → 2.2.0-dev.ecc0ab67
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/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +42 -51
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.mjs +4 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/converter.mjs +16 -11
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +23 -16
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +21 -18
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +10 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +14 -5
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +33 -8
- package/esm2022/libs/api/repository/src/lib/gn4/selection/selection.service.mjs +13 -26
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- 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/common/domain/src/lib/model/thesaurus/thesaurus.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.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/feature/search/src/lib/utils/service/fields.mjs +41 -26
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +11 -9
- package/esm2022/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +35 -22
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +2 -3
- 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/inputs/src/lib/editable-label/editable-label.directive.mjs +3 -2
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +5 -5
- 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 +6 -4
- package/esm2022/translations/en.json +9 -7
- package/esm2022/translations/es.json +6 -4
- package/esm2022/translations/fr.json +9 -7
- package/esm2022/translations/it.json +8 -6
- package/esm2022/translations/nl.json +6 -4
- package/esm2022/translations/pt.json +6 -4
- package/fesm2022/geonetwork-ui.mjs +511 -525
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +0 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +5 -4
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +3 -2
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -2
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.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/record/metadata.model.d.ts +5 -10
- package/libs/common/domain/src/lib/model/record/metadata.model.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/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts +1 -0
- package/libs/common/domain/src/lib/model/thesaurus/thesaurus.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.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/feature/search/src/lib/utils/service/fields.d.ts +21 -8
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +7 -3
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.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/inputs/src/lib/editable-label/editable-label.directive.d.ts +1 -1
- package/libs/ui/inputs/src/lib/editable-label/editable-label.directive.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +18 -18
- 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/metadata-converter/src/lib/fixtures/generic.records.ts +6 -6
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +5 -3
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +22 -4
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +69 -65
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.metadata.mapper.ts +3 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/converter.ts +19 -12
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +62 -43
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +91 -59
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +22 -2
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +15 -4
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -8
- package/src/libs/api/repository/src/lib/gn4/selection/selection.service.ts +14 -38
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +5 -11
- 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/thesaurus/thesaurus.model.ts +1 -0
- package/src/libs/common/domain/src/lib/model/user/index.ts +1 -0
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -4
- package/src/libs/common/fixtures/src/lib/gn4/groups.fixtures.ts +1 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +6 -2
- 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/feature/search/src/lib/utils/service/fields.service.ts +21 -16
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +43 -34
- package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html +3 -2
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -2
- package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +1 -1
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +45 -18
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +31 -12
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +1 -2
- 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/inputs/src/lib/editable-label/editable-label.directive.ts +1 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +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 +6 -4
- package/translations/en.json +9 -7
- package/translations/es.json +6 -4
- package/translations/fr.json +9 -7
- package/translations/it.json +8 -6
- package/translations/nl.json +6 -4
- package/translations/pt.json +6 -4
- package/translations/sk.json +6 -4
- 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
package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts
CHANGED
|
@@ -25,7 +25,14 @@ import {
|
|
|
25
25
|
SourceWithUnknownProps,
|
|
26
26
|
} from '../../../../../../../libs/api/metadata-converter/src'
|
|
27
27
|
import { combineLatest, Observable, of, switchMap, takeLast } from 'rxjs'
|
|
28
|
-
import {
|
|
28
|
+
import {
|
|
29
|
+
filter,
|
|
30
|
+
map,
|
|
31
|
+
shareReplay,
|
|
32
|
+
startWith,
|
|
33
|
+
tap,
|
|
34
|
+
withLatestFrom,
|
|
35
|
+
} from 'rxjs/operators'
|
|
29
36
|
import { LangService } from '../../../../../../../libs/util/i18n/src'
|
|
30
37
|
import { PlatformServiceInterface } from '../../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
31
38
|
import { coerce, satisfies, valid } from 'semver'
|
|
@@ -296,15 +303,28 @@ export class OrganizationsFromMetadataService
|
|
|
296
303
|
|
|
297
304
|
const ownerOrganization = allContactOrgs[0]
|
|
298
305
|
|
|
306
|
+
// read the owner group as well to have a fallback logo
|
|
307
|
+
const groupId = selectField(source, 'groupOwner')
|
|
308
|
+
const group$ = this.groups$.pipe(
|
|
309
|
+
map((groups) =>
|
|
310
|
+
groups.find((group) => {
|
|
311
|
+
return group.id === Number(groupId)
|
|
312
|
+
})
|
|
313
|
+
)
|
|
314
|
+
)
|
|
315
|
+
|
|
299
316
|
return this.organisations$.pipe(
|
|
300
317
|
takeLast(1),
|
|
301
|
-
|
|
318
|
+
withLatestFrom(group$),
|
|
319
|
+
map(([organisations, group]: [Organization[], GroupApiModel]) => {
|
|
302
320
|
const recordOrganisation = organisations.filter(
|
|
303
321
|
(org) => org.name === ownerOrganization.name
|
|
304
322
|
)[0]
|
|
323
|
+
const logoUrl = group?.logo && getAsUrl(`${IMAGE_URL}${group.logo}`)
|
|
305
324
|
return {
|
|
306
325
|
...record,
|
|
307
326
|
ownerOrganization: {
|
|
327
|
+
logoUrl,
|
|
308
328
|
...ownerOrganization,
|
|
309
329
|
...recordOrganisation,
|
|
310
330
|
},
|
|
@@ -45,12 +45,23 @@ export class Gn4PlatformMapper {
|
|
|
45
45
|
return { ...apiUser, id: id.toString() } as UserModel
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
thesaurusFromApi(thesaurus: any[]): ThesaurusModel {
|
|
48
|
+
thesaurusFromApi(thesaurus: any[], lang3?: string): ThesaurusModel {
|
|
49
49
|
return thesaurus.map((keyword) => {
|
|
50
|
-
|
|
50
|
+
let key = keyword.uri
|
|
51
|
+
// sometines GN can prefix an URI with an "all thesaurus" URI; only keep the last one
|
|
52
|
+
if (key.indexOf('@@@') > -1) {
|
|
53
|
+
key = key.split('@@@')[1]
|
|
54
|
+
}
|
|
55
|
+
const label =
|
|
56
|
+
lang3 && lang3 in keyword.values ? keyword.values[lang3] : keyword.value
|
|
57
|
+
const description =
|
|
58
|
+
lang3 && lang3 in keyword.definitions
|
|
59
|
+
? keyword.definitions[lang3]
|
|
60
|
+
: keyword.definition
|
|
51
61
|
return {
|
|
52
|
-
key
|
|
53
|
-
label
|
|
62
|
+
key,
|
|
63
|
+
label,
|
|
64
|
+
description,
|
|
54
65
|
}
|
|
55
66
|
})
|
|
56
67
|
}
|
|
@@ -14,8 +14,10 @@ import { Organization } from '../../../../../../../libs/common/domain/src/lib/mo
|
|
|
14
14
|
import { Gn4PlatformMapper } from './gn4-platform.mapper'
|
|
15
15
|
import { ltr } from 'semver'
|
|
16
16
|
import { ThesaurusModel } from '../../../../../../../libs/common/domain/src/lib/model/thesaurus/thesaurus.model'
|
|
17
|
+
import { LangService } from '../../../../../../../libs/util/i18n/src'
|
|
17
18
|
|
|
18
19
|
const minApiVersion = '4.2.2'
|
|
20
|
+
|
|
19
21
|
@Injectable()
|
|
20
22
|
export class Gn4PlatformService implements PlatformServiceInterface {
|
|
21
23
|
private readonly type = 'GeoNetwork'
|
|
@@ -50,13 +52,20 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
50
52
|
shareReplay(1)
|
|
51
53
|
)
|
|
52
54
|
|
|
55
|
+
/**
|
|
56
|
+
* A map of already loaded thesauri (groups of keywords); the key is a URI
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private thesauri: Record<string, Observable<ThesaurusModel>> = {}
|
|
60
|
+
|
|
53
61
|
constructor(
|
|
54
62
|
private siteApiService: SiteApiService,
|
|
55
63
|
private meApi: MeApiService,
|
|
56
64
|
private usersApi: UsersApiService,
|
|
57
65
|
private mapper: Gn4PlatformMapper,
|
|
58
66
|
private toolsApiService: ToolsApiService,
|
|
59
|
-
private registriesApiService: RegistriesApiService
|
|
67
|
+
private registriesApiService: RegistriesApiService,
|
|
68
|
+
private langService: LangService
|
|
60
69
|
) {
|
|
61
70
|
this.me$ = this.meApi.getMe().pipe(
|
|
62
71
|
switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
|
|
@@ -98,17 +107,47 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
translateKey(key: string): Observable<string> {
|
|
110
|
+
// if the key is a URI, use the registries API to look for the translation
|
|
111
|
+
if (key.match(/^https?:\/\//)) {
|
|
112
|
+
// the thesaurus URI is inferred by removing a part of the keyword URI
|
|
113
|
+
// this is not exact science but it's OK, we'll still end up loading a bunch of keywords at once anyway
|
|
114
|
+
const thesaurusUri = key.replace(/\/([^/]+)$/, '/')
|
|
115
|
+
return this.getThesaurusByUri(thesaurusUri).pipe(
|
|
116
|
+
map((thesaurus) => {
|
|
117
|
+
for (const item of thesaurus) {
|
|
118
|
+
if (item.key === key) return item.label
|
|
119
|
+
}
|
|
120
|
+
return key
|
|
121
|
+
})
|
|
122
|
+
)
|
|
123
|
+
}
|
|
101
124
|
return this.keyTranslations$.pipe(map((translations) => translations[key]))
|
|
102
125
|
}
|
|
103
126
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.searchKeywords(
|
|
127
|
+
getThesaurusByUri(uri: string): Observable<ThesaurusModel> {
|
|
128
|
+
if (this.thesauri[uri]) {
|
|
129
|
+
return this.thesauri[uri]
|
|
130
|
+
}
|
|
131
|
+
this.thesauri[uri] = this.registriesApiService
|
|
132
|
+
.searchKeywords(
|
|
133
|
+
null,
|
|
134
|
+
this.langService.iso3,
|
|
135
|
+
1000,
|
|
136
|
+
0,
|
|
137
|
+
null,
|
|
138
|
+
null,
|
|
139
|
+
null,
|
|
140
|
+
`${uri}*`
|
|
141
|
+
)
|
|
110
142
|
.pipe(
|
|
111
|
-
map((thesaurus) =>
|
|
143
|
+
map((thesaurus) =>
|
|
144
|
+
this.mapper.thesaurusFromApi(
|
|
145
|
+
thesaurus as any[],
|
|
146
|
+
this.langService.iso3
|
|
147
|
+
)
|
|
148
|
+
),
|
|
149
|
+
shareReplay(1)
|
|
112
150
|
)
|
|
151
|
+
return this.thesauri[uri]
|
|
113
152
|
}
|
|
114
153
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { CatalogRecord } from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
3
|
import { SelectionsApiService } from '../../../../../../../libs/data-access/gn4/src'
|
|
4
|
-
import { BehaviorSubject,
|
|
4
|
+
import { BehaviorSubject, firstValueFrom } from 'rxjs'
|
|
5
5
|
|
|
6
6
|
const BUCKET_ID = 'gnui'
|
|
7
7
|
|
|
@@ -12,7 +12,6 @@ export class SelectionService {
|
|
|
12
12
|
selectedRecordsIdentifiers$: BehaviorSubject<string[]> = new BehaviorSubject(
|
|
13
13
|
[]
|
|
14
14
|
)
|
|
15
|
-
subscription: Subscription
|
|
16
15
|
|
|
17
16
|
constructor(private selectionsApi: SelectionsApiService) {
|
|
18
17
|
this.selectionsApi.get(BUCKET_ID).subscribe((selectedIds) => {
|
|
@@ -33,48 +32,25 @@ export class SelectionService {
|
|
|
33
32
|
this.selectedRecordsIdentifiers$.next(filtered)
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
selectRecords(records: CatalogRecord[])
|
|
37
|
-
const newIds =
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
selectRecords(records: CatalogRecord[]) {
|
|
36
|
+
const newIds = records.map((record) => record.uniqueIdentifier)
|
|
37
|
+
this.selectionsApi.add(BUCKET_ID, newIds).subscribe(() => {
|
|
38
|
+
this.addIdsToSelected(newIds)
|
|
40
39
|
})
|
|
41
|
-
const apiResponse = this.selectionsApi.add(BUCKET_ID, newIds)
|
|
42
|
-
return apiResponse.pipe(
|
|
43
|
-
tap(() => {
|
|
44
|
-
this.addIdsToSelected(newIds)
|
|
45
|
-
}),
|
|
46
|
-
map(() => undefined)
|
|
47
|
-
)
|
|
48
40
|
}
|
|
49
41
|
|
|
50
|
-
deselectRecords(records: CatalogRecord[])
|
|
51
|
-
const idsToBeRemoved =
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
deselectRecords(records: CatalogRecord[]) {
|
|
43
|
+
const idsToBeRemoved = records.map((record) => record.uniqueIdentifier)
|
|
44
|
+
this.selectionsApi.clear(BUCKET_ID, idsToBeRemoved).subscribe(() => {
|
|
45
|
+
this.removeIdsFromSelected(idsToBeRemoved)
|
|
54
46
|
})
|
|
55
|
-
const apiResponse = this.selectionsApi.clear(BUCKET_ID, idsToBeRemoved)
|
|
56
|
-
return apiResponse.pipe(
|
|
57
|
-
tap(() => {
|
|
58
|
-
this.removeIdsFromSelected(idsToBeRemoved)
|
|
59
|
-
}),
|
|
60
|
-
map(() => undefined)
|
|
61
|
-
)
|
|
62
47
|
}
|
|
63
48
|
|
|
64
|
-
clearSelection()
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
currentSelection
|
|
49
|
+
async clearSelection() {
|
|
50
|
+
const response = await firstValueFrom(this.selectionsApi.get(BUCKET_ID))
|
|
51
|
+
const currentSelection = Array.from(response)
|
|
52
|
+
this.selectionsApi.clear(BUCKET_ID, currentSelection).subscribe(() => {
|
|
53
|
+
this.removeIdsFromSelected(currentSelection)
|
|
69
54
|
})
|
|
70
|
-
this.selectionsApi.clear(BUCKET_ID, currentSelection)
|
|
71
|
-
const apiResponse = this.selectionsApi.clear(BUCKET_ID, currentSelection)
|
|
72
|
-
|
|
73
|
-
return apiResponse.pipe(
|
|
74
|
-
tap(() => {
|
|
75
|
-
this.removeIdsFromSelected(currentSelection)
|
|
76
|
-
}),
|
|
77
|
-
map(() => undefined)
|
|
78
|
-
)
|
|
79
55
|
}
|
|
80
56
|
}
|
|
@@ -48,13 +48,7 @@ export const RecordStatusValues = [
|
|
|
48
48
|
]
|
|
49
49
|
export type RecordStatus = typeof RecordStatusValues[number]
|
|
50
50
|
|
|
51
|
-
export type
|
|
52
|
-
export interface AccessConstraint {
|
|
53
|
-
text: string
|
|
54
|
-
type: AccessConstraintType
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export type License = {
|
|
51
|
+
export type Constraint = {
|
|
58
52
|
text: string
|
|
59
53
|
url?: URL
|
|
60
54
|
}
|
|
@@ -77,10 +71,10 @@ export interface BaseRecord {
|
|
|
77
71
|
kind: RecordKind
|
|
78
72
|
themes: Array<string> // TODO: handle codelists
|
|
79
73
|
keywords: Array<string> // TODO: handle thesaurus and id
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
licenses: Array<Constraint>
|
|
75
|
+
legalConstraints: Array<Constraint>
|
|
76
|
+
securityConstraints: Array<Constraint>
|
|
77
|
+
otherConstraints: Array<Constraint>
|
|
84
78
|
overviews: Array<GraphicOverview>
|
|
85
79
|
extras?: Record<string, unknown>
|
|
86
80
|
landingPage?: URL
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FieldName = string
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FieldFilters } from './filter.model'
|
|
2
2
|
import { CatalogRecord } from '../record'
|
|
3
3
|
import { Geometry } from 'geojson'
|
|
4
|
+
import { FieldName } from './field.model'
|
|
4
5
|
|
|
5
|
-
type FieldSort = ['desc' | 'asc', FieldName]
|
|
6
|
+
export type FieldSort = ['desc' | 'asc', FieldName]
|
|
6
7
|
export type SortByField = FieldSort | FieldSort[] // several sort criteria can be used!
|
|
7
|
-
export type FieldName = string
|
|
8
8
|
|
|
9
9
|
export interface SearchParams {
|
|
10
10
|
filters?: FieldFilters
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user.model'
|
|
@@ -15,8 +15,5 @@ export abstract class PlatformServiceInterface {
|
|
|
15
15
|
): Observable<UserModel[]>
|
|
16
16
|
abstract getOrganizations(): Observable<Organization[]>
|
|
17
17
|
abstract translateKey(key: string): Observable<string>
|
|
18
|
-
abstract
|
|
19
|
-
thesaurusName: string,
|
|
20
|
-
lang: string
|
|
21
|
-
): Observable<ThesaurusModel>
|
|
18
|
+
abstract getThesaurusByUri(uri: string): Observable<ThesaurusModel>
|
|
22
19
|
}
|
|
@@ -64,7 +64,7 @@ export const GROUPS_FIXTURE = deepFreeze([
|
|
|
64
64
|
defaultCategory: null,
|
|
65
65
|
allowedCategories: [],
|
|
66
66
|
enableAllowedCategories: false,
|
|
67
|
-
id:
|
|
67
|
+
id: 2,
|
|
68
68
|
email: 'ifremer.ifremer@ifremer.admin.fr',
|
|
69
69
|
referrer: null,
|
|
70
70
|
description: "Institut français de recherche pour l'exploitation de la mer",
|
|
@@ -115,7 +115,7 @@ As such, **it is not very interesting at all.**`,
|
|
|
115
115
|
url: new URL('https://data.rennesmetropole.fr/pages/licence/'),
|
|
116
116
|
},
|
|
117
117
|
],
|
|
118
|
-
|
|
118
|
+
legalConstraints: [
|
|
119
119
|
{
|
|
120
120
|
text: "Dataset access isn't possible since it does not really exist",
|
|
121
121
|
type: 'other',
|
|
@@ -125,6 +125,8 @@ As such, **it is not very interesting at all.**`,
|
|
|
125
125
|
type: 'security',
|
|
126
126
|
},
|
|
127
127
|
],
|
|
128
|
+
securityConstraints: [],
|
|
129
|
+
otherConstraints: [],
|
|
128
130
|
spatialExtents: [],
|
|
129
131
|
temporalExtents: [],
|
|
130
132
|
updateFrequency: {
|
|
@@ -189,7 +191,9 @@ Malgré l'attention portée à la création de ces données, il est rappelé que
|
|
|
189
191
|
],
|
|
190
192
|
lineage: `Document d’urbanisme numérisé conformément aux prescriptions nationales du CNIG par le Service d'Information Géographique de l'Agglomération de la Région de Compiègne.
|
|
191
193
|
Ce lot de données produit en 2019, a été numérisé à partir du PCI Vecteur de 2019 et contrôlé par le Service d'Information Géographique de l'Agglomération de la Région de Compiègne.`,
|
|
192
|
-
|
|
194
|
+
legalConstraints: [],
|
|
195
|
+
securityConstraints: [],
|
|
196
|
+
otherConstraints: [],
|
|
193
197
|
useLimitations: ["Aucune condition ne s'applique", 'Licence Ouverte 2.0'],
|
|
194
198
|
licenses: [
|
|
195
199
|
{
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { OrganizationsServiceInterface } from '../../../../../../libs/common/domain/src/lib/organizations.service.interface'
|
|
3
|
-
import {
|
|
3
|
+
import { combineLatest, map, Observable } from 'rxjs'
|
|
4
4
|
import { UserModel } from '../../../../../../libs/common/domain/src/lib/model/user/user.model'
|
|
5
5
|
import { PlatformServiceInterface } from '../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
6
|
+
import { shareReplay } from 'rxjs/operators'
|
|
6
7
|
|
|
7
8
|
@Injectable({
|
|
8
9
|
providedIn: 'root',
|
|
@@ -16,20 +17,6 @@ export class MyOrgService {
|
|
|
16
17
|
userList: UserModel[]
|
|
17
18
|
}>
|
|
18
19
|
|
|
19
|
-
private myOrgDataSubject = new BehaviorSubject<{
|
|
20
|
-
orgName: string
|
|
21
|
-
logoUrl: string
|
|
22
|
-
recordCount: number
|
|
23
|
-
userCount: number
|
|
24
|
-
userList: UserModel[]
|
|
25
|
-
}>({
|
|
26
|
-
orgName: '',
|
|
27
|
-
logoUrl: '',
|
|
28
|
-
recordCount: 0,
|
|
29
|
-
userCount: 0,
|
|
30
|
-
userList: [],
|
|
31
|
-
})
|
|
32
|
-
|
|
33
20
|
constructor(
|
|
34
21
|
private platformService: PlatformServiceInterface,
|
|
35
22
|
private orgService: OrganizationsServiceInterface
|
|
@@ -55,7 +42,8 @@ export class MyOrgService {
|
|
|
55
42
|
userList,
|
|
56
43
|
userCount,
|
|
57
44
|
}
|
|
58
|
-
})
|
|
45
|
+
}),
|
|
46
|
+
shareReplay(1)
|
|
59
47
|
)
|
|
60
48
|
}
|
|
61
49
|
}
|
|
@@ -50,7 +50,7 @@ const mdViewReducer = createReducer(
|
|
|
50
50
|
chartConfig,
|
|
51
51
|
})),
|
|
52
52
|
on(MdViewActions.close, (state) => {
|
|
53
|
-
// eslint-disable-next-line
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
54
|
const { metadata, related, ...stateWithoutMd } = state
|
|
55
55
|
return stateWithoutMd
|
|
56
56
|
})
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './lib/feature-search.module'
|
|
2
|
+
export * from './lib/filter-geometry.token'
|
|
3
|
+
export * from './lib/record-url.token'
|
|
2
4
|
export * from './lib/state/actions'
|
|
3
5
|
export * from './lib/state/selectors'
|
|
4
6
|
export * from './lib/state/search.facade'
|
|
@@ -18,3 +20,4 @@ export * from './lib/results-hits-number/results-hits.container.component'
|
|
|
18
20
|
export * from './lib/results-layout/results-layout.component'
|
|
19
21
|
export * from './lib/sort-by/sort-by.component'
|
|
20
22
|
export * from './lib/state/container/search-state.container.directive'
|
|
23
|
+
export * from './lib/results-table/results-table.component'
|
|
@@ -39,7 +39,7 @@ export class FavoriteStarComponent implements AfterViewInit, OnDestroy {
|
|
|
39
39
|
map((favorites) => favorites.indexOf(this.record.uniqueIdentifier) > -1)
|
|
40
40
|
)
|
|
41
41
|
isAnonymous$ = this.platformService.isAnonymous()
|
|
42
|
-
record_: CatalogRecord
|
|
42
|
+
record_: Partial<CatalogRecord>
|
|
43
43
|
favoriteCount: number | null
|
|
44
44
|
loading = false
|
|
45
45
|
loginUrl = this.authService.loginUrl
|
|
@@ -15,24 +15,15 @@ import { initialState, reducer, SEARCH_FEATURE_KEY } from './state/reducer'
|
|
|
15
15
|
import { ResultsHitsContainerComponent } from './results-hits-number/results-hits.container.component'
|
|
16
16
|
import { SearchStateContainerDirective } from './state/container/search-state.container.directive'
|
|
17
17
|
import { UiInputsModule } from '../../../../../libs/ui/inputs/src'
|
|
18
|
-
import {
|
|
18
|
+
import { NgModule } from '@angular/core'
|
|
19
19
|
import { UiElementsModule } from '../../../../../libs/ui/elements/src'
|
|
20
20
|
import { FavoriteStarComponent } from './favorites/favorite-star/favorite-star.component'
|
|
21
21
|
import { MatIconModule } from '@angular/material/icon'
|
|
22
22
|
import { FilterDropdownComponent } from './filter-dropdown/filter-dropdown.component'
|
|
23
|
-
import { Geometry } from 'geojson'
|
|
24
23
|
import { UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
|
|
25
24
|
import { RecordsRepositoryInterface } from '../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
|
|
26
25
|
import { Gn4Repository } from '../../../../../libs/api/repository/src'
|
|
27
26
|
|
|
28
|
-
// this geometry will be used to filter & boost results accordingly
|
|
29
|
-
export const FILTER_GEOMETRY = new InjectionToken<Promise<Geometry>>(
|
|
30
|
-
'filter-geometry'
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
// expects the replacement key ${uuid}
|
|
34
|
-
export const RECORD_URL_TOKEN = new InjectionToken<string>('record-url-token')
|
|
35
|
-
|
|
36
27
|
@NgModule({
|
|
37
28
|
declarations: [
|
|
38
29
|
SortByComponent,
|
|
@@ -10,7 +10,7 @@ import { catchError, filter, map, startWith } from 'rxjs/operators'
|
|
|
10
10
|
import { SearchFacade } from '../state/search.facade'
|
|
11
11
|
import { SearchService } from '../utils/service/search.service'
|
|
12
12
|
import { FieldsService } from '../utils/service/fields.service'
|
|
13
|
-
import { FieldAvailableValue } from '../utils/service/fields'
|
|
13
|
+
import { FieldAvailableValue, FieldValue } from '../utils/service/fields'
|
|
14
14
|
|
|
15
15
|
@Component({
|
|
16
16
|
selector: 'gn-ui-filter-dropdown',
|
|
@@ -31,11 +31,11 @@ export class FilterDropdownComponent implements OnInit {
|
|
|
31
31
|
filter((selected) => !!selected),
|
|
32
32
|
startWith([]),
|
|
33
33
|
catchError(() => of([]))
|
|
34
|
-
)
|
|
34
|
+
) as Observable<FieldValue[]>
|
|
35
35
|
|
|
36
|
-
onSelectedValues(values:
|
|
36
|
+
onSelectedValues(values: unknown[]) {
|
|
37
37
|
this.fieldsService
|
|
38
|
-
.buildFiltersFromFieldValues({ [this.fieldName]: values })
|
|
38
|
+
.buildFiltersFromFieldValues({ [this.fieldName]: values as FieldValue[] })
|
|
39
39
|
.subscribe((filters) => this.searchService.updateFilters(filters))
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -11,12 +11,13 @@ import {
|
|
|
11
11
|
AutocompleteComponent,
|
|
12
12
|
AutocompleteItem,
|
|
13
13
|
} from '../../../../../../libs/ui/inputs/src'
|
|
14
|
-
import { Observable } from 'rxjs'
|
|
14
|
+
import { Observable, firstValueFrom } from 'rxjs'
|
|
15
15
|
import { map } from 'rxjs/operators'
|
|
16
16
|
import { SearchFacade } from '../state/search.facade'
|
|
17
17
|
import { SearchService } from '../utils/service/search.service'
|
|
18
18
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
19
19
|
import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
|
|
20
|
+
import { SearchFilters } from '../../../../../../libs/api/metadata-converter/src'
|
|
20
21
|
|
|
21
22
|
@Component({
|
|
22
23
|
selector: 'gn-ui-fuzzy-search',
|
|
@@ -75,7 +76,12 @@ export class FuzzySearchComponent implements OnInit {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
handleInputCleared() {
|
|
79
|
-
|
|
79
|
+
async handleInputCleared() {
|
|
80
|
+
const currentSearchFilters: SearchFilters = await firstValueFrom(
|
|
81
|
+
this.searchFacade.searchFilters$
|
|
82
|
+
)
|
|
83
|
+
if (currentSearchFilters.any) {
|
|
84
|
+
this.searchService.updateFilters({ any: '' })
|
|
85
|
+
}
|
|
80
86
|
}
|
|
81
87
|
}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
ResultsLayoutConfigItem,
|
|
18
18
|
ResultsLayoutConfigModel,
|
|
19
19
|
} from '../../../../../../libs/ui/search/src'
|
|
20
|
-
import { RECORD_URL_TOKEN } from '../
|
|
20
|
+
import { RECORD_URL_TOKEN } from '../record-url.token'
|
|
21
21
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
22
22
|
|
|
23
23
|
export type ResultsListShowMoreStrategy = 'auto' | 'button' | 'none'
|
|
File without changes
|