1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-17 09:53:26 +02:00
market/src/components/@shared/FormInput/index.tsx

155 lines
4.1 KiB
TypeScript
Raw Normal View History

import React, {
ChangeEvent,
FormEvent,
KeyboardEvent,
ReactElement,
ReactNode,
useEffect,
useState
} from 'react'
import InputElement from './InputElement'
import Label from './Label'
import styles from './index.module.css'
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
import { ErrorMessage, FieldInputProps, useField } from 'formik'
import classNames from 'classnames/bind'
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
import Disclaimer from './Disclaimer'
2021-10-21 20:58:55 +02:00
import Tooltip from '@shared/atoms/Tooltip'
import Markdown from '@shared/Markdown'
import FormHelp from './Help'
import { AssetSelectionAsset } from '@shared/FormInput/InputElement/AssetSelection'
import { BoxSelectionOption } from '@shared/FormInput/InputElement/BoxSelection'
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
import { getObjectPropertyByPath } from '@utils/index'
const cx = classNames.bind(styles)
export interface InputProps {
name: string
2020-09-21 14:23:04 +02:00
label?: string | ReactNode
placeholder?: string
required?: boolean
help?: string
prominentHelp?: boolean
tag?: string
type?: string
options?: string[] | AssetSelectionAsset[] | BoxSelectionOption[]
Swap tokens (#204) * swap Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * validation and calculation Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * refactor Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove unused effect Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix interval Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * increase refresh timer, remove optional params Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * make inputs show up without wallet * style fixes * restyling * styling * more styling * fix refresh price Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove test effect * fixes, get data as early as possible from DDO and initial state * refactor * refactor * refactor * label tweaks * copy * typo * prototype output * remove price header * ouput swap fee * fix * spacing * copy * refactor pool transaction titles * copy * update math Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * use messaging tweaks * tab tweaks, output refactor * fix dark mode selection style * prototype output * method tweaks * slippage to 1%, added warnig banner Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * form tweaks * error fix * empty inputs by default * longer intervals * maxOcean validation fix * slippage tolerance UI * modified slippage UI * refactor, refresh ocean user balance * move typings/models around * typing fix * fixed output values Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * bump oceanlib Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove console.log * remove placeholder * tweak * non-web3 browser tweak Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2020-11-16 16:21:15 +01:00
sortOptions?: boolean
fields?: FieldInputProps<any>[]
graphql and onchain storage support (#1794) * support storage type publish * adding storageType to edit form * add IPFS type * fix testst and rollback ipfs typing * update oceanjs lib * fix Ipfs type * Update package-lock.json * added graphql and smartcontract options UI (WIP) * update package.json * removed graphql and smartcontracts * make various fixes for edit and publish with IPFS (missing Arweave) * removed no-case-declarations lines * moved ipfs utils * renamed getFileUrlInfo to getFileInfo * added is-ipfs to jest mock * Update package-lock.json * fix things * npm is fun * rename url to file in getFileInfo * refactor publish form (storage type field) * fix tab value when changing tabs * refactoring edit form * more refactor edit form * fix edit validation * fix validation when input is empty on edit form * fix validation when loading asset in edit form * change URL to file confirmed * change messages based on service type * Update form.json * fix FileInput tests and added ipfs / arweave tests * removed unnecessary comment * Update index.tsx * adding graphql / onchain to fieldInput * merged main and fix storages (WIP) * restore graphql / smart contract * added headers to graphql and connect fields * fix tests temp * fix publish preview file object * added codemirror component and change layout * added codemirror to edit and normalizing ddo debug preview * added codemirror to edit form * fix typing issues * style and logic changes to codemirror component * fix test (temp fix) * Avoiding getInitialPaymentCollector failure (#1816) * early return is no web3 or ddo * Creating test for MetaFull * adding test: src/components/Asset/AssetContent/MetaSecondary.test.tsx * Adding test for bookmarks * Adding test for displaying payment collector * Removing comments * Renaming assetAquarius * Renaming assetWithAccessDetails * Ensuring that the payment collector is shown even without a wallet connected * Removing broken test * Using getDummyWeb3 for fetching the payment collector address * WIP * update ocean lib * parse abi obj on publish * fix previewDebugPatch function * Update package-lock.json * remove logs * fix build error * fix stupid typo * upgrade codemirror * simplify checkJson function * fix preview json display * validate json on sm storage * cleanup * fix edit validation * fix initial state tabs storage type * remove logs * fix text headers * google validation (#1835) * Updating validation to exclude any google link * Updating Yup validation * Checking if domain includes google.com * Updating isGoogleUrl function * Moving isGoogleUrl into @utils/url/index file * isGoogleUrl function * Updating tests * Adding additional tests for other google domains * Updating tests * Updating isGoogleUrl file path * upgrade ocean lib * cleanup * edit mode fixes * added tests for graphql and sm * Updating pricing message (#1842) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * updating the buy button message for free assets * Updating pricing text for compute and algorithms * Updating tests * Adding a seperate sentence about paying gas fees for network charges with free assets * Fixing tests Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * Showing hosting type in File Info (#1846) * Bump @storybook/addon-essentials from 6.5.13 to 6.5.15 (#1841) Bumps [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/addons/essentials) from 6.5.13 to 6.5.15. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.15/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.15/addons/essentials) --- updated-dependencies: - dependency-name: "@storybook/addon-essentials" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @types/jest from 29.2.3 to 29.2.5 (#1840) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.2.3 to 29.2.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump prettier from 2.8.0 to 2.8.1 (#1837) Bumps [prettier](https://github.com/prettier/prettier) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-select from 5.6.1 to 5.7.0 (#1839) Bumps [react-select](https://github.com/JedWatson/react-select) from 5.6.1 to 5.7.0. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.6.1...react-select@5.7.0) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump react-tabs from 5.1.0 to 6.0.0 (#1838) Bumps [react-tabs](https://github.com/reactjs/react-tabs) from 5.1.0 to 6.0.0. - [Release notes](https://github.com/reactjs/react-tabs/releases) - [Commits](https://github.com/reactjs/react-tabs/compare/v5.1.0...v6.0.0) --- updated-dependencies: - dependency-name: react-tabs dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix asset route (#1836) * Adding hosting type to the file info component * Writting smart contract hosting type across two lines Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> * add initial price value for not supported price assets (#1851) * Fix compute basetoken issue (#1829) * fix lint * add dynamic provider fees * fixes * cleanup and more fixes * bump oceanlib to 2.6.0 * fix 404 styling (#1850) * cleanup and remove logs * fix smart contract check * restore headers * removed unnecessary message * fix error SM with headers * added headers as object to normalize file * fix input error in url file * adding methods to url storage type * test pipeline (now it's stuck) * cleanup * fix MethodInput test * fix arweave fileObj * Update index.tsx * fix provider url in form test * fixing test errors * fix test * fix help labels * cleanup leftovers * cleanup dependencies codemirror * remove any from normalizeFile * edit comment * remove any from oceanTheme --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Matthias Kretschmann <m@kretschmann.io> Co-authored-by: Jamie Hewitt <jamie@oceanprotocol.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.com>
2023-03-06 11:32:32 +01:00
methods?: boolean
innerFields?: any
additionalComponent?: ReactElement
value?: string | number
onChange?(
e:
| FormEvent<HTMLInputElement>
| ChangeEvent<HTMLInputElement>
| ChangeEvent<HTMLSelectElement>
| ChangeEvent<HTMLTextAreaElement>
): void
onKeyPress?(
e:
| KeyboardEvent<HTMLInputElement>
| KeyboardEvent<HTMLInputElement>
| KeyboardEvent<HTMLSelectElement>
| KeyboardEvent<HTMLTextAreaElement>
): void
rows?: number
multiple?: boolean
pattern?: string
min?: string
2020-09-16 11:57:02 +02:00
max?: string
disabled?: boolean
readOnly?: boolean
2020-10-16 09:36:21 +02:00
field?: FieldInputProps<any>
2020-07-17 15:06:28 +02:00
form?: any
2020-10-06 23:16:08 +02:00
prefix?: string | ReactElement
postfix?: string | ReactElement
step?: string
2020-09-10 12:20:40 +02:00
defaultChecked?: boolean
Swap tokens (#204) * swap Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * validation and calculation Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * refactor Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove unused effect Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * fix interval Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * increase refresh timer, remove optional params Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * make inputs show up without wallet * style fixes * restyling * styling * more styling * fix refresh price Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove test effect * fixes, get data as early as possible from DDO and initial state * refactor * refactor * refactor * label tweaks * copy * typo * prototype output * remove price header * ouput swap fee * fix * spacing * copy * refactor pool transaction titles * copy * update math Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * use messaging tweaks * tab tweaks, output refactor * fix dark mode selection style * prototype output * method tweaks * slippage to 1%, added warnig banner Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * form tweaks * error fix * empty inputs by default * longer intervals * maxOcean validation fix * slippage tolerance UI * modified slippage UI * refactor, refresh ocean user balance * move typings/models around * typing fix * fixed output values Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * bump oceanlib Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * remove console.log * remove placeholder * tweak * non-web3 browser tweak Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2020-11-16 16:21:15 +01:00
size?: 'mini' | 'small' | 'large' | 'default'
Edit compute dataset (#417) * WIP * created form for editing compute privacy * used editComputePrivacy method * select and update trusted algorithm * display and select multiple trusted algorithms * fixed update when trusted algorithm list not changed * code refactoring * moved separator inside condition * moved functions and interface from EditComputeDataset component * moved algorithmOptions to parent component * used AssetSelection to display algorithms * use AssetSelection to select trusted algorithms * getAlgorithmsOptions function review * review fixes * removed unused imports * merge fixes * AssetSelection style & usability tweaks * use custom radio & checkbox styles * add simple search for name & DID * spacing adjustments * copy updates, remove raw algo input, hardcode allowRawAlgorithm * copy * AssetSelection usability tweaks * make rows clickable * tweak layout, style and markup * use formik set function to update values * sorted algorithm list, added checked field * sort assetSelection list on user select * fix getAlgorithmsForAssetSelection breaking on empty responses * form debug output * another empty publisherTrustedAlgorithms fix * created separate algorithms state for the form, sort list on edit * refactor * use Formik functionality wherever possible * unify transforming form data to final data * fix form debug transformation * fix form submit, fix defaultChecked * refactor * use Formik functionality wherever possible * unify transforming form data to final data * fix form debug transformation * fix form submit, fix defaultChecked * disable assetSelection when allowAllAlgorithms is true * added loader to AssetSelection * changed allowAllAlgorithms to allowAllPublishedAlgorithms * fixed lint error * updated transformComputeFormToServiceComputePrivacy * lint fix * modify publish defaults Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2021-03-25 08:34:07 +01:00
className?: string
checked?: boolean
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
disclaimer?: string
disclaimerValues?: string[]
}
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
function checkError(form: any, field: FieldInputProps<any>) {
const touched = getObjectPropertyByPath(form?.touched, field?.name)
const errors = getObjectPropertyByPath(form?.errors, field?.name)
return (
touched &&
errors &&
!field.name.endsWith('.files') &&
!field.name.endsWith('.links') &&
!field.name.endsWith('consumerParameters')
)
}
export default function Input(props: Partial<InputProps>): ReactElement {
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
const {
label,
help,
prominentHelp,
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
additionalComponent,
size,
2021-10-28 17:34:46 +02:00
form,
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
field,
disclaimer,
disclaimerValues
} = props
2021-10-28 17:34:46 +02:00
const isFormikField = typeof field !== 'undefined'
// TODO: this feels hacky as it assumes nested `values` store. But we can't use the
// `useField()` hook in here to get `meta.error` so we have to match against form?.errors?
// handling flat and nested data at same time.
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
const hasFormikError = checkError(form, field)
const styleClasses = cx({
field: true,
2021-10-28 17:34:46 +02:00
hasError: hasFormikError
})
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
const [disclaimerVisible, setDisclaimerVisible] = useState(true)
useEffect(() => {
2021-10-28 17:34:46 +02:00
if (!isFormikField) return
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
if (disclaimer && disclaimerValues) {
setDisclaimerVisible(
2021-10-28 17:34:46 +02:00
disclaimerValues.includes(
Feat: Consumer Parameters (#1921) * feat: add consumer parameters to publish * fix: publish form validation * feat: update consumer parameters form * feat: add consumer parameter types * feat: update consumer parameter validation * feat: add consumer parameters structure * feat: add InputOptions error handling * feat: update consumer parameters validation * feat: update transformPublishFromToDdo * feat: add default options to parameter options * fix: value handling for select and mutliselect * feat: update "add new parameter" button label * feat: remove unused publish form sections * chore: remove console.log * chore: remove comments * feat: remove multiselect * feat: add consumer parameters section label * feat: update types * feat: update edit form fields * feat: parse consumer parameters in edit form * feat: add consumer parameters field to edit * feat: transform consumer parameters values before edit * feat: update "required" type to select * feat: update "required" type to select on edit form * fix: error object access * fix: edit flow crash * fix: validation when consumer parameters are not selected * feat: update validation for default consumer parameters value * fix: types * feat: add service consumer parameters to publish form * chore: remove console.log * feat: add service consumer parameters edit * chore: remove comments * fix: form edit metadata types * feat: add consume algo parameter structure * feat: consumer parameter required default value condition * feat: add consumer parameter groups to assetActions * fix: consumer parameters grouping * feat: update consumer parameters alignment * feat: update types * feat: allow service consumer parameters on dataset asset type * feat: add consumer parameters to ddo updated values in edit form * feat: add "data service" consumer parameters to consumption form * feat: allow service parameters on all asset types * feat: update parameter consume form design * feat: update asset actions consume parameters location * feat: add service parameters to download assets * refactor: consumer parameters actions * refactor: form action name * refactor: consumer parameters default input * refactor: consumer parameters select input * refactor: consumer parameter input * fix: props name * refactor: variable naming * refactor: consumer parameters form validation * refactor: rename consumer parameters types * refactor: extract consumer parameters form data to separate file * refactor: rename type * feat: controlled tabs for consumer params * feat: restore default value as required * refactor: parse values before edit * feat: add form to handle consumer parameters consumption * feat: send consumer params with download request * feat: send consumer params with compute request * feat: handle compute form initialization * chore: remove unused dependency * feat: handle download form data initialization * chore: remove console.log * feat: update types * fix: consumer parameter value types * feat: update ConsumerParameter type * feat: update ConsumerParameter type * chore: add comments * refactor: consumer parameters inputs * refactor: rename data and algo service params * refactor: consumer parameters form * refactor: consumer parameter form styling * refactor: make headers input reusable as KeyValueInput * refactor: refactorings, reduce duplication (WIP) * refactor: usercustomparameters consumption form creation/validation * refactor: return undefined consistently if property path not found on object * refactor: reuse fieldType and fieldOptions in DefaultInput * fix: parse ddo consumer parameters for edit form * fix: asset view crash for assets w/o consumer params * fix: publish preview for assets with no consumer params * fix: revert accidential rename of algoService * fix: revert publish navigation padding change * feat: update consumer parameters' labels and helpers * fix: consumer parameters validation * feat: update consumer parameter helper wording * chore: merge conflicts * feat: update types * fix: validate form on consumer parameter deletion * feat: add key value input placeholder props * fix: handle boolean type consumer parameters in consume form (#38) * Update src/components/Publish/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/Edit/_validation.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Update src/@utils/provider.ts Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * fix: import paths * refactor: add consumer parameters validation types * feat: add string length min/max to consumer parameters validation * feat: add cp description to consume form * feat: reduce character limit in CP tab title * feat: update CP fields' placeholders and helpers * fix: show only relevant CPs in asset actions --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 16:14:27 +02:00
getObjectPropertyByPath(props.form?.values, field?.name)
2021-10-28 17:34:46 +02:00
)
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
)
}
2021-10-28 17:34:46 +02:00
}, [isFormikField, props.form?.values])
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
return (
2021-10-28 17:34:46 +02:00
<div className={styleClasses}>
2021-11-01 15:57:00 +01:00
<Label htmlFor={props.name}>
{label}
{props.required && (
<span title="Required" className={styles.required}>
*
</span>
)}
{help && !prominentHelp && (
<Tooltip content={<Markdown text={help} />} />
)}
</Label>
2020-10-31 00:55:00 +01:00
<InputElement size={size} {...field} {...props} />
{help && prominentHelp && <FormHelp>{help}</FormHelp>}
{field?.name !== 'files' && isFormikField && hasFormikError && (
2020-07-13 14:24:41 +02:00
<div className={styles.error}>
<ErrorMessage name={field.name} />
</div>
)}
GDPR Compliance (#796) * add cookie utils * add gdpr metadata for ppc * add graphql typeDefs for GDPR metadata * add ppc variable to app config * add ppc user preference * add switch component * add ppc components * add cookie consent provider * add consent provider to wrapRootElement * add ppc to app component * add cookie button to footer component * add ppc to site metadata query * add styles for buttons in footer * add switch component unit tests * renewed siteMetadata json for testing * add gdpr metadata for testing * add cookie module unit test * add cookie module tests * add customizable format to time component * add english privacy policy * add privacy policy slugs to user preferences and appConfig * add privacy policy components * add autolink for policy md navigation * only show language select for multiple policies * add gatsby policy page creation * use new privacy slug user preference * add to top button styling for markdown pages * add policies for de, es & fr * add pointer events to toTop buttons css * add privacy policy basic unit test * outsource scroll button component * import cleanup * add customizable delay for debounce * add scroll button unit tests * add disclaimer component * add disclaimer fields as optional fields in PublishJsonData * add acces type disclaimer * adjusted help for desc and author fields * add disclaimer unit tests * minor adjustment to test * add print button to history page * naming changes for better readability * add cookies hash to policies * ppc disabled per default * fix react unknown prop for disclaimer * minor adjustments to cookie utils * add gdpr example file * change exposed gdpr metadata scope by useConsent * update README * readme fixes * emoji fix * added imprint * adjustments to gdpr.json structure and related graphql type * add default values for ppc * Update app.config.js Fixed typo. * change variable name for consistency, remove console logs * readability * adjust css selector order to be consistent * Update fr.md updated policy * Update es.md updated policy * Update en.md updated policy * Update de.md * fix type issue * replace language select input with links * remove scroll button from codebase * change privacy policy route to /privacy * remove Do Not Track detection * add size to checkbox / radio inputs * replace switch component with checkbox inputs * fix plain text links * remove console log * refactor privacy policy pages to use PageMarkdown template * setup useUserPreferences mock for unit tests * unit tests forprivacy policy components * setup discalimer to use alert component * Apply .env suggestions from code review Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * move gdpr example to gdpr.json * adjustments to address .env approach for appConfig.privacyPreferenceCenter * update readme * add small styling option to ppc * update README * add ppc unit tests * update comments * Update README.md Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com> * Merge print into profile history * add inifiniteApproval to UserPreference fixture * changed default styling of PPC to small Co-authored-by: Frederic Schwill <41265505+fr-3deric@users.noreply.github.com> Co-authored-by: MeikeMolitor <88214332+MeikeMolitor@users.noreply.github.com> Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2021-10-12 10:00:57 +02:00
{disclaimer && (
<Disclaimer visible={disclaimerVisible}>{disclaimer}</Disclaimer>
)}
{additionalComponent && additionalComponent}
</div>
)
}