Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dasiyui with shadcn/ui #73

Merged
merged 42 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e1353d3
Drop daisyui
sverhoeven Feb 2, 2024
0266ea3
Use Docker volume instead of local dir as pgdata dir
sverhoeven Feb 2, 2024
2927596
Drop daisy colors
sverhoeven Feb 2, 2024
46e19d0
Initialized shadcn/ui + use its components somewhat + make wb readable
sverhoeven Feb 2, 2024
c2fe024
Update navbar + auth routes
sverhoeven Feb 5, 2024
09a4d50
More styling and formatting
sverhoeven Feb 5, 2024
c8b3b57
Remove example pallete + use <Input> on upload route
sverhoeven Feb 5, 2024
2a96303
Format
sverhoeven Feb 5, 2024
3d032e1
Ignore some lint errors in shadcn generated code
sverhoeven Feb 5, 2024
fc41bf9
Make upload required
sverhoeven Feb 5, 2024
b92c3d1
Merge remote-tracking branch 'origin/main' into daisyui2shadcnui
sverhoeven Feb 5, 2024
01d168f
Make report button bigger
sverhoeven Feb 5, 2024
b7b1a20
Use secondary button
sverhoeven Feb 5, 2024
c84ded8
Format
sverhoeven Feb 5, 2024
b5b7c0c
More styling
sverhoeven Feb 7, 2024
435d023
Use local banner image
sverhoeven Feb 7, 2024
158069e
Move edit button before download buttons
sverhoeven Feb 7, 2024
8912fa9
Even more styling
sverhoeven Feb 7, 2024
89921b7
Remove text from banner
sverhoeven Feb 7, 2024
8428466
Started on dark mode
sverhoeven Feb 7, 2024
3fb9b64
Find the light tags
sverhoeven Feb 7, 2024
046c324
Use same primary color regardless of theme
sverhoeven Feb 7, 2024
f08172c
More shadcn + dark compat
sverhoeven Feb 7, 2024
45e235c
System theme does not work yet, disable until remix-themes has support
sverhoeven Feb 7, 2024
e3b2ac3
Use next version of h3 analysis components
sverhoeven Feb 7, 2024
bb581a5
;
sverhoeven Feb 7, 2024
1a9cb05
Format
sverhoeven Feb 7, 2024
a7c18b1
Merge remote-tracking branch 'origin/main' into daisyui2shadcnui
sverhoeven Feb 7, 2024
aacfa3c
Merge remote-tracking branch 'origin/main' into daisyui2shadcnui
sverhoeven Feb 8, 2024
9e6245f
Show tooltip when not logged in on builder submit button
sverhoeven Feb 8, 2024
aab9e01
Less bootstrap classes + active nav links + use css vars
sverhoeven Feb 8, 2024
c74841a
Fix lint
sverhoeven Feb 8, 2024
e9b9af7
No commented out code
sverhoeven Feb 8, 2024
75089d0
Scope builder css
sverhoeven Feb 8, 2024
571df12
Tell user when archive is unreadable
sverhoeven Feb 8, 2024
fd06f9c
Merge pull request #77 from i-VRESSE/bad-zip
sverhoeven Feb 8, 2024
ace7c45
Do not mention ./postgres-data
sverhoeven Feb 8, 2024
3110ccd
Merge remote-tracking branch 'refs/remotes/origin/daisyui2shadcnui' i…
sverhoeven Feb 8, 2024
5e580a4
Unscope buttons
sverhoeven Feb 8, 2024
ab6c82d
Add script to rm db and its volume
sverhoeven Feb 9, 2024
9ed25c0
Give custom error when toml is invalid
sverhoeven Feb 14, 2024
b178da4
Merge branch 'daisyui2shadcnui' of github.com:i-VRESSE/haddock3-webap…
sverhoeven Feb 14, 2024
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
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