Skip to content

Commit

Permalink
Merge pull request #810 from digirati-co-uk/feature/ghent-priorities-…
Browse files Browse the repository at this point in the history
…01-24

2.2 Bug fixes and improvements
  • Loading branch information
stephenwf authored Jan 25, 2024
2 parents 0ea0297 + 449ad1f commit 86bd398
Show file tree
Hide file tree
Showing 77 changed files with 1,049 additions and 511 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added "line box mode" on SVG selector
- Added "Circle" shape on SVG selector (40 points)
- New "cut" cursor when holding Shift on SVG selector
- Max height on search facets + scroll
- Added "Delete all manifests" to Delete Collection page (MAD-1461)
- Added a way to filter out Sites from the site list using `[archived]` in the site title. (MAD-1270)
- Added 2 new buttons to submissions in progress "Manually put into review" and "View submission" (MAD-1467)
- Added "Assignee" filtering to Review dashboard (MAD-1320)
- Added "Status" filtering to Review Dashboard (MAD-1320)
- Added "Clear filters" to Review Dashboard (MAD-1320)
- Added page block options to "Collection Filter Options" on project collections (MAD-1281)
- Added link to reviews from "Crowdsourcing" tab in project admin (MAD-1468)
- Added better links to and from register and login pages (NS-56)
- Added more information to system status page (NS-43)
- Added display names for React Contexts for better debugging


### Fixed
Expand All @@ -26,8 +38,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed bug when selecting a polygon from the sidebar
- Fixed broken images on SVG cropped selector
- Fixed bug with maxOverZoom
- Fixed bug with refreshing task list
- Fixed server rendering (notification count, footer slot)
- Fixed registrations with an invitation on sites without registrations enabled (MAD-1388)
- Fixed tooltips on Manifest granularity project (MAD-1434)
- Fixed Locale name in heading (MAD-1152)
- Fixed token refreshing
- Fixed activity stream pagination (NS-52)

