Skip to content

Commit

Permalink
Merge pull request #324 from recogito/develop
Browse files Browse the repository at this point in the history
Merge to main
  • Loading branch information
lwjameson authored Nov 27, 2024
2 parents daf96ad + 5308570 commit 7ff0d2a
Show file tree
Hide file tree
Showing 208 changed files with 7,233 additions and 2,896 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ MAIL_HOST=<your email host>
MAIL_PORT=<your email.port>
MAIL_USERNAME=<your email username>
MAIL_PASSWORD=<your email password>
MAIL_FROM_ADDRESS=<the from address for emails>
MAIL_FROM_ADDRESS=<the from address for emails>

# Define this if you have a help page you would like to
# send users to.
# PUBLIC_HELP_REDIRECT="https://help.example.com"
2,519 changes: 1,430 additions & 1,089 deletions package-lock.json

Large diffs are not rendered by default.

63 changes: 33 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "recogito-client",
"type": "module",
"version": "1.0.0.beta.6",
"version": "1.2.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -14,11 +14,11 @@
"postinstall": "node copy-pdf-worker.js && find plugins -maxdepth 1 -mindepth 1 -type d -exec npm install --prefix {} \\;"
},
"dependencies": {
"@allmaps/iiif-parser": "1.0.0-beta.39",
"@annotorious/react": "3.0.11",
"@astrojs/netlify": "^5.5.3",
"@allmaps/iiif-parser": "1.0.0-beta.40",
"@annotorious/react": "3.0.14",
"@astrojs/netlify": "^5.5.4",
"@astrojs/node": "^8.3.4",
"@astrojs/react": "^3.6.2",
"@astrojs/react": "^3.6.3",
"@phosphor-icons/react": "^2.1.7",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-alert-dialog": "^1.1.2",
Expand All @@ -30,66 +30,69 @@
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@radix-ui/react-tooltip": "^1.1.4",
"@radix-ui/react-visually-hidden": "^1.1.0",
"@react-spring/web": "^9.7.5",
"@recogito/annotorious-supabase": "1.0.3",
"@recogito/pdf-annotator": "1.0.0-rc.36",
"@recogito/react-pdf-annotator": "1.0.0-rc.36",
"@recogito/react-text-annotator": "3.0.0-rc.49",
"@supabase/ssr": "0.5.1",
"@supabase/supabase-js": "2.45.4",
"@recogito/annotorious-supabase": "^1.1.0",
"@recogito/pdf-annotator": "1.0.0-rc.40",
"@recogito/react-pdf-annotator": "1.0.0-rc.40",
"@recogito/react-text-annotator": "3.0.0-rc.53",
"@supabase/ssr": "0.5.2",
"@supabase/supabase-js": "2.46.1",
"@table-library/react-table-library": "^4.1.7",
"@uppy/core": "4.2.1",
"@uppy/xhr-upload": "4.2.0",
"@uppy/core": "4.2.3",
"@uppy/xhr-upload": "4.2.2",
"@usewaypoint/email-builder": "^0.0.8",
"accept-language-parser": "^1.5.0",
"astro": "^4.15.12",
"annotpdf": "^1.0.15",
"astro": "^4.16.15",
"classnames": "^2.5.1",
"confetti-explosion-react": "^0.1.2",
"crypto-js": "4.2.0",
"date-fns": "^4.1.0",
"formik": "2.4.6",
"linkedom": "0.18.5",
"moment": "^2.30.1",
"nodemailer": "^6.9.15",
"nodemailer": "^6.9.16",
"openseadragon": "4.0.0",
"papaparse": "5.4.1",
"quill": "2.0.2",
"quill-delta-to-html": "^0.12.1",
"react": "^18.3.1",
"react-contenteditable": "^3.3.7",
"react-dom": "^18.3.1",
"react-dropzone": "14.2.9",
"react-error-boundary": "^4.0.13",
"react-textarea-autosize": "8.5.3",
"react-dropzone": "14.3.5",
"react-error-boundary": "^4.1.2",
"react-textarea-autosize": "8.5.5",
"react-virtualized-auto-sizer": "1.0.24",
"react-window": "1.8.10",
"sanitize-filename": "^1.6.3",
"slugify": "^1.6.6",
"timeago-react": "3.0.6",
"uuid": "10.0.0"
"uuid": "11.0.3"
},
"devDependencies": {
"@astrojs/ts-plugin": "^1.10.2",
"@astrojs/ts-plugin": "^1.10.4",
"@types/accept-language-parser": "^1.5.6",
"@types/crypto-js": "4.2.2",
"@types/nodemailer": "^6.4.16",
"@types/openseadragon": "3.0.10",
"@types/papaparse": "5.3.14",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@types/papaparse": "5.3.15",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-window": "1.8.8",
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"eslint": "^9.12.0",
"eslint-plugin-react": "^7.37.1",
"typescript": "5.6.2"
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"eslint": "^9.15.0",
"eslint-plugin-react": "^7.37.2",
"typescript": "5.6.3"
}
}
28 changes: 28 additions & 0 deletions src/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ export interface Project {
is_open_join?: boolean;

is_open_edit?: boolean;

is_locked?: boolean;
}

