Skip to content

Commit

Permalink
refactor(geocat): removed the metadata-catalog component (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: Romuald Caplier <romuald.caplier@camptocamp.com>
  • Loading branch information
2 people authored and fgravin committed Jun 11, 2024
1 parent 42f8d1d commit 11b601b
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
[metadataQualityDisplay]="metadataQualityDisplay"
></gn-ui-metadata-quality>
</div>
<gn-ui-metadata-catalog [sourceLabel]="sourceLabel$ | async">
</gn-ui-metadata-catalog>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,6 @@ export class MockMetadataContactComponent {
@Output() contactClick = new EventEmitter<Individual>()
}

@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'gn-ui-metadata-catalog',
template: '<div></div>',
})
export class MockMetadataCatalogComponent {
@Input() sourceLabel: string
}

@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'gn-ui-record-api-form',
Expand Down Expand Up @@ -177,7 +168,6 @@ describe('RecordMetadataComponent', () => {
MockRelatedComponent,
ErrorComponent,
MockMetadataInfoComponent,
MockMetadataCatalogComponent,
MockMetadataContactComponent,
MockRecordApiFormComponent,
MockImgOverlayPreviewComponent,
Expand Down Expand Up @@ -225,7 +215,6 @@ describe('RecordMetadataComponent', () => {
describe('about', () => {
let metadataInfo: MockMetadataInfoComponent
let metadataContact: MockMetadataContactComponent
let catalogComponent: MockMetadataCatalogComponent

beforeEach(() => {
facade.isPresent$.next(true)
Expand All @@ -236,9 +225,6 @@ describe('RecordMetadataComponent', () => {
metadataContact = fixture.debugElement.query(
By.directive(MockMetadataContactComponent)
).componentInstance
catalogComponent = fixture.debugElement.query(
By.directive(MockMetadataCatalogComponent)
).componentInstance
})
describe('if metadata present', () => {
it('shows the full metadata', () => {
Expand All @@ -247,12 +233,6 @@ describe('RecordMetadataComponent', () => {
it('shows the metadata contact', () => {
expect(metadataContact.metadata).toHaveProperty('contacts')
})
it('shows the metadata catalog', () => {
expect(sourcesService.getSourceLabel).toBeCalledWith(
SAMPLE_RECORD.extras.catalogUuid
)
expect(catalogComponent.sourceLabel).toEqual('catalog label')
})
})
describe('if metadata not present', () => {
beforeEach(() => {
Expand All @@ -271,11 +251,6 @@ describe('RecordMetadataComponent', () => {
fixture.debugElement.query(By.directive(MockMetadataContactComponent))
).toBeFalsy()
})
it('does not display the metadata catalog component', () => {
expect(
fixture.debugElement.query(By.directive(MockMetadataCatalogComponent))
).toBeFalsy()
})
it('does not display the image overlay preview', () => {
expect(
fixture.debugElement.query(
Expand Down
9 changes: 8 additions & 1 deletion libs/ui/elements/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export * from './lib/ui-elements.module'
export * from './lib/metadata-info/metadata-info.component'
export * from './lib/metadata-contact/metadata-contact.component'
export * from './lib/metadata-quality/metadata-quality.component'
export * from './lib/metadata-quality-item/metadata-quality-item.component'
export * from './lib/thumbnail/thumbnail.component'
export * from './lib/content-ghost/content-ghost.component'
export * from './lib/pagination-buttons/pagination-buttons.component'
export * from './lib/api-card/api-card.component'
export * from './lib/avatar/avatar.component'
export * from './lib/content-ghost/content-ghost.component'
Expand All @@ -8,7 +16,6 @@ export * from './lib/link-card/link-card.component'
export * from './lib/markdown-editor/markdown-editor.component'
export * from './lib/markdown-parser/markdown-parser.component'
export * from './lib/max-lines/max-lines.component'
export * from './lib/metadata-catalog/metadata-catalog.component'
export * from './lib/metadata-contact/metadata-contact.component'
export * from './lib/metadata-info/metadata-info.component'
export * from './lib/metadata-quality-item/metadata-quality-item.component'
Expand Down
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions libs/ui/elements/src/lib/ui-elements.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { UiLayoutModule } from '@geonetwork-ui/ui/layout'
import { TranslateModule } from '@ngx-translate/core'
import { RelatedRecordCardComponent } from './related-record-card/related-record-card.component'
import { MetadataContactComponent } from './metadata-contact/metadata-contact.component'
import { MetadataCatalogComponent } from './metadata-catalog/metadata-catalog.component'
import { MetadataQualityComponent } from './metadata-quality/metadata-quality.component'
import { MetadataQualityItemComponent } from './metadata-quality-item/metadata-quality-item.component'
import { ErrorComponent } from './error/error.component'
Expand Down Expand Up @@ -59,7 +58,6 @@ import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
ApiCardComponent,
RelatedRecordCardComponent,
MetadataContactComponent,
MetadataCatalogComponent,
MetadataQualityComponent,
MetadataQualityItemComponent,
ErrorComponent,
Expand All @@ -81,7 +79,6 @@ import { TimeSincePipe } from './user-feedback-item/time-since.pipe'
ApiCardComponent,
RelatedRecordCardComponent,
MetadataContactComponent,
MetadataCatalogComponent,
MetadataQualityComponent,
MetadataQualityItemComponent,
ErrorComponent,
Expand Down

0 comments on commit 11b601b

Please sign in to comment.