1
0
Fork 0

feat(backend): No more people, sets instead

This commit is contained in:
joostdecock 2023-02-26 16:11:10 +01:00
parent e691253d51
commit 8519c0fc52
5 changed files with 66 additions and 15 deletions

View file

@ -91,7 +91,7 @@ export const ConsentSettings = ({ app, title = false }) => {
)
const partB = (
<>
<h5 className="mt-8">{t('peopleQuestion')}</h5>
<h5 className="mt-8">{t('setQuestion')}</h5>
<GdprMeasurementsDetails />
{measurements ? (
<Checkbox value={measurements} setter={setMeasurements} label={t('yesIDo')} />

View file

@ -48,7 +48,7 @@ export const AccountLinks = ({ account }) => {
{t('newPattern')}
</Link>
<div className="flex flex-row gap-2">
<Link className="btn btn-secondary grow capitalize" href="/create">
<Link className="btn btn-secondary grow capitalize" href="/account/sets">
{t('newSet')}
</Link>
<Link className="btn btn-warning btnoutline mb-2 capitalize" href="/logout">

View file

@ -32,18 +32,15 @@ export const GdprMeasurementsDetails = () => {
return (
<div className="border-l-4 ml-1 pl-4 my-2 opacity-80">
<h6>{t('peopleWhatQuestion')}</h6>
<h6>{t('setWhatQuestion')}</h6>
<p
dangerouslySetInnerHTML={{
__html:
t('peopleWhatAnswer') +
'<br /><em><small>' +
t('peopleWhatAnswerOptional') +
'</small></em>',
t('setWhatAnswer') + '<br /><em><small>' + t('setWhatAnswerOptional') + '</small></em>',
}}
/>
<h6>{t('whyQuestion')}</h6>
<p dangerouslySetInnerHTML={{ __html: t('peopleWhyAnswer') }} />
<p dangerouslySetInnerHTML={{ __html: t('setWhyAnswer') }} />
<h6>{t('timingQuestion')}</h6>
<p dangerouslySetInnerHTML={{ __html: t('profileTimingAnswer') }} />
<h6>{t('shareQuestion')}</h6>

View file

@ -3,7 +3,7 @@ createLimitedAccount: Create account with limited consent
createAccount: Create account
compliant: "FreeSewing respects your privacy and your rights. We adhere to the toughest privacy and security law in the world: the General Data Protection Regulation (GDPR) of the European Union (EU)."
consent: Consent
consentForPeopleData: Consent for people data
consentForSetData: Consent for measurement data
consentForProfileData: Consent for profile data
consentGiven: Consent given
consentNotGiven: Consent not given
@ -16,12 +16,12 @@ noConsentNoPatterns: Without this consent, you cannot create any made-to-measure
noIDoNot: 'No, I do not'
openDataInfo: This data is used to study and understand the human form in all its shapes, so we can get better sewing patterns, and better fitting garments. Even though this data is anonymized, you have the right to object to this.
openDataQuestion: Share anonymized measurements as open data
peopleQuestion: Do you give your consent to process your people data?
peopleWarning: Revoking this consent will lock you out of all your people data, as well as disable functionality that depends on it.
peopleWhatAnswer: For each person their <b>measurements</b>.
peopleWhatAnswerOptional: 'Optional: A <b>picture</b> and the <b>name</b> that you give a person.'
peopleWhatQuestion: What is people data?
peopleWhyAnswer: 'To draft <b>made-to-measure sewing patterns</b>, we need <b>body measurements</b>.'
setQuestion: Do you give your consent to process your measurements data?
setWarning: Revoking this consent will lock you out of all your measurements data, as well as disable functionality that depends on it.
setWhatAnswer: For each measurements set the <b>measurements</b>.
setWhatAnswerOptional: 'Optional: A <b>picture</b> and the <b>name</b> or <b>notes</b> that you add to a measurements set.'
setWhatQuestion: What is measurements data?
setWhyAnswer: 'To draft <b>made-to-measure sewing patterns</b>, we need <b>body measurements</b>.'
privacyMatters: Privacy matters
privacyNotice: FreeSewing Privacy Notice
processing: Processing

View file

@ -0,0 +1,54 @@
// Hooks
import { useApp } from 'site/hooks/useApp.mjs'
import { useTranslation } from 'next-i18next'
// Dependencies
import dynamic from 'next/dynamic'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
// Components
import { PageWrapper, ns as pageNs } from 'site/components/wrappers/page.mjs'
import { ns as authNs } from 'site/components/wrappers/auth/index.mjs'
import { ns as apikeysNs } from 'site/components/account/apikeys.mjs'
// Translation namespaces used on this page
const namespaces = [...new Set([...apikeysNs, ...authNs, ...pageNs])]
/*
* Some things should never generated as SSR
* So for these, we run a dynamic import and disable SSR rendering
*/
const DynamicAuthWrapper = dynamic(
() => import('site/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
{ ssr: false }
)
const DynamicApikeys = dynamic(
() => import('site/components/account/apikeys.mjs').then((mod) => mod.Apikeys),
{ ssr: false }
)
const AccountPage = (props) => {
const app = useApp(props)
const { t } = useTranslation(namespaces)
const crumbs = [
[t('yourAccount'), '/account'],
[t('apikeys'), '/account/apikeys'],
]
return (
<PageWrapper app={app} title={t('apikeys')} crumbs={crumbs}>
<DynamicAuthWrapper app={app}>
<DynamicApikeys app={app} />
</DynamicAuthWrapper>
</PageWrapper>
)
}
export default AccountPage
export async function getStaticProps({ locale }) {
return {
props: {
...(await serverSideTranslations(locale, namespaces)),
},
}
}