Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MEL]: Application banner #1142

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

[MEL]: Application banner #1142

wants to merge 8 commits into from

Conversation

cmoinier
Copy link
Collaborator

@cmoinier cmoinier commented Mar 3, 2025

Description

This PR introduces an application banner, shown on the datahub header when the translation key appplication-banner is set in the backend.
It includes different display & styling options as described in https://www.figma.com/design/gA3wp0RCnrZtvEBhtdVkpO/GN4-datahub-camptocamp?node-id=3902-13462&m=dev. Some adaptations will be done on MEL & that's why the component has been made configurable.

To test

Login & go to /geonetwork/srv/eng/admin.console#/settings/languages.
Add the translation key "application-banner" and add the english/french translation (depending on your browser language). Don't forget to save!

Architectural changes

none

Screenshots

Screenshot from 2025-03-03 10-05-44

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

Copy link
Contributor

github-actions bot commented Mar 3, 2025

Affected libs:
ui-elements,feature-notifications,feature-editor,feature-search,feature-router,feature-map,feature-record,feature-catalog,ui-catalog,ui-search

Affected apps:
datahub,metadata-editor,datafeeder,demo,webcomponents,map-viewer,search

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Mar 3, 2025

📷 Screenshots are here!

@coveralls
Copy link

coveralls commented Mar 3, 2025

Coverage Status

coverage: 83.036% (-1.8%) from 84.847%
when pulling 744097a on app-banner
into 22c177e on main.

.type(
'This is a warning message that should be shown when the key is set'
)
cy.get('.btn-group').eq(1).find('button').first().click()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if there is an enpoint api to add a new translation key, maybe it will save time to do so as a POST instead of login and navigate in geonetwork admin.
But it works fine as is too, this is a thought about improving e2e runing time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think there is, and it would also fail a bit less. Will change that, thanks for the suggestion :)

[message]="platformService.translateKey(bannerKey) | async"
class="container-sm"
type="secondary"
></gn-ui-application-banner>
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is a little broken with a long text 😅
image

Copy link
Collaborator

@AlitaBernachot AlitaBernachot left a comment

Choose a reason for hiding this comment

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

Apart from the small display issue with long text, it is working great!
Thanks for the work!

title: 'Warning',
closeEnabled: true,
type: 'light',
},
Copy link
Collaborator

@AlitaBernachot AlitaBernachot Mar 4, 2025

Choose a reason for hiding this comment

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

image

I don't see colored background on the story book for Secondary and Light, i don't know if this was made on purpose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It wasn't, I don't know why it's happening like that in the storybook, maybe it's a matter of colors imports? Because in the datahub the right colors are shown when switching to secondary or light :/
Since it works in the app & it's only on storybook, I will look into it if there is time left

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants