-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from gisktzh/feature/gb3-1674-metadata-nullable…
…-handling fix breaking changes from api v2 update
- Loading branch information
Showing
13 changed files
with
105 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/app/data-catalogue/components/data-display/data-display.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export interface LayerAttributes { | ||
name: string; | ||
description: string; | ||
type: string; | ||
name: string | null; | ||
description: string | null; | ||
type: string | null; | ||
unit: string | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {TextOrPlaceholderPipe} from './text-or-placeholder.pipe'; | ||
|
||
describe('TextOrPlaceholderPipe', () => { | ||
let pipe: TextOrPlaceholderPipe; | ||
|
||
beforeEach(() => { | ||
pipe = new TextOrPlaceholderPipe(); | ||
}); | ||
it('create an instance', () => { | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
it('returns the string value if present', () => { | ||
const value: string = 'test'; | ||
|
||
const result = pipe.transform(value); | ||
|
||
const expected = 'test'; | ||
expect(result).toEqual(expected); | ||
}); | ||
it('returns the placeholder if the value is null', () => { | ||
const value = null; | ||
|
||
const result = pipe.transform(value); | ||
|
||
const expected = '-'; | ||
expect(result).toEqual(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {Pipe, PipeTransform} from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'textOrPlaceholder', | ||
standalone: true, | ||
}) | ||
export class TextOrPlaceholderPipe implements PipeTransform { | ||
transform(value: string | null): string { | ||
return value ?? '-'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters