Skip to content

Commit

Permalink
Merge pull request #835 from digirati-co-uk/feature/nlw-bugs-jul-24
Browse files Browse the repository at this point in the history
Bugs jul 24
  • Loading branch information
stephenwf authored Jul 2, 2024
2 parents 8ff9adb + 8344ffa commit ab5f696
Show file tree
Hide file tree
Showing 16 changed files with 358 additions and 34 deletions.
34 changes: 18 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ 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.2.5...main)
<!--
<!--
### Fixed
### Added
### Changed
### Removed
-->
### Added
- New button to filter manifest tasks from reviews (NS-66)

## [v2.2.5](https://github.com/digirati-co-uk/madoc-platform/compare/v2.2.4...v2.2.5) - 22/05/2024

Expand Down Expand Up @@ -54,7 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed Atlas Viewer / Canvas Panel memory leak when browsing canvases
- Fixed bug with Polygon selector and not being able to drag a box to select points
- Fixed bug when selecting a polygon from the sidebar
- Fixed broken images on SVG cropped selector
- Fixed broken images on SVG cropped selector
- Fixed bug with maxOverZoom
- Fixed bug with refreshing task list
- Fixed server rendering (notification count, footer slot)
Expand Down Expand Up @@ -184,17 +186,17 @@ Hotfix release for submissions in progress.
- Fixed contributor buttons not following project config in collection (NS-23)
- Fixed missing translations in editor (NS-20)
- Fixed rejecting a submission sometimes removes accepted annotations (MAD-1315)
- Fixed allow multiple submissions when max contributions reached (MAD-1226)
- Fixed allow multiple submissions when max contributions reached (MAD-1226)
- Fixed not able to add or update annotation styles (MAD-1222)
- Fixed allow empty search (MAD-1342)
- Fixed drafts not loading for manifest model (MAD-1316)
- Fixed 'View contributions' on manifest button taking user to empty task list
- Fixed review page not showing a manifest preview for manifest tasks and showing manifest title in 'canvas' column
- Fix manifest model showing as editable for a submitted and approved manifest task
- Fixed and updated `ManifestActions` and `ManifestUserNotifications` to allow the user to continue submissions, add another and view a completed
- Fixed and updated `ManifestActions` and `ManifestUserNotifications` to allow the user to continue submissions, add another and view a completed
- Fixed only admins being able to review tasks, hide review actions if cant review (NS-17)
- Fixed autocomplete crashing (NS-28)
- Fixed infinite requests if no data when using infinite query
- Fixed infinite requests if no data when using infinite query
- Fixed pre-process IIIF Manifest metadata and descriptive fields for validity - 3000 character max (MAD-1379)
- Fixed regex on search snippet removing 'n' instead of '\n' MAD-1386
- Fixed importing multiple manifests breaks preview (MAD-1387)
Expand All @@ -209,7 +211,7 @@ Hotfix release for submissions in progress.
- Added required fields in capture model (MAD-211)
- Added ability to update manifest thumbnail (MAD-1314)
- Added not found pages for canvas, manifest, project and collection (MAD-1123)
- Added max number option for allowMultiple fields in capture model
- Added max number option for allowMultiple fields in capture model
- Added new Configuration page for projects (MAD-1365)

### Changed
Expand Down Expand Up @@ -272,8 +274,8 @@ supports a wider range of IIIF resources as a result.
* Fixed bug with "Max contributors" if user had already started working
* Fixed "Maximise window" to avoid cutting off the top section of the header
* Fixed firefox bug where "Define window" button was disabled if selector required
* Fixed Annotation styled hidden by default
* Fixed some fields showing in submission if empty
* Fixed Annotation styled hidden by default
* Fixed some fields showing in submission if empty
* Fixed email links sometimes not working in email clients - with option link to paste


Expand Down Expand Up @@ -378,14 +380,14 @@ supports a wider range of IIIF resources as a result.
* CSS - Reduced box-shadows in capture model editor forms
* Changed all Atlas Viewer instances to use Canvas panel
* Simplified styling on search results
* Improved reviewer dashboard view
* Sortable table headers
* Resizable layout
* Full row clickable
* Improved reviewer dashboard view
* Sortable table headers
* Resizable layout
* Full row clickable
* Focus mode & edit added
* Clearer language
* Side by side canvas preview and improved styling
* Navigation between items in list
* Clearer language
* Side by side canvas preview and improved styling
* Navigation between items in list
* Default to no selected task
* Added infinite scroll

Expand Down Expand Up @@ -419,7 +421,7 @@ supports a wider range of IIIF resources as a result.
see [use-module.ts](https://github.com/digirati-co-uk/madoc-platform/blob/09d566aa4560dc72b878db089b4e1b834c608ed7/services/madoc-ts/src/frontend/shared/plugins/use-module.ts))
* Move Api keys database code to `ApiKeyRepository`
* Added flags that can be passed into the `BaseRepository` class
* Split out `ViewDocument` into more manageable components
* Split out `ViewDocument` into more manageable components

## [2.0.8](https://github.com/digirati-co-uk/madoc-platform/releases/tag/v2.0.8) - 2022-08-24

Expand Down
7 changes: 7 additions & 0 deletions services/madoc-ts/sandbox/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NODE_TLS_REJECT_UNAUTHORIZED=0

## Madoc Local
MADOC_URL=https://madoc.local
MADOC_SITE=default
CLIENT_ID=...
CLIENT_SECRET=...
175 changes: 175 additions & 0 deletions services/madoc-ts/sandbox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
15 changes: 15 additions & 0 deletions services/madoc-ts/sandbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Sandbox

This is a way to get the Madoc API client and run tasks on remote servers.

You will need to build before creating a sandbox.
```
bun i
```

and then
```
bun run build
```

Check the `./environments` folder for creating new environments
Binary file added services/madoc-ts/sandbox/bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions services/madoc-ts/sandbox/environments/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
35 changes: 35 additions & 0 deletions services/madoc-ts/sandbox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { ApiClient } from '../src/gateway/api';

// Set env.
const MADOC_URL = process.env.MADOC_URL;
const MADOC_SITE = process.env.MADOC_SITE;
const CLIENT_ID = process.env.CLIENT_ID;
const CLIENT_SECRET = process.env.CLIENT_SECRET;

export async function getApi() {
if (!MADOC_URL || !MADOC_SITE || !CLIENT_ID || !CLIENT_SECRET) {
console.log('missing env');
process.exit();
}

console.log(`Requesting key from: ${MADOC_URL}/s/${MADOC_SITE}/auth/api-token`);
const response = await fetch(`${MADOC_URL}/s/${MADOC_SITE}/auth/api-token`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
}),
}).then(r => r.json());

if (!response.token) throw new Error(response.error || 'Invalid credentials');

return new ApiClient({
gateway: MADOC_URL,
publicSiteSlug: MADOC_SITE,
jwt: response.token,
});
}
27 changes: 27 additions & 0 deletions services/madoc-ts/sandbox/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}
29 changes: 29 additions & 0 deletions services/madoc-ts/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "madoc-sandbox",
"version": "1.0.0",
"description": "",
"main": "dist/index.cjs",
"types": "dist/index.d.cts",
"type": "module",
"scripts": {
"build": "tsup index.ts --target node18 --dts"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/bun": "latest",
"react": "^18.3.1",
"@types/koa__router": "^8.0.2",
"@types/koa": "^2.11.0",
"react-dom": "^18.3.1"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"dependencies": {
"dotenv": "^16.4.5",
"slonik": "^45.6.0",
"tsup": "^8.1.0"
}
}
Loading

0 comments on commit ab5f696

Please sign in to comment.