Updated d4science theme and d4science.v2 account theme for KC v23.0.0

This commit is contained in:
Vincenzo Cestone 2023-11-28 14:36:05 +01:00
parent 0eaf65d90f
commit 8f2fb9e44e
8 changed files with 65 additions and 31 deletions

View File

@ -107,10 +107,10 @@
var content = <#include "resources/content.json"/> var content = <#include "resources/content.json"/>
</script> </script>
<link rel="stylesheet" type="text/css" href="${resourceCommonUrl}/web_modules/@patternfly/react-core/dist/styles/base.css"/> <link rel="stylesheet" href="${resourceCommonUrl}/node_modules/@patternfly/react-core/dist/styles/base.css"/>
<link rel="stylesheet" type="text/css" href="${resourceCommonUrl}/web_modules/@patternfly/react-core/dist/styles/app.css"/> <link rel="stylesheet" href="${resourceCommonUrl}/node_modules/@patternfly/patternfly/patternfly-addons.css"/>
<link rel="stylesheet" type="text/css" href="${resourceCommonUrl}/web_modules/@patternfly/patternfly/patternfly-addons.css"/> <link rel="stylesheet" href="${resourceUrl}/public/app.css"/>
<link href="${resourceUrl}/public/layout.css" rel="stylesheet"/> <link rel="stylesheet" href="${resourceUrl}/public/layout.css"/>
<#if properties.styles?has_content> <#if properties.styles?has_content>
<#list properties.styles?split(' ') as style> <#list properties.styles?split(' ') as style>

View File

