Skip to content

Commit

Permalink
Merge pull request #884 from geonetwork/fix-data-not-found
Browse files Browse the repository at this point in the history
[Datahub]: Fix missing "record not found" message
  • Loading branch information
cmoinier authored May 29, 2024
2 parents ff2a9db + 46f507b commit 549700b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
9 changes: 9 additions & 0 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,3 +797,12 @@ describe('userFeedback', () => {
})
})
})

describe('When the metadata does not exists', () => {
beforeEach(() => {
cy.visit('/dataset/xyz')
})
it('should display an error message', () => {
cy.get('gn-ui-search-results-error').should('exist')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,17 @@
<div class="container-lg mx-auto h-[1096px] sm:h-96"></div>
</div>
</div>
</div>
<div id="userFeedbacks" class="bg-primary-opacity-10 py-16 mt-[32px]">
<div class="container-lg px-4 lg:mx-auto">
<datahub-record-user-feedbacks
[organisationName$]="organisationName$"
[metadataUuid]="metadataUuid$ | async"
></datahub-record-user-feedbacks>
<div
*ngIf="(metadataViewFacade.isPresent$ | async) === true"
id="userFeedbacks"
class="bg-primary-opacity-10 py-16 mt-[32px]"
>
<div class="container-lg px-4 lg:mx-auto">
<datahub-record-user-feedbacks
[organisationName$]="organisationName$"
[metadataUuid]="metadataUuid$ | async"
></datahub-record-user-feedbacks>
</div>
</div>
</div>
<div
Expand Down
2 changes: 0 additions & 2 deletions libs/feature/record/src/lib/state/mdview.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const metadataViewReducer = createReducer(
*/
on(MetadataViewActions.loadUserFeedbacks, (state) => ({
...state,
error: null,
allUserFeedbacksLoading: true,
})),
on(MetadataViewActions.addUserFeedback, (state) => ({
Expand All @@ -93,7 +92,6 @@ const metadataViewReducer = createReducer(
MetadataViewActions.loadUserFeedbacksSuccess,
(state, { userFeedbacks }) => ({
...state,
error: null,
userFeedbacks: userFeedbacks,
addUserFeedbackLoading: false,
allUserFeedbacksLoading: false,
Expand Down

0 comments on commit 549700b

Please sign in to comment.