Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlitaBernachot committed Feb 27, 2025
1 parent bb2c72f commit 6909b57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
13 changes: 11 additions & 2 deletions libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Gn4FieldMapper {
constructor(
private metadataUrlService: MetadataUrlService,
private langService: LangService
) {}
) { }

private lang3 = this.langService.gnLang

Expand Down Expand Up @@ -190,7 +190,7 @@ export class Gn4FieldMapper {
...output,
contactsForResource: [
...('contactsForResource' in output &&
Array.isArray(output.contactsForResource)
Array.isArray(output.contactsForResource)
? output.contactsForResource
: []),
...getAsArray(selectField(source, 'contactForResource')).map(
Expand Down Expand Up @@ -284,6 +284,15 @@ export class Gn4FieldMapper {
},
output
),
related: (output, source) => {
// TODO:
return this.addExtra(
{
featureCatalogIdentifier: selectField(source, 'related'),
},
output
)
},

isPublishedToAll: (output, source) =>
this.addExtra(
Expand Down
12 changes: 6 additions & 6 deletions libs/api/repository/src/lib/gn4/gn4-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
private gn4Mapper: Gn4Converter,
private gn4RecordsApi: RecordsApiService,
private platformService: PlatformServiceInterface
) {}
) { }

search({
filters,
Expand Down Expand Up @@ -154,9 +154,9 @@ export class Gn4Repository implements RecordsRepositoryInterface {
} as DatasetFeatureCatalog)
}

if (/*record.linkedFeatureCatalog*/ false) {
// TODO:
return this.getRecord('uniqueIdentifierTODO').pipe(
const featureCatalogIdentifier = record.extras['featureCatalogIdentifier']
if (featureCatalogIdentifier) {
return this.getRecord(<string>featureCatalogIdentifier).pipe(
switchMap((record) => this.getFeatureCatalog(record))
)
}
Expand Down Expand Up @@ -231,8 +231,8 @@ export class Gn4Repository implements RecordsRepositoryInterface {
getRecordPublicationStatus(uniqueIdentifier: string): Observable<boolean> {
return uniqueIdentifier
? this.getRecord(uniqueIdentifier).pipe(
map((record) => record.extras['isPublishedToAll'] as boolean)
)
map((record) => record.extras['isPublishedToAll'] as boolean)
)
: of(true)
}

Expand Down

0 comments on commit 6909b57

Please sign in to comment.