Skip to content

Commit

Permalink
Merge pull request #73 from i-VRESSE/daisyui2shadcnui
Browse files Browse the repository at this point in the history
Replace dasiyui with shadcn/ui
  • Loading branch information
sverhoeven authored Feb 14, 2024
2 parents 3d046f3 + b178da4 commit ed1f371
Show file tree
Hide file tree
Showing 63 changed files with 2,914 additions and 821 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/postgres-data
/node_modules
/public/build
.git
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,14 @@ module.exports = {
node: true,
},
},

// Shadcn-ui
{
files: ["**/components/ui/*.tsx"],
rules: {
"react/prop-types": "off",
"jsx-a11y/heading-has-content": "off",
},
},
],
};
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ node_modules
/public_key.pem

Caddyfile

postgres-data
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ node_modules

/cypress/screenshots
/cypress/videos
/postgres-data

/app/styles/tailwind.css
/coverage
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ You need to have a PostgreSQL database running. The easiest way is to use Docker
npm run docker:dev
```

(Stores data in `./postgres-data`)
(Stores data in a Docker volume)
(You can get a psql shell with `npm run psql:dev`)
(On CTRL-C the database is stopped. To remove container use `docker system prune`)
(On CTRL-C the database is stopped. To remove container and volume use `npm run docker:devrm`)

The database can be initialized with

Expand Down
62 changes: 31 additions & 31 deletions app/admin/UserTableRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { User } from "~/models/user.server";
import type { ExpertiseLevel } from "@prisma/client";
import { TableCell, TableRow } from "~/components/ui/table";
import { Checkbox } from "~/components/ui/checkbox";
import { Label } from "~/components/ui/label";

interface IProps {
user: User;
Expand All @@ -16,13 +19,11 @@ export const UserTableRow = ({
}: IProps) => {
const usersExpertiseLevels = user.expertiseLevels;
return (
<tr>
<td>{user.email}</td>
<td>
<input
type="checkbox"
<TableRow>
<TableCell>{user.email}</TableCell>
<TableCell>
<Checkbox
checked={user.isAdmin}
className="checkbox"
disabled={submitting}
onChange={() => {
if (window.confirm("Are you sure?") === false) {
Expand All @@ -33,38 +34,37 @@ export const UserTableRow = ({
onUpdate(data);
}}
/>
</td>
<td>
<ul className="flex">
</TableCell>
<TableCell>
<ul className="flex space-x-4">
{expertiseLevels.map((expertiseLevel) => {
return (
<li key={expertiseLevel}>
<div className="form-control">
<label className="label cursor-pointer">
<span className="label-text">{expertiseLevel}</span>
<input
type="checkbox"
checked={usersExpertiseLevels.includes(expertiseLevel)}
className="checkbox ml-2"
disabled={submitting}
onChange={() => {
const data = new FormData();
data.set(
expertiseLevel,
usersExpertiseLevels.includes(expertiseLevel)
? "false"
: "true"
);
onUpdate(data);
}}
/>
</label>
<div className="flex items-center space-x-1">
<Checkbox
checked={usersExpertiseLevels.includes(expertiseLevel)}
disabled={submitting}
id={`${user.id}-${expertiseLevel}`}
onCheckedChange={() => {
const data = new FormData();
data.set(
expertiseLevel,
usersExpertiseLevels.includes(expertiseLevel)
? "false"
: "true"
);
onUpdate(data);
}}
/>
<Label htmlFor={`${user.id}-${expertiseLevel}`}>
{expertiseLevel}
</Label>
</div>
</li>
);
})}
</ul>
</td>
</tr>
</TableCell>
</TableRow>
);
};
2 changes: 2 additions & 0 deletions app/browse/OutputReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const OutputReport = ({
<Link
title="Recluster"
to={`/jobs/${jobid}/analysis/contactmap/${module.id}`}
className="dark:invert"
>
&#128202;
</Link>
Expand All @@ -87,6 +88,7 @@ export const OutputReport = ({
target="_blank"
rel="noreferrer"
href={`/jobs/${jobid}/files/${module.report.path}`}
className="dark:invert"
>
&#128202;
</a>
Expand Down
5 changes: 3 additions & 2 deletions app/builder/DownloadButton.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useWorkflow } from "@i-vresse/wb-core/dist/store";
import { Button } from "~/components/ui/button";

export const WorkflowDownloadButton = (): JSX.Element => {
const { save } = useWorkflow();

return (
<button className="btn-light btn" onClick={save}>
<Button variant="secondary" onClick={save}>
Download archive
</button>
</Button>
);
};
4 changes: 2 additions & 2 deletions app/builder/Form.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const App = () => {
}, [archive, activetCatalog]); // eslint-disable-line react-hooks/exhaustive-deps

return (
<div>
<div className="workflow-builder-app">
<div className="page grid h-full w-full gap-2 p-4">
<div>
<CatalogPanel></CatalogPanel>
Expand All @@ -51,7 +51,7 @@ const App = () => {
</div>
<div className="page sticky inset-x-0 bottom-0 grid h-14">
<div></div>
<div role="group" className="btn-group">
<div role="group" className="flex flex-row">
<WorkflowSubmitButton submitAllowed={submitAllowed} />
<WorkflowDownloadButton />
</div>
Expand Down
Loading

0 comments on commit ed1f371

Please sign in to comment.