export enum DocumentViewRight {
closed = 'closed',
annotations = 'annotations',
notes = 'notes'
}

export interface ExtendedProjectData {
Expand All @@ -76,13 +84,17 @@ export interface ExtendedProjectData {

is_open_edit?: boolean;

is_locked?: boolean;

contexts: Context[];

groups: Group[];

documents: Document[];

users: Member[];

document_view_right: DocumentViewRight;
}

export interface ProjectDocument {
Expand Down Expand Up @@ -172,6 +184,8 @@ export interface DocumentContext {

is_project_default?: boolean;

project_is_locked?: boolean;

layer_contexts?: any;
}

Expand Down Expand Up @@ -333,6 +347,14 @@ export interface Tag {
tag_definition?: TagDefinition;
}

export interface VocabularyTerm {

label: string;

color?: string;

}

export interface InstalledPlugin {
id: string;

Expand Down Expand Up @@ -434,3 +456,9 @@ export type ApiPostInviteUserToProject = {
projectName: string;
invitedBy: string;
};

export type ApiAcceptOrgInvite = {
email: string;
password: string;
token: string;
};
25 changes: 25 additions & 0 deletions src/apps/accept-org-invite/AcceptOrgInvite.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.accept-org-invite h1 {
margin-top: 0;
}

.accept-org-invite .input-wrapper + .input-wrapper {
margin-left: 0;
margin-top: 1em;
}

.accept-org-invite :is(button, a.button) {
margin-top: 2em;
}

.accept-org-invite .error {
font-size: var(--font-tiny);
color: var(--red-500);
}

.accept-org-invite .success {
text-align: center;
}

.accept-org-invite .success p {
font-size: var(--font-small);
}
134 changes: 134 additions & 0 deletions src/apps/accept-org-invite/AcceptOrgInvite.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import { useState } from 'react';
import { WarningOctagon } from '@phosphor-icons/react';
import { TextInput } from '@components/TextInput';
import type { ApiAcceptOrgInvite, Translations } from 'src/Types';
import { Button } from '@components/Button';
import { supabase } from '@backend/supabaseBrowserClient';
import { AnimatedCheck } from '@components/AnimatedIcons';

import './AcceptOrgInvite.css';

interface AcceptOrgInviteProps {
i18n: Translations;
token: string;
}

export const AcceptOrgInviteComponent = (props: AcceptOrgInviteProps) => {
const { t } = props.i18n;

const [password, setPassword] = useState('');

const [email, setEmail] = useState('');

const [verification, setVerification] = useState('');

const [busy, setBusy] = useState(false);

const [error, setError] = useState('');

const [success, setSuccess] = useState(false);

const onAcceptOrgInvite = (evt: React.MouseEvent) => {
evt.preventDefault();

if (password !== verification) {
setError(t["Passwords don't match"]);
} else {
setBusy(true);

const payload: ApiAcceptOrgInvite = {
email,
password,
token: props.token,
};

console.log(props.token);

fetch('/api/accept-new-user', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
}).then((response) => {
if (!response.ok) {
console.error(response.status);
setError(t['Could not set new password']);
} else {
setSuccess(true);
}
setBusy(false);
});
}
};

return (
<div className='accept-org-invite'>
{success ? (
<main>
<div className='success'>
<AnimatedCheck size={38} />
<p>
{t['Credentials updated.']}{' '}
<a href={`/${props.i18n.lang}/sign-in`}>{t['Login']}</a>
</p>
</div>
</main>
) : (
<main>
<h1>{t['Set Password']}</h1>
<form className='login'>
<TextInput
type='text'
autoComplete={false}
id='email'
name='email'
label={t['Your email address']}
className='lg w-full'
onChange={setEmail}
/>
<TextInput
type='password'
autoComplete={false}
id='password'
name='password'
label={t['Enter new password']}
className='lg w-full'
onChange={setPassword}
/>

<TextInput
type='password'
autoComplete={false}
id='verification'
name='verification'
label={t['Confirm password']}
className='lg w-full'
error={Boolean(error)}
onChange={setVerification}
/>

{error && (
<p className='error'>
<WarningOctagon
className='icon text-bottom'
size={18}
weight='fill'
/>{' '}
{error}
</p>
)}

<Button
busy={busy}
className='primary lg w-full'
onClick={onAcceptOrgInvite}
>
<span>{t['Set Password']}</span>
</Button>
</form>
</main>
)}
</div>
);
};
1 change: 1 addition & 0 deletions src/apps/accept-org-invite/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './AcceptOrgInvite';
Loading

0 comments on commit 7ff0d2a

Please sign in to comment.