Skip to content

Commit

Permalink
Merge pull request #101 from virtualidentityag/feat/DIAKONIE-301-name…
Browse files Browse the repository at this point in the history
…-change-info

feat: added text after save of new display name
  • Loading branch information
janrembold authored Apr 29, 2024
2 parents 8b3794f + 9996374 commit a5c8d96
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/components/profile/ConsultantInformation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const ConsultantInformation = () => {
const [isSaveDisabled, setIsSaveDisabled] = useState(false);
const [editedDisplayName, setEditedDisplayName] = useState('');
const [initialDisplayName, setInitialDisplayName] = useState('');
const [showNameChangePropagationInfo, setShowNameChangePropagationInfo] =
useState(false);

const cancelEditButton: ButtonItem = {
label: translate('profile.data.edit.button.cancel'),
Expand All @@ -55,6 +57,7 @@ export const ConsultantInformation = () => {
.then(() => {
reloadUserData().catch(console.log);
setInitialDisplayName(editedDisplayName);
setShowNameChangePropagationInfo(true);
})
.catch((error) => {
addNotification({
Expand Down Expand Up @@ -128,6 +131,17 @@ export const ConsultantInformation = () => {
isDisabled={!isDisplayNameFeatureEnabled || !isEditEnabled}
onValueIsValid={handleValidDisplayName}
/>
{showNameChangePropagationInfo && (
<div className="profile__propagation-info">
<Text
text={translate(
'profile.data.info.nameChangePropagation'
)}
type="standard"
className="tertiary"
/>
</div>
)}
{isDisplayNameFeatureEnabled && isEditEnabled && (
<div className="editableData__buttonSet editableData__buttonSet--edit">
<Button
Expand Down
4 changes: 4 additions & 0 deletions src/components/profile/profile.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ $profile-footer-justify-content: center !default;
}
}

&__propagation-info {
margin-top: $grid-base-two;
}

&__footer {
flex: 0;
display: flex;
Expand Down
3 changes: 2 additions & 1 deletion src/resources/i18n/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,8 @@
"firstName": "Vorname",
"info": {
"private": "Diese Daten können die Ratsuchenden nicht einsehen.",
"public": "Mit dem Anzeigenamen erscheinen Sie bei den Ratsuchenden."
"public": "Mit dem Anzeigenamen erscheinen Sie bei den Ratsuchenden.",
"nameChangePropagation": "Es kann bis zu 15 Minuten dauern, bis die Änderung des Anzeigenamens wirksam wird."
},
"lastName": "Nachname",
"personal": {
Expand Down

0 comments on commit a5c8d96

Please sign in to comment.