Skip to content

Commit

Permalink
fix: ghs mix between H and P (#33)
Browse files Browse the repository at this point in the history
* fix: inversion of H and P statements

* feat: update NMRium

* chore: update components/tailwind-ui

* chore: update to use renderTr and renderHeader

* chore: update next

* chore: update next and typescript
  • Loading branch information
lpatiny authored Sep 21, 2022
1 parent 0f30ea0 commit 5187980
Show file tree
Hide file tree
Showing 95 changed files with 4,840 additions and 3,099 deletions.
3,617 changes: 2,141 additions & 1,476 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test": "npm run eslint && npm run prettier && npm run check-types"
},
"dependencies": {
"@headlessui/react": "^1.5.0",
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^2.8.8",
"@lukeed/uuid": "^2.0.0",
Expand All @@ -26,41 +26,40 @@
"clsx": "^1.1.1",
"date-fns": "^2.28.0",
"dialog-polyfill-universal": "^0.1.0",
"formik": "^2.2.9",
"immer": "^9.0.12",
"mime": "^3.0.0",
"next": "^12.1.0",
"nmrium": "^0.23.0",
"openchemlib": "^7.4.3",
"next": "^12.2.5",
"nmrium": "^0.30.0",
"openchemlib": "^8.0.1",
"pubchem": "^0.9.2",
"react": "^17.0.2",
"react": "^18.2.0",
"react-datepicker": "^4.7.0",
"react-dom": "^17.0.2",
"react-dropzone": "^12.0.4",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.2",
"react-error-boundary": "^3.1.4",
"react-hook-form": "^7.28.0",
"react-iframe-bridge": "^0.4.0",
"react-kbs": "^1.0.0",
"react-mf": "^2.0.1",
"react-ocl": "^4.3.5",
"react-ocl": "^5.0.0",
"react-popper": "^2.2.5",
"react-query": "^3.34.16",
"rest-on-couch-client": "^4.3.0"
},
"devDependencies": {
"@types/mime": "^2.0.3",
"@types/node": "^17.0.21",
"@types/react": "^17.0.40",
"@types/react-dom": "^17.0.13",
"@types/react": "^18.0.18",
"@types/react-dom": "^18.0.6",
"@zakodium/components-update": "^1.4.3",
"@zakodium/eslint-config": "^5.1.1",
"@zakodium/tailwind-config": "^3.1.1",
"@zakodium/tailwind-config": "^3.1.2",
"autoprefixer": "^10.4.4",
"eslint": "^8.11.0",
"eslint-config-next": "^12.1.0",
"prettier": "^2.6.0",
"tailwindcss": "^3.0.23",
"typescript": "^4.6.2"
"typescript": "^4.8.2"
},
"volta": {
"node": "16.14.2"
Expand Down
9 changes: 4 additions & 5 deletions src/components/chemistry/pubchem/computed/Computed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export default function Computed(props: { computed: any }) {

return (
<Table
Header={Header}
renderHeader={renderHeader}
data={rows}
Tr={Row}
renderTr={Row}
tableClassName="table-fixed w-1/2"
/>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th className="w-1/4">Label</Th>
Expand All @@ -38,8 +38,7 @@ function Header() {
);
}

function Row(props: any) {
const row = props.value;
function Row(row: any) {
return (
<tr key={row.key}>
<CompactTd>{row.label}</CompactTd>
Expand Down
7 changes: 3 additions & 4 deletions src/components/chemistry/pubchem/experimental/BpTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default function BpTable(props: { data: any }) {
return (
<div>
<div className="pt-5 text-xl">Boiling point</div>
<Table Header={Header} data={data} Tr={Row} />
<Table renderHeader={renderHeader} data={data} renderTr={Row} />
</div>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th>Original value</Th>
Expand All @@ -25,8 +25,7 @@ function Header() {
);
}

function Row(props: any) {
const value = props.value;
function Row(value: any) {
return (
<tr key={value.label}>
<CompactTd>{value.data.original}</CompactTd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default function FlashPointTable(props: { data: any }) {
return (
<div>
<div className="pt-5 text-xl">Flash point</div>
<Table Header={Header} data={data} Tr={Row} />
<Table renderHeader={renderHeader} data={data} renderTr={Row} />
</div>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th>Original value</Th>
Expand All @@ -25,8 +25,7 @@ function Header() {
);
}

function Row(props: any) {
const value = props.value;
function Row(value: any) {
return (
<tr key={value.label}>
<CompactTd>{value.data.original}</CompactTd>
Expand Down
7 changes: 3 additions & 4 deletions src/components/chemistry/pubchem/experimental/MpTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default function MpTable(props: { data: any }) {
return (
<div>
<div className="pt-5 text-xl">Melting point</div>
<Table Header={Header} data={data} Tr={Row} />
<Table renderHeader={renderHeader} data={data} renderTr={Row} />
</div>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th>Original value</Th>
Expand All @@ -25,8 +25,7 @@ function Header() {
);
}

function Row(props: any) {
const value = props.value;
function Row(value: any) {
return (
<tr key={value.label}>
<CompactTd>{value.data.original}</CompactTd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export default function SolubilityTable(props: { data: any }) {
return (
<div>
<div className="pt-5 text-xl">Solubility</div>
<Table Header={Header} data={data} Tr={Row} />
<Table renderHeader={renderHeader} data={data} renderTr={Row} />
</div>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th className="w-3/4">Original value</Th>
Expand All @@ -23,8 +23,7 @@ function Header() {
);
}

function Row(props: any) {
const value = props.value;
function Row(value: any) {
return (
<tr key={value.label}>
<CompactTd>{value.data.original}</CompactTd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export default function VaporPressureTable(props: { data: any }) {
return (
<div>
<div className="pt-5 text-xl">Vapor pressure</div>
<Table Header={Header} data={data} Tr={Row} />
<Table renderHeader={renderHeader} data={data} renderTr={Row} />
</div>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th>Original value</Th>
Expand All @@ -25,8 +25,7 @@ function Header() {
);
}

function Row(props: any) {
const value = props.value;
function Row(value: any) {
return (
<tr key={value.label}>
<CompactTd>{value.data.original}</CompactTd>
Expand Down
4 changes: 2 additions & 2 deletions src/components/chemistry/pubchem/ghs/full/GHSFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export default function GHSFull(props: {
<p className="mt-4 text-3xl">Pictograms</p>
<PictogramsTableFull pictograms={ghsFull.pictograms} />
<p className="mt-4 text-3xl">Hazard Statements</p>
<PStatementsTableFull pStatements={ghsFull.pStatements} />
<PStatementsTableFull pStatements={ghsFull.hStatements} />
<p className="mt-4 text-3xl">Precautionary Statements</p>
<HStatementsTableFull hStatements={ghsFull.hStatements} />
<HStatementsTableFull hStatements={ghsFull.pStatements} />
</div>
);
}
19 changes: 12 additions & 7 deletions src/components/chemistry/pubchem/ghs/summary/HStatementsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CompactTd from '@/components/common/CompactTd';
import { Table, Th } from '@/components/tailwind-ui';

function Header() {
function renderHeader() {
return (
<tr>
<Th>Code</Th>
Expand All @@ -10,12 +10,11 @@ function Header() {
);
}

function Row(props: any) {
const row = props.value;
function Row(value: any) {
return (
<tr key={row.code}>
<CompactTd>{row.code}</CompactTd>
<CompactTd>{row.description}</CompactTd>
<tr key={value.code}>
<CompactTd>{value.code}</CompactTd>
<CompactTd>{value.description}</CompactTd>
</tr>
);
}
Expand All @@ -24,6 +23,12 @@ export default function HStatementsTable(props: any) {
if (!props.hStatements || props.hStatements.length === 0) {
return <>No hazard statements found.</>;
} else {
return <Table Header={Header} data={props.hStatements} Tr={Row} />;
return (
<Table
renderHeader={renderHeader}
data={props.hStatements}
renderTr={Row}
/>
);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CompactTd from '@/components/common/CompactTd';
import { Table, Th } from '@/components/tailwind-ui';

function Header() {
function renderHeader() {
return (
<tr>
<Th>Code</Th>
Expand All @@ -10,8 +10,7 @@ function Header() {
);
}

function Row(props: any) {
const row = props.value;
function Row(row: any) {
return (
<tr key={row.code}>
<CompactTd>{row.code}</CompactTd>
Expand All @@ -24,6 +23,12 @@ export default function PStatementsTable(props: any) {
if (!props.pStatements || props.pStatements.length === 0) {
return <>No precautionary statements found.</>;
} else {
return <Table Header={Header} data={props.pStatements} Tr={Row} />;
return (
<Table
renderHeader={renderHeader}
data={props.pStatements}
renderTr={Row}
/>
);
}
}
13 changes: 9 additions & 4 deletions src/components/chemistry/pubchem/ghs/summary/PictogramsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Table, Th } from '@/components/tailwind-ui';

import Pictogram from '../pictograms/Pictogram';

function Header() {
function renderHeader() {
return (
<tr>
<Th>Code</Th>
Expand All @@ -13,8 +13,7 @@ function Header() {
);
}

function Row(props: any) {
const row = props.value;
function Row(row: any) {
return (
<tr>
<CompactTd>{row.code}</CompactTd>
Expand All @@ -30,6 +29,12 @@ export default function PictogramsTable(props: any) {
if (!props.pictograms || props.pictograms.length < 1) {
return <>No pictograms found.</>;
} else {
return <Table Header={Header} data={props.pictograms} Tr={Row} />;
return (
<Table
renderHeader={renderHeader}
data={props.pictograms}
renderTr={Row}
/>
);
}
}
9 changes: 4 additions & 5 deletions src/components/chemistry/pubchem/identifiers/Identifiers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ export default function Identifiers(props: { identifiers: any; cid: any }) {
}
return (
<Table
Header={Header}
renderHeader={renderHeader}
data={rows}
Tr={Row}
renderTr={Row}
tableClassName="table-fixed w-1/2"
/>
);
}

function Header() {
function renderHeader() {
return (
<tr>
<Th className="w-1/4">Label</Th>
Expand All @@ -73,8 +73,7 @@ function Header() {
);
}

function Row(props: any) {
const row = props.value;
function Row(row: any) {
return (
<tr key={row.key}>
<CompactTd>{row.label}</CompactTd>
Expand Down
10 changes: 2 additions & 8 deletions src/components/nmr/nmr-displayer/NmrDisplayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,8 @@ export default function NmrDisplayer() {
data={{ spectra, molecules }}
preferences={{
general: {},
panels: {
hideSummaryPanel: true,
hideMultipleSpectraAnalysisPanel: true,
},
toolBarButtons: {
hideImport: true,
hideExportAs: true,
},
panels: {},
toolBarButtons: {},
}}
/>
);
Expand Down
Loading

0 comments on commit 5187980

Please sign in to comment.