Skip to content

Commit

Permalink
feat: added extensions sozialplattform
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi committed Jan 27, 2024
1 parent ad9e198 commit 817011f
Show file tree
Hide file tree
Showing 52 changed files with 1,893 additions and 25 deletions.
Binary file removed public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { setValueInCookie } from '../../../components/sessionCookie/accessSessionCookie';
import { AgencyDataInterface } from '../../../globalState';
import * as React from 'react';
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import './formAccordionRegistrationText.styles';

interface FormAccordionRegistrationTextProps {
agency: AgencyDataInterface;
}

export const FormAccordionRegistrationText = (
props: FormAccordionRegistrationTextProps
) => {
const { t: translate } = useTranslation();

useEffect(() => {
props?.agency?.tenantId &&
setValueInCookie(
'tenantId',
props?.agency?.tenantId?.toString() || '0'
);
}, [props.agency]);

return (
<p>
{translate('registration.tsys.prefix')}
<span>
<button
type="button"
className="button-as-link-registration"
onClick={() =>
window.open(`${window.location.origin}/datenschutz`)
}
>
{translate('registration.tsys.button')}
</button>
</span>
{translate('registration.tsys.sufix')}
</p>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.button-as-link-registration {
border: none;
background: none;
padding: 0;

color: $link-color;
text-decoration: $link-text-decoration;
font-weight: $link-font-weight;

&:hover {
color: $link-color-hover;
text-decoration: $link-text-decoration-hover;
cursor: pointer;
}

&:focus {
outline: $focus-outline;
outline-offset: 4px;
border-radius: 4px;
}

&:focus:not(:focus-visible) {
outline: none;
}
}

.registrationForm__dataProtection {
.checkbox__wrapper {
justify-content: start;
}
}
17 changes: 17 additions & 0 deletions src/extensions/components/legalInformationLinks/Imprint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from 'react';
import { useTenant } from '../../../../';
import { LegalPageWrapper } from '../legalPageWrapper/LegalPageWrapper';
import useDocumentTitle from '../../utils/useDocumentTitle';
import { useTranslation } from 'react-i18next';

export const Imprint = () => {
const [t] = useTranslation();
const tenant = useTenant();
useDocumentTitle(t('profile.footer.imprint'));
return (
<LegalPageWrapper
content={tenant?.content?.impressum || t('profile.footer.imprint')}
className={'terms'}
/>
);
};
24 changes: 24 additions & 0 deletions src/extensions/components/legalInformationLinks/Privacy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as React from 'react';
import { useTenant } from '../../../../';
import useUrlParamsLoader from '../../../utils/useUrlParamsLoader';
import { LegalPageWrapper } from '../legalPageWrapper/LegalPageWrapper';
import useDocumentTitle from '../../utils/useDocumentTitle';
import { useTranslation } from 'react-i18next';

export const Privacy = () => {
const [t] = useTranslation();
const tenant = useTenant();
const { agency } = useUrlParamsLoader();
useDocumentTitle(t('profile.footer.dataprotection'));

return (
<LegalPageWrapper
content={
agency?.agencySpecificPrivacy ||
tenant?.content?.renderedPrivacy ||
t('profile.footer.dataprotection')
}
className={'terms'}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as React from 'react';
import { useTenant } from '../../../../';

import { LegalPageWrapper } from '../legalPageWrapper/LegalPageWrapper';
import useDocumentTitle from '../../utils/useDocumentTitle';
import { useTranslation } from 'react-i18next';

export const TermsAndConditions = () => {
const [t] = useTranslation();
const tenant = useTenant();
useDocumentTitle(t('legal.termsAndConditions.label'));

return (
<LegalPageWrapper
content={
tenant?.content?.termsAndConditions ||
t('legal.termsAndConditions.label')
}
className="terms"
/>
);
};
26 changes: 26 additions & 0 deletions src/extensions/components/legalPageWrapper/LegalPageWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import clsx from 'clsx';
import * as React from 'react';

import { Stage } from '../stage/stage';
import htmlParser from '../../resources/scripts/util/htmlParser';
import './legalPageWrapper.styles.scss';

export interface LegalPageWrapperProps {
className?: string;
content: string;
}
export const LegalPageWrapper = ({
className,
content
}: LegalPageWrapperProps) => {
return (
<div className={clsx('legalPageWrapper stageLayout', className)}>
<Stage className="stageLayout__stage" />
<div className={clsx('stageLayout__content', className)}>
<section className="template">
{typeof content === 'string' && htmlParser(content)}
</section>
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.legalPageWrapper {
@include breakpoint($fromLarge) {
.stage {
display: flex;
}
}

.template {
h2 + p,
h3 + p,
h4 + p {
margin-top: 0.3rem;
}
ol {
counter-reset: item;
li {
display: block;
}

li::before {
content: counters(item, '.') '. ';
counter-increment: item;
font-weight: bold;
}

ol {
counter-reset: item;
}
}
}

.stageLayout__content {
align-items: flex-start;
justify-content: flex-start;
padding-top: 120px;

@include breakpoint($fromLarge) {
width: calc(60vw - 160px);
left: calc(40vw + 80px);
}
}
}
61 changes: 61 additions & 0 deletions src/extensions/components/profile/profileSettings.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import {
hasUserAuthority,
AUTHORITIES,
AppConfigInterface
} from '../../../../';
import { PasswordReset } from '../../../components/passwordReset/PasswordReset';
import { ConsultantNotifications } from '../../../components/profile/ConsultantNotifications';
import { DeleteAccount } from '../../../components/profile/DeleteAccount';
import { TwoFactorAuth } from '../../../components/twoFactorAuth/TwoFactorAuth';
import {
TabGroups,
SingleComponentType,
COLUMN_LEFT,
COLUMN_RIGHT
} from '../../../utils/tabsHelper';

export const profileRoutesSettings = (
_selectableLocales: string[],
settings: AppConfigInterface
): (TabGroups | SingleComponentType)[] => [
{
title: 'profile.routes.settings.security.title',
url: '/sicherheit',
elements: [
{
component: PasswordReset,
column: COLUMN_LEFT,
order: 1
},
{
condition: (userData) => userData.twoFactorAuth?.isEnabled,
component: TwoFactorAuth,
column: COLUMN_LEFT
}
]
},
{
title: 'profile.routes.notifications.title',
url: '/email',
elements: [
{
condition: (userData) =>
hasUserAuthority(
AUTHORITIES.CONSULTANT_DEFAULT,
userData
) && !settings?.releaseToggles?.enableNewNotifications,
component: ConsultantNotifications,
column: COLUMN_RIGHT,
order: 1
}
]
},
{
condition: (userData) =>
hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData),
component: DeleteAccount,
boxed: false,
order: 99,
fullWidth: true
}
];
Binary file added src/extensions/components/stage/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 817011f

Please sign in to comment.