-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(procedures): implemented gdpr form
ref:MANAGER-15317 Signed-off-by: Omar ALKABOUSS MOUSSANA <[email protected]>
- Loading branch information
Omar ALKABOUSS MOUSSANA
committed
Oct 14, 2024
1 parent
d2bff99
commit 0d3f6cb
Showing
15 changed files
with
760 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
packages/manager/apps/procedures/src/components/Select/Select.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { | ||
ODS_INPUT_TYPE, | ||
OdsInputValueChangeEventDetail, | ||
OdsSelectValueChangeEventDetail, | ||
OsdsInputCustomEvent, | ||
OsdsSelectCustomEvent, | ||
} from '@ovhcloud/ods-components'; | ||
import { | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_LEVEL, | ||
} from '@ovhcloud/ods-common-theming'; | ||
import { | ||
OsdsFormField, | ||
OsdsSelect, | ||
OsdsSelectOption, | ||
OsdsText, | ||
} from '@ovhcloud/ods-components/react'; | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
export type SelectOption = { | ||
label: string; | ||
value: string; | ||
}; | ||
|
||
type Props = { | ||
label?: string; | ||
value?: string; | ||
onChange?: ( | ||
event: OsdsSelectCustomEvent<OdsSelectValueChangeEventDetail>, | ||
) => void; | ||
onBlur?: React.FocusEventHandler<HTMLOsdsSelectElement>; | ||
name: string; | ||
id: string; | ||
error?: string; | ||
required?: boolean; | ||
placeholder?: string; | ||
options: SelectOption[]; | ||
}; | ||
|
||
export const Select: FunctionComponent<Props> = ({ | ||
label, | ||
error, | ||
id, | ||
onChange, | ||
name, | ||
value, | ||
onBlur, | ||
required, | ||
placeholder, | ||
options, | ||
}) => { | ||
return ( | ||
<OsdsFormField error={error}> | ||
{label && ( | ||
<label htmlFor={id} slot="label"> | ||
<OsdsText | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.heading} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
> | ||
{label}: | ||
</OsdsText> | ||
</label> | ||
)} | ||
|
||
<OsdsSelect | ||
onOdsValueChange={onChange} | ||
onBlur={onBlur} | ||
value={value} | ||
name={name} | ||
required={required} | ||
id={id} | ||
inline | ||
> | ||
{placeholder && <span slot="placeholder">{placeholder}</span>} | ||
{options.map((option, index) => ( | ||
<OsdsSelectOption value={option.value} key={index}> | ||
{option.label} | ||
</OsdsSelectOption> | ||
))} | ||
</OsdsSelect> | ||
</OsdsFormField> | ||
); | ||
}; |
62 changes: 62 additions & 0 deletions
62
packages/manager/apps/procedures/src/components/TextArea/TextArea.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { | ||
OdsTextAreaValueChangeEvent, | ||
OsdsTextareaCustomEvent, | ||
} from '@ovhcloud/ods-components'; | ||
import { | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_LEVEL, | ||
} from '@ovhcloud/ods-common-theming'; | ||
import { | ||
OsdsFormField, | ||
OsdsText, | ||
OsdsTextarea, | ||
} from '@ovhcloud/ods-components/react'; | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
type Props = { | ||
label?: string; | ||
value?: string; | ||
onChange?: ( | ||
event: OsdsTextareaCustomEvent<OdsTextAreaValueChangeEvent>, | ||
) => void; | ||
onBlur?: (event: OsdsTextareaCustomEvent<void>) => void; | ||
name: string; | ||
id: string; | ||
error?: string; | ||
required?: boolean; | ||
}; | ||
|
||
export const TextArea: FunctionComponent<Props> = ({ | ||
label, | ||
error, | ||
id, | ||
onChange, | ||
name, | ||
value, | ||
onBlur, | ||
required, | ||
}) => { | ||
return ( | ||
<OsdsFormField error={error}> | ||
{label && ( | ||
<label htmlFor={id} slot="label"> | ||
<OsdsText | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.heading} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
> | ||
{label}: | ||
</OsdsText> | ||
</label> | ||
)} | ||
<OsdsTextarea | ||
onOdsValueChange={onChange} | ||
required={required} | ||
name={name} | ||
onOdsBlur={onBlur} | ||
id={id} | ||
value={value} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
/> | ||
</OsdsFormField> | ||
); | ||
}; |
67 changes: 67 additions & 0 deletions
67
packages/manager/apps/procedures/src/components/TextInput/TextInput.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { | ||
ODS_INPUT_TYPE, | ||
OdsInputValueChangeEventDetail, | ||
OsdsInputCustomEvent, | ||
} from '@ovhcloud/ods-components'; | ||
import { | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_LEVEL, | ||
} from '@ovhcloud/ods-common-theming'; | ||
import { | ||
OsdsFormField, | ||
OsdsInput, | ||
OsdsText, | ||
} from '@ovhcloud/ods-components/react'; | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
type Props = { | ||
label?: string; | ||
value?: string; | ||
onChange?: ( | ||
event: OsdsInputCustomEvent<OdsInputValueChangeEventDetail>, | ||
) => void; | ||
onBlur?: (event: OsdsInputCustomEvent<void>) => void; | ||
name: string; | ||
id: string; | ||
error?: string; | ||
required?: boolean; | ||
helper?: string; | ||
}; | ||
|
||
export const TextInput: FunctionComponent<Props> = ({ | ||
label, | ||
error, | ||
id, | ||
onChange, | ||
name, | ||
value, | ||
onBlur, | ||
required, | ||
helper, | ||
}) => { | ||
return ( | ||
<OsdsFormField error={error}> | ||
{label && ( | ||
<label htmlFor={id} slot="label"> | ||
<OsdsText | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.heading} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
> | ||
{label}: | ||
</OsdsText> | ||
</label> | ||
)} | ||
<OsdsInput | ||
onOdsValueChange={onChange} | ||
required={required} | ||
name={name} | ||
onOdsInputBlur={onBlur} | ||
id={id} | ||
value={value} | ||
type={ODS_INPUT_TYPE.text} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
/> | ||
{helper && <OsdsText slot="helper">{helper}</OsdsText>} | ||
</OsdsFormField> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/manager/apps/procedures/src/pages/rgdp/RGDP.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import React from 'react'; | ||
import { PageLayout } from '@/components/PageLayout/PageLayout.component'; | ||
import { RGDPIntroduction } from './rgdpIntroduction/RGDPIntroduction.component'; | ||
import { RGDPForm } from './rgdpForm/RGDPForm.component'; | ||
|
||
export default function RGDP() { | ||
return ( | ||
<PageLayout> | ||
<RGDPIntroduction /> | ||
<RGDPForm /> | ||
</PageLayout> | ||
); | ||
} |
Oops, something went wrong.