### Changed
- Add short descriptions for admin Search & Metadata actions + correct site config. page titles (MAD-1466)
- Changed Default site-wide project configuration to use new form (MAD-1438)
- Made "Go to site" link a button on project admin (MAD-1465)
- Changed ordering of Manifest listing - newest first (MAD-1391)
- Changed notification refetch to every 15 minutes, instead of 2 minutes.
- Labels on Canvas navigation on a Manifest granularity project (MAD-1429)
- Changed size of document panel labels
- Made default annotation styles more visible for annotations panel (MAD-1362)
- Updated `polygon-editor` to v0.0.2
- Updated `@iiif/vault` and `@iiif/vault-helpers` to `@iiif/helpers`
- Updated `@iiif/presentation-3` types to v2.x
Expand Down
32 changes: 8 additions & 24 deletions services/madoc-ts/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cookieName": "madoc",
"tokenExpires": 25200,
"tokenRefresh": 3600,
"tokenExpires": 1209600,
"tokenRefresh": 172800,
"defaultSiteConfiguration": {
"allowCollectionNavigation": true,
"allowManifestNavigation": true,
Expand Down Expand Up @@ -35,10 +35,10 @@
"shortExpiryTime": "10",
"longExpiryTime": "1440",
"modelPageShowAnnotations": "when-open",
"modelPageShowDocument":"when-open",
"modelPageShowDocument": "when-open",
"atlasBackground": "#f9f9f9",
"canvasPageShowAnnotations": "when-open",
"canvasPageShowDocument":"when-open",
"canvasPageShowDocument": "when-open",
"forkMode": false,
"reviewOptions": {
"allowMerging": false
Expand Down Expand Up @@ -95,11 +95,7 @@
}
},
"permissions": {
"admin": [
"site.admin",
"tasks.admin",
"models.admin"
],
"admin": ["site.admin", "tasks.admin", "models.admin"],
"reviewer": [
"tasks.create",
"tasks.progress",
Expand All @@ -117,27 +113,15 @@
"models.view_published",
"site.view"
],
"transcriber": [
"tasks.progress",
"models.revision",
"models.contribute",
"models.view_published",
"site.view"
],
"transcriber": ["tasks.progress", "models.revision", "models.contribute", "models.view_published", "site.view"],
"limited-transcriber": [
"tasks.progress",
"models.revision",
"models.contribute",
"models.view_published",
"site.view"
],
"viewer": [
"models.view_published",
"site.view"
],
"editor": [
"models.view_published",
"site.view"
]
"viewer": ["models.view_published", "site.view"],
"editor": ["models.view_published", "site.view"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ACTIVITY_PER_PAGE = 50;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { gatewayHost } from '../../gateway/api.server';
import { RouteMiddleware } from '../../types/route-middleware';
import { NotFound } from '../../utility/errors/not-found';
import { optionalUserWithScope } from '../../utility/user-with-scope';
import { ACTIVITY_PER_PAGE } from '../activity-stream-config';

export const getActivityStreamPage: RouteMiddleware<{
primaryStream: string;
Expand All @@ -20,7 +21,7 @@ export const getActivityStreamPage: RouteMiddleware<{
throw new NotFound();
}

const perPage = 10;
const perPage = ACTIVITY_PER_PAGE;
const page = Number(context.params.page);
const [totalItems, orderedItems] = await Promise.all([
context.changeDiscovery.getTotalItems({ primaryStream, secondaryStream }, siteId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { RouteMiddleware } from '../../types/route-middleware';
import { NotFound } from '../../utility/errors/not-found';
import { optionalUserWithScope } from '../../utility/user-with-scope';
import { gatewayHost } from '../../gateway/api.server';
import { ACTIVITY_PER_PAGE } from '../activity-stream-config';

export const getActivityStream: RouteMiddleware<{
primaryStream: string;
Expand All @@ -18,7 +19,7 @@ export const getActivityStream: RouteMiddleware<{
throw new NotFound();
}

const perPage = 100;
const perPage = ACTIVITY_PER_PAGE;
const totalItems = await context.changeDiscovery.getTotalItems({ primaryStream, secondaryStream }, siteId);

const firstPage = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export const postUniversalChange: RouteMiddleware<
evType === 'Collection'
? (await userApi.getCollectionById(id)).collection
: evType === 'Manifest'
? (await userApi.getManifestById(id)).manifest
: evType === 'Canvas'
? (await userApi.getCanvasById(id)).canvas
: undefined;
? (await userApi.getManifestById(id)).manifest
: evType === 'Canvas'
? (await userApi.getCanvasById(id)).canvas
: undefined;

const label = resource ? (Object.values(resource.label)[0] || [])[0] : undefined;

Expand Down
3 changes: 3 additions & 0 deletions services/madoc-ts/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function validNumber(t: string | undefined, defaultValue: number) {
return asNumber;
}

export const DEFAULT_TOKEN_EXPIRY = 60 * 60 * 24 * 14; // 14 days
export const DEFAULT_TOKEN_REFRESH = 60 * 60 * 24 * 2; // 2 days

export const config: EnvConfig = {
build: {
time: process.env.BUILD_TIME || 'unknown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export function getManifestList({
canvasSubQuery,
labelQuery,
onlyPublished,
oldestFirst,
}: {
siteId: number;
page: number;
Expand All @@ -171,6 +172,7 @@ export function getManifestList({
onlyPublished?: boolean;
canvasSubQuery?: TaggedTemplateLiteralInvocationType<{ resource_id: number }>;
labelQuery?: string;
oldestFirst?: boolean;
}) {
if (canvasSubQuery) {
const parentJoin = parentId
Expand Down Expand Up @@ -200,6 +202,7 @@ export function getManifestList({
where i.type = 'manifest'
${parentWhere}
group by ir.resource_id, i.type, canvas_count.item_total
${oldestFirst ? sql`order by ir.id desc` : sql``}
limit ${manifestCount} offset ${(page - 1) * manifestCount}
`;
}
Expand All @@ -217,6 +220,7 @@ export function getManifestList({
${onlyPublished ? sql`and manifests.published = true` : SQL_EMPTY}
and midr.resource_id = ${parentId}
and midr.site_id = ${siteId}
${oldestFirst ? sql`order by manifests.id desc` : sql``}
limit ${manifestCount} offset ${(page - 1) * manifestCount}
`;
}
Expand All @@ -234,6 +238,7 @@ export function getManifestList({
and manifests.site_id = ${siteId}
${onlyPublished ? sql`and manifests.published = true` : SQL_EMPTY}
and im.resource_id is not null
${oldestFirst ? sql`order by manifests.id desc` : sql``}
limit ${manifestCount} offset ${(page - 1) * manifestCount}
`;
}
Expand All @@ -249,6 +254,7 @@ export function getManifestList({
and manifests.site_id = ${siteId}
${onlyPublished ? sql`and manifests.published = true` : SQL_EMPTY}
and im.resource_id is not null
${oldestFirst ? sql`order by manifests.id desc` : sql``}
limit ${manifestCount} offset ${(page - 1) * manifestCount}
`;
}
Expand Down
2 changes: 2 additions & 0 deletions services/madoc-ts/src/frontend/admin/components/AdminMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ const AdminMainScrollContext = React.createContext({
},
});

AdminMainScrollContext.displayName = 'AdminMainScroll';

export const useAdminLayout = () => {
return useContext(AdminMainScrollContext);
};
Expand Down
Loading

0 comments on commit 86bd398

Please sign in to comment.