Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Ajouter des pages Show à React-admin #73

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(admin): created show files
Keksoj committed Jun 3, 2020
commit 8ee9c979fe4d522dba0abd3362c211af0ca0895b
2 changes: 2 additions & 0 deletions apps/admin/src/App.js
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ const App = () => (
}
icon={Organization.icon}
option={Organization.option}
show={Organization.show}
/>,
<Resource
key="job-posting"
@@ -57,6 +58,7 @@ const App = () => (
}
icon={JobPosting.icon}
option={JobPosting.option}
show={Organization.show}
/>,
]}
</Admin>
35 changes: 35 additions & 0 deletions apps/admin/src/job-posting/Show.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import { Show, SimpleShowLayout, TextField, DateField } from 'react-admin';

export const JobPostingShow = (props) => {
return (
<Show title="Vue de l'offre d'emploi" {...props}>
<SimpleShowLayout>
<TextField source="title:%l%" label="Filtre par titre" />
<TextField source="employmentType" label="Type de contrat" />
<TextField
source="hiringOrganizationName:%l%"
label="Nom d'entreprise"
/>
<TextField
source="hiringOrganizationAddressLocality:l%"
label="Ville de l'entreprise"
/>
<TextField
source="hiringOrganizationPostalCode:l%"
label="Code postal de l'entreprise"
/>

<DateField source="datePosted:lte" label="Postée avant le" />
<TextField source="datePosted:gte" label="Postée après le" />
<TextField source="jobStartDate:lte" label="Commence avant" />
<TextField source="jobStartDate:gte" label="Commence après" />
<TextField
source="validThrough_before"
label="Valide jusqu'au"
/>
<TextField source="validThrough:gte" label="Valide après le" />
</SimpleShowLayout>
</Show>
);
};
3 changes: 2 additions & 1 deletion apps/admin/src/job-posting/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import JobPostingIcon from '@material-ui/icons/EventSeat';

import { JobPostingShow } from './Show';
import { JobPostingList } from './List';
import { JobPostingEdit } from './Edit';
import { JobPostingCreate } from './Create';
@@ -16,5 +16,6 @@ export default {
edit: JobPostingEdit,
icon: JobPostingIcon,
list: JobPostingList,
show: JobPostingShow,
options: { label: "Offres d'emploi" },
};
2 changes: 1 addition & 1 deletion apps/admin/src/organization/List.js
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ export const OrganizationList = ({ permissions, ...props }) => {
bulkActionButtons={false}
title="Liste des Entreprises"
>
<Datagrid>
<Datagrid rowClik="show">
<OrganizationLogo label="Logo" />
<TextField source="name" label="Nom de l'entreprise" />
<OrganizationAddress label="Adresse" />
37 changes: 37 additions & 0 deletions apps/admin/src/organization/Show.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';
import { Show, SimpleShowLayout, TextField } from 'react-admin';

// Todo :
// const OrganizationName = ({ record }) => {
// return <span>{record ? `"${record.name}"` : ''}</span>;
// };

export const OrganizationShow = (props) => {
return (
// to add :
// <Show title={<OrganizationName />} {...props}></Show>
<Show title="vue de l'entreprise" {...props}>
<SimpleShowLayout>
{/* todo: LOGO */}
<TextField label="Nom de l'entreprise" source="name" />
<TextField label="Email principal" source="email" />
<TextField label="Url du site web" source="url" />
<TextField label="Présentation" source="description" />
<TextField label="adresse" source="address" />

<TextField
label="Nom du contact des offres d'emploi"
source="contact_name"
/>
<TextField
label="Email du contact des offres d'emploi"
source="contact_email"
/>
<TextField
label="Téléphone du contact des offres d'emploi"
source="contact_phone"
/>
</SimpleShowLayout>
</Show>
);
};
2 changes: 2 additions & 0 deletions apps/admin/src/organization/index.js
Original file line number Diff line number Diff line change
@@ -3,11 +3,13 @@ import OrganizationIcon from '@material-ui/icons/People';
import { OrganizationList } from './List';
import { OrganizationEdit } from './Edit';
import { OrganizationCreate } from './Create';
import { OrganizationShow } from './Show';

export default {
create: OrganizationCreate,
edit: OrganizationEdit,
icon: OrganizationIcon,
list: OrganizationList,
show: OrganizationShow,
options: { label: 'Entreprises' },
};