stable

Clone or download

Read-only

Display project banner

Issue PUT /bannner to create a platform banner, or use site admin utilities. Once the platform banner is set, it is displayed on every pages of the platform. If user is logged in, then the banner can be hidden. Once hidden, the banner won't be automatically displayed on page load unless it is updated (or removed/recreated). The user can still have a look at the message though, thanks to the bullhorn floating button. Note: If both platform and project banners are displayed, and the platform has "warning" importance, then the background color of the two banners will be the same orange, without any distinction. This issue will be managed in a dedicated commit. This replaces the legacy motd. There are many situtations that should be checked. You can mix any combinations of these: - Pages with or without a sidebar (project, siteadmin) - Pages with FlamingParrot or BurningParrot - Project banner not set, set and displayed, or set and hidden - Platform banner not set, set and displayed, unclamped, or set and hidden - To scroll or not to scroll - Choice of browser Please note that on applications that compute their height, the presence of the platform banner may force the viewport to scroll and hide some content under the fold. It is not ideal and we should see how we can fix this situation. However I suggest that we consider this acceptable: - The platform banner is intended to be closed as soon as the message is read. If user continues to browse with the platform banner displayed on every pages, then having to scroll should not be a real problem. - The hidden stuff under the fold are controls (TTM buttons, add inplace for kanban, …) that are not available for users that cannot hide the banner (they are anonymous). Given that the impact is low, we can live with it for this commit. Clamping (like for project banner), if needed, will be done in a dedicated changeset. Part of story #14670: display a site wide banner (motd) Change-Id: I453f22114da1035dad9cb5e6b2dfdba3751ed6c5

Modified Files

Name
A src/common/Platform/Banner/BannerDisplay.php +88 −0 Go to diff View file
M src/common/Platform/Banner/BannerRetriever.php +23 −0 Go to diff View file
M src/common/layout/BaseLayout.php +13 −14 Go to diff View file
M src/package-lock.json +223 −1 Go to diff View file
M src/package.json +4 −1 Go to diff View file
M src/scripts/BurningParrot/src/index.js +13 −2 Go to diff View file
D src/scripts/BurningParrot/src/update-ui-margins-according-to-motd.ts +0 −51 Go to diff View file
M src/scripts/FlamingParrot/index.js +13 −1 Go to diff View file
D src/scripts/FlamingParrot/update-ui-margins-according-to-motd.ts +0 −51 Go to diff View file
R src/scripts/FlamingParrot/motd.js Go to diff View file
A src/scripts/platform/banner/index-fp.ts +25 −0 Go to diff View file
A src/scripts/platform/banner/observe-platform-banner.ts +30 −0 Go to diff View file
A src/scripts/platform/banner/platform-banner-show-hide.test.ts +127 −0 Go to diff View file
A src/scripts/platform/banner/platform-banner-show-hide.ts +99 −0 Go to diff View file
M src/scripts/project/banner/index-bp.ts +1 −2 Go to diff View file
M src/scripts/project/banner/index-fp.ts +1 −2 Go to diff View file
A src/scripts/project/banner/observe-project-banner.ts +30 −0 Go to diff View file
M src/scripts/project/banner/project-banner-clamp.ts +0 −6 Go to diff View file
M src/scripts/project/banner/project-banner-show-hide.test.ts +4 −22 Go to diff View file
M src/scripts/project/banner/project-banner-show-hide.ts +0 −15 Go to diff View file
D src/scripts/project/banner/update-floating-buttons-position.ts +0 −72 Go to diff View file
A src/scripts/tuleap/adjust-header-position-according-to-banners.test.ts +190 −0 Go to diff View file
A src/scripts/tuleap/adjust-header-position-according-to-banners.ts +56 −0 Go to diff View file
A src/scripts/tuleap/header-position.ts +95 −0 Go to diff View file
A src/scripts/tuleap/main-position.ts +39 −0 Go to diff View file
A src/scripts/tuleap/sidebar-position.ts +39 −0 Go to diff View file
A src/templates/admin/banner/administration-banner.mustache +15 −0 Go to diff View file
A src/templates/common/platform-banner.mustache +18 −0 Go to diff View file
M src/themes/BurningParrot/css/_includes.scss +1 −0 Go to diff View file
M src/themes/BurningParrot/css/dashboards/includes/_dashboard-user.scss +2 −2 Go to diff View file
M src/themes/BurningParrot/css/includes/_global-variables.scss +1 −1 Go to diff View file
M src/themes/BurningParrot/css/includes/_header.scss +2 −25 Go to diff View file
R src/scripts/BurningParrot/src/motd.js Go to diff View file
M src/themes/BurningParrot/include/BurningParrotTheme.php +1 −1 Go to diff View file
M src/themes/BurningParrot/include/HeaderPresenter.php +33 −10 Go to diff View file
M src/themes/BurningParrot/include/HeaderPresenterBuilder.php +5 −4 Go to diff View file
M src/themes/BurningParrot/include/Navbar/PresenterBuilder.php +4 −2 Go to diff View file
M src/themes/BurningParrot/include/Navbar/UserNavPresenter.php +34 −1 Go to diff View file
M src/themes/BurningParrot/templates/header.mustache +2 −0 Go to diff View file
M src/themes/BurningParrot/templates/navbar/navbar.mustache +22 −3 Go to diff View file
M src/themes/FlamingParrot/css/utils/_definitions.scss +1 −0 Go to diff View file
M src/themes/FlamingParrot/css/utils/_navbar.scss +1 −25 Go to diff View file
A src/themes/FlamingParrot/css/utils/_platform-banner.scss +52 −0 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-blue.scss +5 −4 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-bluegrey.scss +5 −4 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-color-common.scss +3 −1 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-common.scss +1 −1 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-green.scss +5 −4 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-orange.scss +5 −4 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-purple.scss +5 −4 Go to diff View file
M src/themes/FlamingParrot/css/utils/_variables-red.scss +5 −4 Go to diff View file
M src/themes/FlamingParrot/include/BodyPresenter.class.php +33 −1 Go to diff View file
M src/themes/FlamingParrot/include/NavBarPresenter.class.php +41 −10 Go to diff View file
M src/themes/FlamingParrot/templates/body.mustache +1 −0 Go to diff View file
M src/themes/FlamingParrot/templates/navbar.mustache +19 −4 Go to diff View file
A src/themes/common/css/platform-banner/_platform-banner.scss +107 −0 Go to diff View file
M src/themes/common/css/project-background/_background.scss +3 −3 Go to diff View file
M src/webpack.common.js +2 −0 Go to diff View file
M src/www/themes/FlamingParrot/FlamingParrot_Theme.class.php +8 −5 Go to diff View file
A tests/unit/common/Platform/Banner/BannerDisplayTest.php +50 −0 Go to diff View file
M tests/unit/common/Platform/Banner/BannerRetrieverTest.php +56 −0 Go to diff View file