@ -1,18 +1,24 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import * as React from "../../../../common/keycloak/web_modules/react.js"; import * as React from "../../../resources/web_modules/react.js";
import { PageSection, PageSectionVariants, Button, Grid, GridItem, ExpandableSection, Modal } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js"; import { PageSection, PageSectionVariants, Button, Grid, GridItem, ExpandableSection, Modal } from "../../../resources/web_modules/@patternfly/react-core.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js"; import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Msg } from "../../widgets/Msg.js"; import { Msg } from "../../widgets/Msg.js";
import { ContentPage } from "../ContentPage.js"; import { ContentPage } from "../ContentPage.js";
import { ContentAlert } from "../ContentAlert.js"; import { ContentAlert } from "../ContentAlert.js";
import { AvatarForm } from "./AvatarForm.js"; import { AvatarForm } from "./AvatarForm.js";
export class AccountExtraPage extends React.Component { export class AccountExtraPage extends React.Component {
constructor(props) { constructor(props, context) {
super(props); super(props);
_defineProperty(this, "context", void 0); _defineProperty(this, "context", void 0);
_defineProperty(this, "DEFAULT_STATE", {
isModalOpen: false
});
_defineProperty(this, "state", this.DEFAULT_STATE);
_defineProperty(this, "handleModalToggle", open => { _defineProperty(this, "handleModalToggle", open => {
this.setState({ this.setState({
isModalOpen: open isModalOpen: open
@ -31,9 +37,7 @@ export class AccountExtraPage extends React.Component {
}); });
}); });
this.state = { this.context = context;
isModalOpen: false
};
} }
render() { render() {

View File

@ -1,8 +1,8 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import * as React from "../../../../common/keycloak/web_modules/react.js"; import * as React from "../../../resources/web_modules/react.js";
import { Form, FormGroup, ActionGroup, FileUpload, Avatar, Button, Tooltip } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js"; import { Form, FormGroup, ActionGroup, FileUpload, Avatar, Button, Tooltip } from "../../../resources/web_modules/@patternfly/react-core.js";
import { OutlinedQuestionCircleIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js"; import { OutlinedQuestionCircleIcon } from "../../../resources/web_modules/@patternfly/react-icons.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js"; import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { ContentAlert } from "../ContentAlert.js"; import { ContentAlert } from "../ContentAlert.js";
import { Msg } from "../../widgets/Msg.js"; import { Msg } from "../../widgets/Msg.js";
@ -101,7 +101,7 @@ export class AvatarForm extends React.Component {
}; };
var reader = new FileReader(); var reader = new FileReader();
reader.onloadend = function (event) { reader.onloadend = event => {
var imgData = String(event.target.result); var imgData = String(event.target.result);
this.imageScale(imgData, blob => { this.imageScale(imgData, blob => {
this.setState({ this.setState({
@ -109,7 +109,7 @@ export class AvatarForm extends React.Component {
avatarSrc: URL.createObjectURL(blob) avatarSrc: URL.createObjectURL(blob)
}); });
}); });
}.bind(this); };
this.handleFileInputChange = (file, filename) => { this.handleFileInputChange = (file, filename) => {
if (filename != "") { if (filename != "") {

View File

@ -2,12 +2,12 @@ accountManagementTitle=D4Science Account Management
changeAvatarHtmlTitle=Modifica Avatar changeAvatarHtmlTitle=Modifica Avatar
noAvatarSet=Caricare un&#39;immagine (si consiglia una dimensione di 100x100 px, le immagini che eccedono 250x250px saranno ridimensionate a 250px di larchezza o altezza mantenendo il loro rapporto) con Scegli file e premendo quindi su Salva noAvatarSet=Caricare un&#39;immagine (si consiglia una dimensione di 100x100 px, le immagini che eccedono 250x250px saranno ridimensionate a 250px di larchezza o altezza mantenendo il loro rapporto) con Scegli file e premendo quindi su Salva
avatarFileSizeMessage=La massima dimensione consentita del file è di 1MB. avatarFileSizeMessage=La massima dimensione consentita del file è di 1MB.
avatarFileTooBig=Dimensione file eccessiva! avatarFileTooBig=Dimensione file eccessiva!
deleteAccountHtmlTitle=Cancellazione Account deleteAccountHtmlTitle=Cancellazione Account
deleteAccountSubmitButton=Conferma cancellazione account deleteAccountSubmitButton=Conferma cancellazione account
deleteAccountMessage=La cancellazione del proprio account disabiliterà il profilo e rimuoverà il nome e le foto condivise sul/sui gateway D4Science. Alcune informazioni potrebbero risultare ancora visibili agli altri utenti, come il nome nei post e nei messaggi privati inviati. Tutti i file e le cartelle create nel workspace personale saranno rimosse. deleteAccountMessage=La cancellazione del proprio account disabiliterà il profilo e rimuoverà il nome e le foto condivise sul/sui gateway D4Science. Alcune informazioni potrebbero risultare ancora visibili agli altri utenti, come il nome nei post e nei messaggi privati inviati. Tutti i file e le cartelle create nel workspace personale saranno rimosse.
deleteAccountWarningTitle=Attenzione deleteAccountWarningTitle=Attenzione
deleteAccountWarningMessage=Cliccando sul bottone "Conferma cancellazione account" si avvierà un''operazione irreversibile, l''account personale sarà rimosso e saranno terminate tutte le sessioni aperte nei vari siti. deleteAccountWarningMessage=Cliccando sul bottone "Conferma cancellazione account" si avvierà un''operazione irreversibile, l''account personale sarà rimosso e saranno terminate tutte le sessioni aperte nei vari siti.
deleteAccountConfirmDeleteMessage=\\nSi vuole veramente cancellare il proprio account?\\n\\n[NB: Questa azione è irreversible] deleteAccountConfirmDeleteMessage=\\nSi vuole veramente cancellare il proprio account?\\n\\n[NB: Questa azione è irreversible]

View File

@ -1,4 +1,5 @@
<#import "template.ftl" as layout> <#import "template.ftl" as layout>
<#import "register-commons.ftl" as registerCommons>
<@layout.registrationLayout displayMessage=!messagesPerField.existsError('firstName','lastName','email','username','password','password-confirm'); section> <@layout.registrationLayout displayMessage=!messagesPerField.existsError('firstName','lastName','email','username','password','password-confirm'); section>
<#if section = "header"> <#if section = "header">
${msg("registerTitle")} ${msg("registerTitle")}
@ -87,10 +88,18 @@
<label for="password" class="${properties.kcLabelClass!}">${msg("password")}</label> <label for="password" class="${properties.kcLabelClass!}">${msg("password")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="password" id="password" class="${properties.kcInputClass!}" name="password" <div class="${properties.kcInputGroup!}">
autocomplete="new-password" <input type="password" id="password" class="${properties.kcInputClass!}" name="password"
aria-invalid="<#if messagesPerField.existsError('password','password-confirm')>true</#if>" autocomplete="new-password"
/> aria-invalid="<#if messagesPerField.existsError('password','password-confirm')>true</#if>"
/>
<button class="pf-c-button pf-m-control" type="button" aria-label="${msg('showPassword')}"
aria-controls="password" data-password-toggle
data-label-show="${msg('showPassword')}" data-label-hide="${msg('hidePassword')}">
<i class="fa fa-eye" aria-hidden="true"></i>
</button>
</div>
<#if messagesPerField.existsError('password')> <#if messagesPerField.existsError('password')>
<span id="input-error-password" class="${properties.kcInputErrorMessageClass!}" aria-live="polite"> <span id="input-error-password" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
@ -106,10 +115,17 @@
class="${properties.kcLabelClass!}">${msg("passwordConfirm")}</label> class="${properties.kcLabelClass!}">${msg("passwordConfirm")}</label>
</div> </div>
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
<input type="password" id="password-confirm" class="${properties.kcInputClass!}" <div class="${properties.kcInputGroup!}">
name="password-confirm" <input type="password" id="password-confirm" class="${properties.kcInputClass!}"
aria-invalid="<#if messagesPerField.existsError('password-confirm')>true</#if>" name="password-confirm"
/> aria-invalid="<#if messagesPerField.existsError('password-confirm')>true</#if>"
/>
<button class="pf-c-button pf-m-control" type="button" aria-label="${msg('showPassword')}"
aria-controls="password-confirm" data-password-toggle
data-label-show="${msg('showPassword')}" data-label-hide="${msg('hidePassword')}">
<i class="fa fa-eye" aria-hidden="true"></i>
</button>
</div>
<#if messagesPerField.existsError('password-confirm')> <#if messagesPerField.existsError('password-confirm')>
<span id="input-error-password-confirm" class="${properties.kcInputErrorMessageClass!}" aria-live="polite"> <span id="input-error-password-confirm" class="${properties.kcInputErrorMessageClass!}" aria-live="polite">
@ -120,6 +136,8 @@
</div> </div>
</#if> </#if>
<@registerCommons.termsAcceptance/>
<#if recaptchaRequired??> <#if recaptchaRequired??>
<div class="form-group"> <div class="form-group">
<div class="${properties.kcInputWrapperClass!}"> <div class="${properties.kcInputWrapperClass!}">
@ -143,6 +161,7 @@
</div> </div>
</div> </div>
</form> </form>
<script type="module" src="${url.resourcesPath}/js/passwordVisibility.js"></script>
<!-- D4Science username constraints js check --> <!-- D4Science username constraints js check -->
<script type="text/javascript"> <script type="text/javascript">
@ -169,4 +188,4 @@
}) })
</script> </script>
</#if> </#if>
</@layout.registrationLayout> </@layout.registrationLayout>

View File

@ -1,6 +1,6 @@
<#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true displayRequiredFields=false displayWide=false> <#macro registrationLayout bodyClass="" displayInfo=false displayMessage=true displayRequiredFields=false displayWide=false>
<!DOCTYPE html> <!DOCTYPE html>
<html class="${properties.kcHtmlClass!}"> <html class="${properties.kcHtmlClass!}"<#if realm.internationalizationEnabled> lang="${locale.currentLanguageTag}"</#if>>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
@ -35,6 +35,17 @@
<script src="${script}" type="text/javascript"></script> <script src="${script}" type="text/javascript"></script>
</#list> </#list>
</#if> </#if>
<#if authenticationSession??>
<script type="module">
import { checkCookiesAndSetTimer } from "${url.resourcesPath}/js/authChecker.js";
checkCookiesAndSetTimer(
"${authenticationSession.authSessionId}",
"${authenticationSession.tabId}",
"${url.ssoLoginInOtherTabsUrl}"
);
</script>
</#if>
</head> </head>
<!-- D4Science body style overridden to handle bg image custom configs --> <!-- D4Science body style overridden to handle bg image custom configs -->