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 4, 2024
1 parent b45c52d commit cbba66e
Show file tree
Hide file tree
Showing 8 changed files with 0 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 @@ -132,15 +132,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 @@ -179,7 +170,6 @@ describe('RecordMetadataComponent', () => {
MockRelatedComponent,
SearchResultsErrorComponent,
MockMetadataInfoComponent,
MockMetadataCatalogComponent,
MockMetadataContactComponent,
MockRecordApiFormComponent,
MockImgOverlayPreviewComponent,
Expand Down Expand Up @@ -227,7 +217,6 @@ describe('RecordMetadataComponent', () => {
describe('about', () => {
let metadataInfo: MockMetadataInfoComponent
let metadataContact: MockMetadataContactComponent
let catalogComponent: MockMetadataCatalogComponent

beforeEach(() => {
facade.isPresent$.next(true)
Expand All @@ -238,9 +227,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 @@ -249,12 +235,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 @@ -273,11 +253,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
1 change: 0 additions & 1 deletion libs/ui/elements/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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-catalog/metadata-catalog.component'
export * from './lib/metadata-quality/metadata-quality.component'
export * from './lib/metadata-quality-item/metadata-quality-item.component'
export * from './lib/search-results-error/search-results-error.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 @@ -15,7 +15,6 @@ import { TranslateModule } from '@ngx-translate/core'
import { LinkCardComponent } from './link-card/link-card.component'
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 { SearchResultsErrorComponent } from './search-results-error/search-results-error.component'
Expand Down Expand Up @@ -56,7 +55,6 @@ import { ImageOverlayPreviewComponent } from './image-overlay-preview/image-over
LinkCardComponent,
RelatedRecordCardComponent,
MetadataContactComponent,
MetadataCatalogComponent,
MetadataQualityComponent,
MetadataQualityItemComponent,
SearchResultsErrorComponent,
Expand All @@ -79,7 +77,6 @@ import { ImageOverlayPreviewComponent } from './image-overlay-preview/image-over
LinkCardComponent,
RelatedRecordCardComponent,
MetadataContactComponent,
MetadataCatalogComponent,
MetadataQualityComponent,
MetadataQualityItemComponent,
SearchResultsErrorComponent,
Expand Down

1 comment on commit cbba66e

@fgravin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not because geocat is not using it that you have to remove the component.
Note that this is a fork (it shouldn't be btw), and it's better to limit the changes with the upstream repo as much as possible.
Thanks

Please sign in to comment.