Skip to content

Commit

Permalink
Merge pull request #772 from digirati-co-uk/feature/FAC-preparation
Browse files Browse the repository at this point in the history
v2.2.0
  • Loading branch information
stephenwf authored Nov 17, 2023
2 parents 68b0a5f + 12f0f7b commit 08c6840
Show file tree
Hide file tree
Showing 478 changed files with 11,623 additions and 2,305 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SMTP_USER=project.1
SMTP_PASSWORD=secret.1

MAIL_FROM_USER="Madoc local <[email protected]>"
MADOC_INSTALLATION_CODE='$2b$14$eofdZp3nY.HyK68a9zCfoOs3fuphxHRAR/KhckFm.8Qi8sEmgMcCK'
MADOC_INSTALLATION_CODE='$2b$14$9qnqDtpUMt7PQ0bs300y8el116vUbm4nF8Bf5vltCx78ZzuAWBu/K'

# HTTPS
# LOCAL PORT FOR HTTPS, CAN BE CHANGED
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/madoc-ts-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
push: ${{ github.actor != 'dependabot[bot]' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_TIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
BUILD_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
BUILD_REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ services/madoc-remix
services/madoc-ts/service-jwts/madoc-remix.json
e2e/test-fixtures/postgres/default/default.sql
.DS_Store
services/madoc-next
38 changes: 36 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,45 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/digirati-co-uk/madoc-platform/compare/v2.1.4...main)

## [Unreleased](https://github.com/digirati-co-uk/madoc-platform/compare/v2.2.0...main)
<!--
### Fixed
### Added
### Changed
### Removed
-->

## [v2.2.0](https://github.com/digirati-co-uk/madoc-platform/compare/v2.1.4...v2.2.0)

[Full Release notes](https://docs.madoc.io/releases/v2.2)

### Overview
- User profiles + user data
- Project members
- Project feedback
- Project updates
- New project page blocks
- Site terms and conditions
- Configurable auto-complete
- IIIF Viewer changes
- Review dashboard
- Local Autosave
- Page block translations
- Technical changes

### Added
- New "custom auto-complete" configurations for external APIs (MAD-1408)
- New configuration to allow model field descriptions to be displayed as tooltips (MAD-1329)
- IIIF Collection endpoint for Madoc Collections (MAD-1407)
- New User preferences + profile options
- New customisable "Terms" page that users can accept
- Term API configuration admin interface
- Added TailwindCSS to the project
- Model fields can be dependent on each-others values

### Fixed
- Manifest canvas model now allows rotation (MAD-1425)
- Scroll on large field lists (MAD-1323)
- New cron-job to restart the queue at 3am every day (local to the server)

## [v2.1.4](https://github.com/digirati-co-uk/madoc-platform/compare/v2.1.3...v2.1.4)
Expand Down Expand Up @@ -88,6 +117,11 @@ Hotfix release for submissions in progress.
- Changed language on user dash from 'reviews' to 'review tasks' to differentiate between the two
- Improved 'delete all contributions' by deleting all user tasks as well as capture model
- Changed the project heading block to contain optional image and start contributing button
- Added max number option for allowMultiple fields in capture model

### Changed
- Changed language on user dash from 'reviews' to 'review tasks' to differentiate between the two
- Improved 'delete all contributions' by deleting all user tasks as well as capture model

## [v2.1.0](https://github.com/digirati-co-uk/madoc-platform/compare/v2.0.8...v2.1.0)

Expand Down
5 changes: 3 additions & 2 deletions services/madoc-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = {
rules: {
'react/prop-types': 0,
'import/named': 0,
'react/react-in-jsx-scope': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
Expand Down Expand Up @@ -70,11 +71,11 @@ module.exports = {
allowTemplateLiterals: true
}],
'space-before-blocks': ERROR,
'space-before-function-paren': OFF
'space-before-function-parent': OFF
},
settings: {
react: {
version: 'detect'
}
}
};
};
10 changes: 10 additions & 0 deletions services/madoc-ts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ COPY ./generate-schemas.js /home/node/app/generate-schemas.js
COPY ./themes /home/node/app/themes
COPY ./vite /home/node/app/vite
COPY ./vite.config.js /home/node/app/vite.config.js
COPY ./postcss.config.js /home/node/app/postcss.config.js
COPY ./tailwind.config.js /home/node/app/tailwind.config.js

ENV NODE_ENV=production

Expand All @@ -41,6 +43,10 @@ RUN yarn install --no-interactive --frozen-lockfile --production=true

FROM node:18-bullseye

