Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added text after save of new display name #101

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading