diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-02 21:10:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-02 21:10:01 +0300 |
commit | e84a2fdfc862ac63fe4be9df2f940c22a0c9aba3 (patch) | |
tree | 8a64589231ede24f385d2819b3440fca001e482d /scripts/frontend | |
parent | 1c2ff01b694fd06be15bc20279eef71ee5adf402 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/frontend')
-rw-r--r-- | scripts/frontend/startup_css/constants.js | 63 | ||||
-rwxr-xr-x | scripts/frontend/startup_css/startup_css_changed.sh | 36 | ||||
-rw-r--r-- | scripts/frontend/startup_css/write_startup_scss.js | 2 |
3 files changed, 30 insertions, 71 deletions
diff --git a/scripts/frontend/startup_css/constants.js b/scripts/frontend/startup_css/constants.js index a76092f8b45..9b9dc522a8f 100644 --- a/scripts/frontend/startup_css/constants.js +++ b/scripts/frontend/startup_css/constants.js @@ -27,6 +27,7 @@ const CSS_TO_REMOVE = [ /\.commit/, /\.md/, /\.with-performance-bar/, + /\.identicon/, ]; const APPLICATION_CSS_PREFIX = 'application'; const APPLICATION_DARK_CSS_PREFIX = 'application_dark'; @@ -35,55 +36,49 @@ const UTILITIES_DARK_CSS_PREFIX = 'application_utilities_dark'; // paths ----------------------------------------------------------------------- const ROOT = path.resolve(__dirname, '../../..'); -const ROOT_RAILS = IS_EE ? path.join(ROOT, 'ee') : ROOT; const FIXTURES_FOLDER_NAME = IS_EE ? 'fixtures-ee' : 'fixtures'; const FIXTURES_ROOT = path.join(ROOT, 'tmp/tests/frontend', FIXTURES_FOLDER_NAME); const PATH_SIGNIN_HTML = path.join(FIXTURES_ROOT, 'startup_css/sign-in.html'); const PATH_ASSETS = path.join(ROOT, 'tmp/startup_css_assets'); -const PATH_STARTUP_SCSS = path.join(ROOT_RAILS, 'app/assets/stylesheets/startup'); - -// helpers --------------------------------------------------------------------- -const createMainOutput = ({ outFile, cssKeys, type }) => ({ - outFile, - htmlPaths: [ - path.join(FIXTURES_ROOT, `startup_css/project-${type}.html`), - path.join(FIXTURES_ROOT, `startup_css/project-${type}-legacy-menu.html`), - path.join(FIXTURES_ROOT, `startup_css/project-${type}-legacy-sidebar.html`), - path.join(FIXTURES_ROOT, `startup_css/project-${type}-signed-out.html`), - ], - cssKeys, - purgeOptions: { - safelist: { - standard: [ - 'page-with-icon-sidebar', - 'sidebar-collapsed-desktop', - // We want to include the root dropdown-menu style since it should be hidden by default - 'dropdown-menu', - ], - // We want to include the identicon backgrounds - greedy: [/^bg[0-9]$/], - }, - }, -}); - +const PATH_STARTUP_SCSS = path.join(ROOT, 'app/assets/stylesheets/startup'); const OUTPUTS = [ - createMainOutput({ - type: 'general', + { outFile: 'startup-general', + htmlPaths: [ + path.join(FIXTURES_ROOT, 'startup_css/project-general.html'), + path.join(FIXTURES_ROOT, 'startup_css/project-general-legacy-menu.html'), + path.join(FIXTURES_ROOT, 'startup_css/project-general-signed-out.html'), + ], cssKeys: [APPLICATION_CSS_PREFIX, UTILITIES_CSS_PREFIX], - }), - createMainOutput({ - type: 'dark', + // We want to include the root dropdown-menu style since it should be hidden by default + purgeOptions: { + safelist: { + standard: ['dropdown-menu'], + }, + }, + }, + { outFile: 'startup-dark', + htmlPaths: [ + path.join(FIXTURES_ROOT, 'startup_css/project-dark.html'), + path.join(FIXTURES_ROOT, 'startup_css/project-dark-legacy-menu.html'), + path.join(FIXTURES_ROOT, 'startup_css/project-dark-signed-out.html'), + ], cssKeys: [APPLICATION_DARK_CSS_PREFIX, UTILITIES_DARK_CSS_PREFIX], - }), + // We want to include the root dropdown-menu styles since it should be hidden by default + purgeOptions: { + safelist: { + standard: ['dropdown-menu'], + }, + }, + }, { outFile: 'startup-signin', htmlPaths: [PATH_SIGNIN_HTML], cssKeys: [APPLICATION_CSS_PREFIX, UTILITIES_CSS_PREFIX], purgeOptions: { safelist: { - standard: ['fieldset', 'hidden'], + standard: ['fieldset'], deep: [/login-page$/], }, }, diff --git a/scripts/frontend/startup_css/startup_css_changed.sh b/scripts/frontend/startup_css/startup_css_changed.sh deleted file mode 100755 index b1df97f2f42..00000000000 --- a/scripts/frontend/startup_css/startup_css_changed.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -echo "-----------------------------------------------------------" -echo "If you are run into any issues with Startup CSS generation," -echo "please check out the feedback issue:" -echo "" -echo "https://gitlab.com/gitlab-org/gitlab/-/issues/331812" -echo "-----------------------------------------------------------" - -startup_glob="*stylesheets/startup*" - -echo "Staging changes to '${startup_glob}' so we can check for untracked files..." -git add ${startup_glob} - -if [ -n "$(git diff HEAD --name-only -- ${startup_glob})" ]; then - diff=$(git diff HEAD -- ${startup_glob}) - cat <<EOF - -Startup CSS changes detected! - -It looks like there have been recent changes which require -regenerating the Startup CSS files. - -Consider one of the following options: - - 1. Regenerating locally with "yarn run generate:startup_css". - 2. Copy and apply the following diff: - ------ start diff ----- -$diff - ------ end diff ------- -EOF - - exit 1 -fi diff --git a/scripts/frontend/startup_css/write_startup_scss.js b/scripts/frontend/startup_css/write_startup_scss.js index 245681bada3..3754b95cefd 100644 --- a/scripts/frontend/startup_css/write_startup_scss.js +++ b/scripts/frontend/startup_css/write_startup_scss.js @@ -9,7 +9,7 @@ const buildFinalContent = (raw) => { // https://gitlab.com/gitlab-org/gitlab/-/issues/331812 @charset "UTF-8"; ${raw} -@import 'startup/cloaking'; +@import 'cloaking'; @include cloak-startup-scss(none); `; |