ARG BUILD_TIME='unknown'
ARG BUILD_VERSION='unknown'
ARG BUILD_REVISION='unknown'

WORKDIR /home/node/app

RUN npm install -g pm2@5
Expand All @@ -62,6 +68,10 @@ ENV DATABASE_PASSWORD=postgres
ENV NODE_ENV=production
ENV API_GATEWAY_HOST=http://gateway

ENV BUILD_TIME=${BUILD_TIME}
ENV BUILD_VERSION=${BUILD_VERSION}
ENV BUILD_REVISION=${BUILD_REVISION}

EXPOSE 3000
EXPOSE 3001

Expand Down
4 changes: 3 additions & 1 deletion services/madoc-ts/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18
FROM node:18-bullseye

WORKDIR /home/node/app

Expand All @@ -18,6 +18,8 @@ COPY ./tsconfig.frontend.json /home/node/app/tsconfig.frontend.json
COPY ./migrations /home/node/app/migrations
COPY ./config.json /home/node/app/config.json
COPY ./generate-schemas.js /home/node/app/generate-schemas.js
COPY ./postcss.config.js /home/node/app/postcss.config.js
COPY ./tailwind.config.js /home/node/app/tailwind.config.js
COPY ./translations /home/node/app/translations
COPY ./schemas /home/node/app/schemas
COPY ./themes /home/node/app/themes
Expand Down
6 changes: 4 additions & 2 deletions services/madoc-ts/Dockerfile.vite
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18 as build
FROM node:18-bullseye as build

WORKDIR /home/node/app

Expand All @@ -8,7 +8,7 @@ COPY ./npm /home/node/app/npm

RUN yarn install

FROM node:18
FROM node:18-bullseye

WORKDIR /home/node/app

Expand All @@ -17,6 +17,8 @@ COPY --from=build /home/node/app/yarn.lock /home/node/app/yarn.lock
COPY --from=build /home/node/app/node_modules /home/node/app/node_modules
COPY ./schemas /home/node/app/schemas
COPY ./vite.config.js /home/node/app/vite.config.js
COPY ./postcss.config.js /home/node/app/postcss.config.js
COPY ./tailwind.config.js /home/node/app/tailwind.config.js
COPY ./themes /home/node/app/themes
COPY ./vite /home/node/app/vite
COPY ./entrypoint /home/node/app/entrypoint
Expand Down
12 changes: 12 additions & 0 deletions services/madoc-ts/__tests__/utility/create-link.tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createLink } from '../../src/frontend/shared/utility/create-link';

