x-atlas-consortia / data-ingest-board

The UI App for HuBMAP and Sennet Data Publishing Dashboard
MIT License
0 stars 0 forks source link

Libpitt/01 10 24 sprint banner #141

Closed libpitt closed 8 months ago

libpitt commented 8 months ago

Change log:

  1. Update mobile login section https://github.com/x-atlas-consortia/data-ingest-board/issues/17
  2. Add configurable banner and supporting documentation https://github.com/x-atlas-consortia/data-ingest-board/issues/124
libpitt commented 8 months ago

@yuanzhou Or I can just use the configuration to create what you like. Can we truly anticipate never needing this functionality? I think better to have it. For example:

NEXT_PUBLIC_BANNER_LOGIN = '{"sectionClassName": "container", "theme": "danger", "title": "<h2>Login Warning</h2>", "content": "This banner matches the width of the Login section. Can include html tags in any property marked as type <code>html str</code> in the documentation. Like: <a href='https://github.com/x-atlas-consortia/data-ingest-board?tab=readme-ov-file#content-management'>Git Hub Docs</a>", "className": "mt-4"}'

NEXT_PUBLIC_BANNER_SEARCH_ENTITIES = $NEXT_PUBLIC_BANNER_LOGIN

I can create some defaults to address:

NEXT_PUBLIC_BANNER_LOGIN = '{"title": "<h2>Login Warning</h2>", "content": "This banner matches the width of the Login section. Can include html tags in any property marked as type <code>html str</code> in the documentation. Like: <a href='https://github.com/x-atlas-consortia/data-ingest-board?tab=readme-ov-file#content-management'>Git Hub Docs</a>"}'

NEXT_PUBLIC_BANNER_SEARCH_ENTITIES = $NEXT_PUBLIC_BANNER_LOGIN

By default the banner has no dismissible or close button.

yuanzhou commented 8 months ago

@libpitt thanks for the suggestion, I'm pretty sure we only need one banner. And we don't want to have separate title and content because many cases we don't use a title at all. Since HTML is supported, we can include the title in the main message too.

libpitt commented 8 months ago

@yuanzhou I see. title property also not a required field. In fact, none of the properties are required. Add as needed.

yuanzhou commented 8 months ago

@libpitt do you need to update the example.sennet.env?

Can you also disable these two banner config variables by default in the example config as well for both HuBMAP and SenNet? Since they are optional and we only use them on demand.

I did a quick test, looks like there's a bit inconsistency with the margin or maybe it's a padding issue. On the login page the banner spans to the content width. After login, it's narrower than the main content container.

Screenshot 2024-01-17 at 4 29 26 PM Screenshot 2024-01-17 at 4 30 10 PM

When I mentioned "A warning style is sufficient." I really meant something like the warning alert box rather than danger alert style, using Bootstrap as an example:

Screenshot 2024-01-17 at 4 37 53 PM