Skip to content

Commit

Permalink
Test preview changes
Browse files Browse the repository at this point in the history
Some changes (improvements) to prepare for the upcoming test session.
  • Loading branch information
TomDijkema committed Nov 12, 2024
1 parent 496deee commit 0b20a33
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 53 deletions.
4 changes: 2 additions & 2 deletions src/components/general/breadCrumbs/BreadCrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ const BreadCrumbs = () => {
{/* Bread crumb */}
{breadCrumb.path ?
<Link to={breadCrumb.path}>
<span className={`${searchParams.get('serviceType') === 'referenceCollection' ? 'tc-secondary' : 'tc-primary'} fs-4 fw-lightBold pe-2`}>{breadCrumb.crumb}</span>
<span className={`${searchParams.get('serviceType') === 'referenceCollection' ? 'tc-secondary' : 'tc-primary'} fs-5 fs-lg-4 fw-lightBold pe-2`}>{breadCrumb.crumb}</span>
</Link>
: <span className={`${searchParams.get('serviceType') === 'referenceCollection' ? 'tc-secondary' : 'tc-primary'} fs-4 fw-lightBold pe-2`}>{breadCrumb.crumb}</span>
: <span className={`${searchParams.get('serviceType') === 'referenceCollection' ? 'tc-secondary' : 'tc-primary'} fs-5 fs-lg-4 fw-lightBold pe-2`}>{breadCrumb.crumb}</span>
}
</Col>
))}
Expand Down
11 changes: 10 additions & 1 deletion src/components/general/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Footer = () => {
<p className="fs-5 tc-white">{`CETAF ${currentYear}`}</p>
</Col>
</Row>
<Row className="mt-3">
<Row className="mt-2">
<Col>
<Row className="mt-2 align-items-end">
<Col>
Expand All @@ -42,6 +42,9 @@ const Footer = () => {
<Row>
<Col>
<div className="h-100 fs-5 tc-white fw-lightBold text-end">
<a href="https://marketplace.cetaf.org/cordra/#urls/openapi/index.html">
API Docs
</a>
<p>Privacy policy</p>
</div>
</Col>
Expand All @@ -67,6 +70,12 @@ const Footer = () => {
</Col>
<Col className="col-lg-auto">
<div className="h-100 d-flex align-items-center fs-5 tc-white fw-lightBold">
<span>
<a href="https://marketplace.cetaf.org/cordra/#urls/openapi/index.html">
API Docs
</a>
</span>
<span className="px-2">|</span>
<span>
<a href="https://cetaf.org/privacy/"
target="_blank"
Expand Down
27 changes: 9 additions & 18 deletions src/components/taxonomicService/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { Row, Col } from 'react-bootstrap';
/* Import Types */
import { TaxonomicService } from 'app/Types';

/* Import Components */
import { Button } from 'components/general/CustomComponents';


/* Props Type */
type Props = {
Expand All @@ -25,29 +22,23 @@ const TopBar = (props: Props) => {
return (
<Row>
{taxonomicService.taxonomicService['schema:Service']['schema:logo'] &&
<Col lg={{ span: 1 }}>
<Col lg={{ span: 1 }}
className="d-none d-lg-block"
>
<img src={taxonomicService.taxonomicService['schema:Service']['schema:logo']}
alt={taxonomicService.taxonomicService['schema:Service']['schema:logo']}
className="w-100"
/>
</Col>
}
{/* State and Title */}
<Col xs={{ span: 12 }} lg>
<h1 className="fs-3 fs-lg-2">{taxonomicService.taxonomicService['schema:Service']['schema:name']}</h1>
</Col>
{/* Apply for usage button */}
<Col xs lg="auto"
className="mt-3 mt-lg-0"
>
<Button type="button"
variant="primary"
className="fs-5 fs-lg-4"
disabled={!taxonomicService.taxonomicService['schema:ContactPoint']?.['schema:url']}
OnClick={() => window.open(`https://${taxonomicService.taxonomicService['schema:ContactPoint']?.['schema:url']?.replace('http://', '').replace('https://', '')}`, '_blank', 'noopener')}
<Col xs={{ span: 12 }} lg="auto">
<a href={`https://${taxonomicService.taxonomicService['schema:ContactPoint']?.['schema:url']?.replace('http://', '').replace('https://', '')}`}
target="_blank"
rel="noreferer"
>
Apply for usage
</Button>
<h1 className="fs-3 fs-lg-2 tc-primary-hover">{taxonomicService.taxonomicService['schema:Service']['schema:name']}</h1>
</a>
</Col>
</Row>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ const FormBuilder = (props: Props) => {
[section: string]: {
type: string,
jsonPath: string,
fields: FormField[]
fields: FormField[],
applicableToServiceTypes?: string[]
}
} = {};
const initialFormValues: Dict = {};
Expand Down Expand Up @@ -284,7 +285,7 @@ const FormBuilder = (props: Props) => {
setErrorMessage('Something went wrong during the submission of the Taxonomic Service, please try again');
} finally {
setLoading(false);
}
};
} else {
setErrorMessage('Please provide values for all required fields')
}
Expand All @@ -293,34 +294,38 @@ const FormBuilder = (props: Props) => {
{({ values, setFieldValue }) => (
<Form>
{Object.entries(formSections).map(([title, section]) => (
<Row key={title}>
<Col>
{section.type === 'object' ?
<div className="mt-4">
<p className="fw-lightBold">{`${title}`}</p>

{section.fields.map(field => (
<Row key={field.jsonPath}
className="mt-3 mt-lg-2"
>
<Col>
{ConstructFormField(field, values, setFieldValue, jp.value(values, field.jsonPath))}
</Col>
</Row>
))}
</div>
: <FormBuilderFieldArray section={section}
title={title}
initialFormValues={initialFormValues}
values={values}
formSections={formSections}
FlattenJSONPath={FlattenJSONPath}
SetFieldValue={setFieldValue}
ConstructFormField={ConstructFormField}
/>
}
</Col>
</Row>
<>
{((serviceType && section.applicableToServiceTypes?.includes(serviceType)) || !section.applicableToServiceTypes) &&
<Row key={title}>
<Col>
{section.type === 'object' ?
<div className="mt-4">
<p className="fw-lightBold">{`${title}`}</p>

{section.fields.map(field => (
<Row key={field.jsonPath}
className="mt-3 mt-lg-2"
>
<Col>
{ConstructFormField(field, values, setFieldValue, jp.value(values, field.jsonPath))}
</Col>
</Row>
))}
</div>
: <FormBuilderFieldArray section={section}
title={title}
initialFormValues={initialFormValues}
values={values}
formSections={formSections}
FlattenJSONPath={FlattenJSONPath}
SetFieldValue={setFieldValue}
ConstructFormField={ConstructFormField}
/>
}
</Col>
</Row>
}
</>
))}
<Row className="mt-3">
<Col>
Expand Down
114 changes: 112 additions & 2 deletions src/sources/searchFilters/TaxonomicServiceFilters.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,118 @@
{
"name": "language",
"alias": "schema:availableLanguage",
"type": "string",
"default": ""
"type": "select",
"default": "",
"options": [
{
"label": "Bulgarian",
"value": "bg"
},
{
"label": "Croatian",
"value": "hr"
},
{
"label": "Czech",
"value": "cs"
},
{
"label": "Danish",
"value": "da"
},
{
"label": "Dutch",
"value": "nl"
},
{
"label": "Luxembourgish",
"value": "lb"
},
{
"label": "English",
"value": "en"
},
{
"label": "Estonian",
"value": "es"
},
{
"label": "Finnish",
"value": "fi"
},
{
"label": "French",
"value": "fr"
},
{
"label": "German",
"value": "de"
},
{
"label": "Greek",
"value": "el"
},
{
"label": "Hungarian",
"value": "hu"
},
{
"label": "Irish",
"value": "ga"
},
{
"label": "Italian",
"value": "it"
},
{
"label": "Latvian",
"value": "lv"
},
{
"label": "Lithuanian",
"value": "lt"
},
{
"label": "Maltese",
"value": "mt"
},
{
"label": "Polish",
"value": "pl"
},
{
"label": "Portugese",
"value": "pt"
},
{
"label": "Romanian",
"value": "ro"
},
{
"label": "Russian",
"value": "ru"
},
{
"label": "Slovakian",
"value": "sk"
},
{
"label": "Spanish",
"value": "es"
},
{
"label": "Swedish",
"value": "sv"
},
{
"label": "Turkish",
"value": "tk"
},
{
"label": "Ukranian",
"value": "uk"
}
]
}
]
}

0 comments on commit 0b20a33

Please sign in to comment.