From 21e8f0114a29bc33a6ce53b2e1b6b0b133f5ce45 Mon Sep 17 00:00:00 2001 From: BlackDex Date: Wed, 11 Sep 2024 14:01:57 +0200 Subject: [PATCH] Add dynamic CSS support This PR will remove the custom CSS changes from this repo. A PR in the Vaultwarden repo will add these in a different way. To make the dynamic CSS work other changes are done to add a custom stylesheet link tag. Also moved some legacy patch files. Signed-off-by: BlackDex --- patches/{ => legacy}/v2023.1.0.patch | 0 patches/{ => legacy}/v2023.1.1.patch | 0 patches/{ => legacy}/v2023.10.0.patch | 0 patches/{ => legacy}/v2023.12.0.patch | 0 patches/{ => legacy}/v2023.2.0.patch | 0 patches/{ => legacy}/v2023.3.0.patch | 0 patches/{ => legacy}/v2023.4.0.patch | 0 patches/{ => legacy}/v2023.5.0.patch | 0 patches/{ => legacy}/v2023.5.1.patch | 0 patches/{ => legacy}/v2023.7.1.patch | 0 patches/{ => legacy}/v2023.8.2.patch | 0 patches/{ => legacy}/v2023.9.1.patch | 0 patches/v2024.6.2.patch | 97 +++------------------------ scripts/generate_patch_file.sh | 5 +- 14 files changed, 13 insertions(+), 89 deletions(-) rename patches/{ => legacy}/v2023.1.0.patch (100%) rename patches/{ => legacy}/v2023.1.1.patch (100%) rename patches/{ => legacy}/v2023.10.0.patch (100%) rename patches/{ => legacy}/v2023.12.0.patch (100%) rename patches/{ => legacy}/v2023.2.0.patch (100%) rename patches/{ => legacy}/v2023.3.0.patch (100%) rename patches/{ => legacy}/v2023.4.0.patch (100%) rename patches/{ => legacy}/v2023.5.0.patch (100%) rename patches/{ => legacy}/v2023.5.1.patch (100%) rename patches/{ => legacy}/v2023.7.1.patch (100%) rename patches/{ => legacy}/v2023.8.2.patch (100%) rename patches/{ => legacy}/v2023.9.1.patch (100%) diff --git a/patches/v2023.1.0.patch b/patches/legacy/v2023.1.0.patch similarity index 100% rename from patches/v2023.1.0.patch rename to patches/legacy/v2023.1.0.patch diff --git a/patches/v2023.1.1.patch b/patches/legacy/v2023.1.1.patch similarity index 100% rename from patches/v2023.1.1.patch rename to patches/legacy/v2023.1.1.patch diff --git a/patches/v2023.10.0.patch b/patches/legacy/v2023.10.0.patch similarity index 100% rename from patches/v2023.10.0.patch rename to patches/legacy/v2023.10.0.patch diff --git a/patches/v2023.12.0.patch b/patches/legacy/v2023.12.0.patch similarity index 100% rename from patches/v2023.12.0.patch rename to patches/legacy/v2023.12.0.patch diff --git a/patches/v2023.2.0.patch b/patches/legacy/v2023.2.0.patch similarity index 100% rename from patches/v2023.2.0.patch rename to patches/legacy/v2023.2.0.patch diff --git a/patches/v2023.3.0.patch b/patches/legacy/v2023.3.0.patch similarity index 100% rename from patches/v2023.3.0.patch rename to patches/legacy/v2023.3.0.patch diff --git a/patches/v2023.4.0.patch b/patches/legacy/v2023.4.0.patch similarity index 100% rename from patches/v2023.4.0.patch rename to patches/legacy/v2023.4.0.patch diff --git a/patches/v2023.5.0.patch b/patches/legacy/v2023.5.0.patch similarity index 100% rename from patches/v2023.5.0.patch rename to patches/legacy/v2023.5.0.patch diff --git a/patches/v2023.5.1.patch b/patches/legacy/v2023.5.1.patch similarity index 100% rename from patches/v2023.5.1.patch rename to patches/legacy/v2023.5.1.patch diff --git a/patches/v2023.7.1.patch b/patches/legacy/v2023.7.1.patch similarity index 100% rename from patches/v2023.7.1.patch rename to patches/legacy/v2023.7.1.patch diff --git a/patches/v2023.8.2.patch b/patches/legacy/v2023.8.2.patch similarity index 100% rename from patches/v2023.8.2.patch rename to patches/legacy/v2023.8.2.patch diff --git a/patches/v2023.9.1.patch b/patches/legacy/v2023.9.1.patch similarity index 100% rename from patches/v2023.9.1.patch rename to patches/legacy/v2023.9.1.patch diff --git a/patches/v2024.6.2.patch b/patches/v2024.6.2.patch index 075482b..16a1387 100644 --- a/patches/v2024.6.2.patch +++ b/patches/v2024.6.2.patch @@ -666,10 +666,10 @@ index 8dd63e62dd..1a1e45cc35 100644 } else { // Remove reset password diff --git a/apps/web/src/index.html b/apps/web/src/index.html -index c3a2c03ed9..1a326771a6 100644 +index c3a2c03ed9..bbfa9aae9e 100644 --- a/apps/web/src/index.html +++ b/apps/web/src/index.html -@@ -5,7 +5,7 @@ +@@ -5,19 +5,21 @@ @@ -678,7 +678,13 @@ index c3a2c03ed9..1a326771a6 100644 -@@ -17,7 +17,7 @@ + + + ++ ++ + +
@@ -707,91 +713,6 @@ index 92a1204c60..d9ff4771a3 100644 + "theme_color": "#FFFFFF", + "background_color": "#FFFFFF" } -diff --git a/apps/web/src/scss/styles.scss b/apps/web/src/scss/styles.scss -index 8fbea200a9..e3ff719ab2 100644 ---- a/apps/web/src/scss/styles.scss -+++ b/apps/web/src/scss/styles.scss -@@ -53,3 +53,80 @@ - @import "./plugins"; - @import "./tables"; - @import "./vault-filters"; -+ -+/**** START Vaultwarden CHANGES ****/ -+/* This combines all selectors extending it into one */ -+%vw-hide { -+ display: none !important; -+} -+ -+/* This allows searching for the combined style in the browsers dev-tools (look into the head tag) */ -+.vw-hide, -+head { -+ @extend %vw-hide; -+} -+ -+/* Hide the Subscription Page tab */ -+bit-nav-item[route="settings/subscription"] { -+ @extend %vw-hide; -+} -+ -+/* Hide any link pointing to Free Bitwarden Families */ -+a[href$="/settings/sponsored-families"] { -+ @extend %vw-hide; -+} -+ -+/* Hide the `Enterprise Single Sign-On` button on the login page */ -+a[routerlink="/sso"] { -+ @extend %vw-hide; -+} -+ -+/* Hide Two-Factor menu in Organization settings */ -+bit-nav-item[route="settings/two-factor"], -+a[href$="/settings/two-factor"] { -+ @extend %vw-hide; -+} -+ -+/* Hide Business Owned checkbox */ -+app-org-info > form:nth-child(1) > div:nth-child(3) { -+ @extend %vw-hide; -+} -+ -+/* Hide the `This account is owned by a business` checkbox and label */ -+#ownedBusiness, -+label[for^="ownedBusiness"] { -+ @extend %vw-hide; -+} -+ -+/* Hide the radio button and label for the `Custom` org user type */ -+#userTypeCustom, -+label[for^="userTypeCustom"] { -+ @extend %vw-hide; -+} -+ -+/* Hide Business Name */ -+app-org-account form div bit-form-field.tw-block:nth-child(3) { -+ @extend %vw-hide; -+} -+ -+/* Hide organization plans */ -+app-organization-plans > form > bit-section:nth-child(2) { -+ @extend %vw-hide; -+} -+ -+/* Hide Device Verification form at the Two Step Login screen */ -+app-security > app-two-factor-setup > form { -+ @extend %vw-hide; -+} -+ -+/* Replace the Bitwarden Shield at the top left with a Vaultwarden icon */ -+.bwi-shield:before { -+ content: "" !important; -+ width: 32px !important; -+ height: 40px !important; -+ display: block !important; -+ background-image: url(../images/icon-white.png) !important; -+ background-repeat: no-repeat; -+ background-position-y: bottom; -+} -+/**** END Vaultwarden CHANGES ****/ diff --git a/apps/web/tailwind.config.js b/apps/web/tailwind.config.js index 08673c3f9a..db1dd55694 100644 --- a/apps/web/tailwind.config.js diff --git a/scripts/generate_patch_file.sh b/scripts/generate_patch_file.sh index af71868..c38d292 100755 --- a/scripts/generate_patch_file.sh +++ b/scripts/generate_patch_file.sh @@ -23,12 +23,14 @@ fi PATCH_FILENAME="${VAULT_VERSION}.patch" if [ "$(git status --porcelain | wc -l)" -ge 1 ]; then - git --no-pager diff --no-color --minimal --abbrev=10 -- . \ + git add -A + git --no-pager diff --cached --no-color --minimal --abbrev=10 -- . \ ':!package-lock.json' \ ':!apps/web/src/favicon.ico' \ ':!apps/web/src/images/logo-dark@2x.png' \ ':!apps/web/src/images/logo-white@2x.png' \ ':!apps/web/src/images/icon-white.png' \ + ':!apps/web/src/images/icon-dark.png' \ ':!apps/web/src/images/icons/android-chrome-192x192.png' \ ':!apps/web/src/images/icons/android-chrome-512x512.png' \ ':!apps/web/src/images/icons/apple-touch-icon.png' \ @@ -40,6 +42,7 @@ if [ "$(git status --porcelain | wc -l)" -ge 1 ]; then ':!apps/web/src/app/layouts/password-manager-logo.ts' \ ':!bitwarden_license/' \ > "../patches/${PATCH_FILENAME}" + git reset -q echo "Patch has been created here: patches/${PATCH_FILENAME}" else echo "No changes found, skip generating a patch file."