describe('createLink', () => {
test('it can create /reviews/{taskId} link', () => {
const link = createLink({
subRoute: 'reviews',
taskId: '1234',
});

expect(link).toEqual('/reviews/1234');
});
});
4 changes: 3 additions & 1 deletion services/madoc-ts/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
"preventContributionAfterSubmission": false,
"preventMultipleUserSubmissionsPerResource": false,
"preventContributionAfterManifestUnassign": false,
"hideViewerControls": false
"hideViewerControls": false,
"enableTooltipDescriptions": false,
"enableSplitView": false
},
"projectPageOptions": {
"hideStartContributing": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--term-configurations (up)

create table term_configurations (
id uuid primary key,
url_pattern text not null,
results_path text not null,
label_path text not null,
uri_path text not null,
resource_class_path text,
description_path text,
language_path text,
term_label text not null,
term_description text,
attribution text,
site_id integer not null,
creator integer not null,
created_at timestamp not null
);

create index term_configurations_site_id on term_configurations (site_id);

41 changes: 41 additions & 0 deletions services/madoc-ts/migrations/2023-07-18T11-55.user-extensions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--user-extensions (up)

alter table "user" add column user_info jsonb;
alter table "user" add column user_preferences jsonb;

create table site_terms
(
id uuid primary key,
site_id integer references site (id),
created_at timestamp not null default CURRENT_TIMESTAMP,
terms_markdown text not null,
terms_text text not null
);

alter table "user" add column terms_accepted uuid[];

create table badge
(
id uuid primary key,
site_id integer references site (id),
label jsonb not null,
description jsonb,
svg_code text,
tier_colors text[],
trigger_name text,
created_at timestamp,
updated_at timestamp
);

create table badge_award
(
id uuid primary key,
site_id integer references site (id) not null,
user_id integer references "user" (id) not null,
project_id integer references iiif_project (id),
badge_id uuid references badge (id),
awarded_by integer references "user" (id),
reason text,
tier int,
awarded_at timestamp not null default CURRENT_TIMESTAMP
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--project-extensions (up)

alter table iiif_derived_resource add column placeholder_image text default null;
alter table iiif_resource add column placeholder_image text default null;

alter table iiif_project add column due_date date default null;
alter table iiif_project add column start_date date default null;
alter table iiif_project add column members_only bool default false;

alter table project_notes add column created timestamp not null default now();
alter table project_notes add column updated timestamp not null default now();

create table project_feedback (
id serial primary key,
project_id integer not null references iiif_project(id) on delete cascade,
user_id integer not null references "user"(id),
created timestamp not null default now(),
feedback text not null
);

create table project_updates (
id serial primary key,
project_id integer not null references iiif_project(id) on delete cascade,
user_id integer not null references "user"(id),
created timestamp not null default now(),
update text not null,
snapshot json
);

create table project_members (
id serial primary key,
project_id integer not null references iiif_project(id) on delete cascade,
user_id integer not null references "user"(id),
created timestamp not null default now(),
role text,
role_label text,
role_color text
);
16 changes: 16 additions & 0 deletions services/madoc-ts/migrations/2023-08-03T20-11.add-ids.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--add-ids (up)

-- Make the Id field on plugin_token a primary key
alter table plugin_token add primary key (id);

alter table site_page_slots add primary key (page_id, slot_id);

alter table site_slot_blocks add primary key (block_id, slot_id);

alter table webhook_call add primary key (id);

-- remove constraint valid_invitation from invitation
alter table user_invitations drop constraint valid_invitation;

-- Remove index iiif_metadata_uq
drop index iiif_metadata_uq;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--term-configurations (down)

drop table if exists term_configurations;
drop index if exists term_configurations_site_id;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--user-extensions (down)

drop table if exists badge_award;
drop table if exists badge;
drop table if exists site_terms;
alter table "user" drop column terms_accepted;
alter table "user" drop column user_preferences;
alter table "user" drop column user_info;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--project-extensions (down)


alter table iiif_derived_resource drop column if exists placeholder_image;
alter table iiif_resource drop column if exists placeholder_image;

alter table iiif_project drop column if exists due_date;
alter table iiif_project drop column if exists start_date;
alter table iiif_project drop column if exists members_only;

drop table if exists project_feedback;
drop table if exists project_updates;
drop table if exists project_members;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--add-ids (down)
7 changes: 6 additions & 1 deletion services/madoc-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"@iiif/vault-helpers": "^0.9.8",
"@koa/router": "^10.1.1",
"@madoc.io/types": "./npm/madoc-types",
"@manifest-editor/iiif-browser-bundle": "https://pkg.csb.dev/digirati-co-uk/iiif-manifest-editor/commit/cc804fcf/@manifest-editor/iiif-browser-bundle",
"@slonik/migrator": "^0.2.0",
"@styled-icons/entypo": "^10.34.0",
"adm-zip": "^0.5.10",
Expand Down Expand Up @@ -129,6 +130,7 @@
"koa-send": "^5.0.0",
"koa2-connect": "^1.0.2",
"locale-codes": "^1.3.1",
"localforage": "^1.10.0",
"memfs": "^3.1.2",
"memory-cache": "^0.2.0",
"mirador": "^3.2.0",
Expand Down Expand Up @@ -173,7 +175,7 @@
"react-syntax-highlighter": "^15.4.3",
"react-textarea-autosize": "^8.3.1",
"react-timeago": "^4.4.0",
"react-tooltip": "^4.2.21",
"react-tooltip": "^5.18.0",
"redux-batched-subscribe": "^0.1.6",
"rich-markdown-editor": "11.17.8",
"semver": "^7.3.5",
Expand Down Expand Up @@ -265,6 +267,7 @@
"@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-react": "^3.0.1",
"@vitest/ui": "^0.28.2",
"autoprefixer": "^10.4.14",
"awesome-typescript-loader": "^5.2.1",
"babel-plugin-react-data-testid": "^0.2.0",
"babel-plugin-styled-components": "^2.0.7",
Expand All @@ -288,12 +291,14 @@
"jest-environment-jsdom": "^29.4.2",
"jsdom": "^16.5.1",
"koa-connect": "^2.1.0",
"postcss": "^8.4.27",
"prettier": "^1.19.1",
"react-is": "^16.13.1",
"react-query-devtools": "^2.4.7",
"react-refresh": "^0.10.0",
"storybook": "^7.0.0-beta.45",
"strip-indent": "^4.0.0",
"tailwindcss": "^3.3.3",
"terser": "^5.14.2",
"thread-loader": "^3.0.4",
"traverse": "^0.6.6",
Expand Down
Loading

0 comments on commit 08c6840

Please sign in to comment.