From f62928d784307a3414770a20f196dace2585a182 Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Thu, 18 Apr 2024 10:02:26 +0200 Subject: [PATCH] fix(theme): fix password update theme --- .../login/resources/css/Main.css | 11 +- .../catenax-shared/login/resources/js/Main.js | 4 +- .../login/resources/js/passwordVisibility.js | 20 +++ .../catenax-shared/login/test-update-2.html | 128 ++++++++++++++++++ 4 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 import/keycloak-themes/catenax-shared/login/resources/js/passwordVisibility.js create mode 100644 import/keycloak-themes/catenax-shared/login/test-update-2.html diff --git a/import/keycloak-themes/catenax-shared/login/resources/css/Main.css b/import/keycloak-themes/catenax-shared/login/resources/css/Main.css index 8a5a8d13..51a2aa64 100644 --- a/import/keycloak-themes/catenax-shared/login/resources/css/Main.css +++ b/import/keycloak-themes/catenax-shared/login/resources/css/Main.css @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -189,6 +189,15 @@ form a { padding: 16px 0 0 0; } +button[aria-controls="password-new"], +button[aria-controls="password-confirm"] { + display: none; +} + +#logout-sessions { + width: 20px; +} + .password-policy-hint { text-align: left; line-height: 20px; diff --git a/import/keycloak-themes/catenax-shared/login/resources/js/Main.js b/import/keycloak-themes/catenax-shared/login/resources/js/Main.js index bac950f6..7b7bc4f0 100644 --- a/import/keycloak-themes/catenax-shared/login/resources/js/Main.js +++ b/import/keycloak-themes/catenax-shared/login/resources/js/Main.js @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -374,7 +374,7 @@ class FormUpdate extends Form { } this.button = document.querySelectorAll('input[type=submit]')[0] this.button.setAttribute('disabled', '') - State.getInstance().setUsername(document.getElementById('username').value) + State.getInstance().setUsername(document.getElementById('username')?.value ?? '') Validator.getInstance() return this } diff --git a/import/keycloak-themes/catenax-shared/login/resources/js/passwordVisibility.js b/import/keycloak-themes/catenax-shared/login/resources/js/passwordVisibility.js new file mode 100644 index 00000000..160df1c7 --- /dev/null +++ b/import/keycloak-themes/catenax-shared/login/resources/js/passwordVisibility.js @@ -0,0 +1,20 @@ +/******************************************************************************** + * Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +// intentionally empty to prevent loading 404 error diff --git a/import/keycloak-themes/catenax-shared/login/test-update-2.html b/import/keycloak-themes/catenax-shared/login/test-update-2.html new file mode 100644 index 00000000..18f7baae --- /dev/null +++ b/import/keycloak-themes/catenax-shared/login/test-update-2.html @@ -0,0 +1,128 @@ + + + + + + + + + + Sign in to Martins Company 2 + + + + + +
+
+
Martins Company 2
+
+
+
+

Update password +

+
+
+
+ +
+
+ + + + +
+ You need to change your password to activate your account. +
+ +
+
+
+ +
+
+
+ + +
+ +
+
+ +
+
+ +
+
+
+ + +
+ + +
+
+ +
+
+
+
+ +
+
+
+ +
+ +
+
+
+ + + + +
+
+ +
+
+ +