Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
f6849bd
innit
Heather0K Feb 16, 2024
c353467
use topic from slug for search
Heather0K Feb 23, 2024
960fef7
0 resources instead of 0
Heather0K Feb 23, 2024
39ea049
Merge pull request #817 from digirati-co-uk/hotfix/use-slug-for-search
Heather0K Feb 23, 2024
50c234b
Merge branch 'feature/IDA-madoc-develop' of https://github.com/digira…
Heather0K Feb 26, 2024
7ab78cd
fix errors when editing and images hasnt changed
Heather0K Feb 26, 2024
adcbf32
admin header use title not label
Heather0K Feb 26, 2024
baedd92
reflect same changed on topic editing
Heather0K Feb 26, 2024
370ed03
fix console log
Heather0K Feb 26, 2024
b1f6334
Merge pull request #819 from digirati-co-uk/hotfix/IDA-1115/edit-topi…
Heather0K Feb 27, 2024
fd2ea20
update search pages to reflect new designs
Heather0K Feb 27, 2024
da8e638
Merge pull request #820 from digirati-co-uk/feaure/IDA-1093/ux-search…
Heather0K Feb 27, 2024
6460c65
use title plurals for listing
Heather0K Feb 29, 2024
8a5aed8
change CTA text
Heather0K Feb 29, 2024
b3d229f
2 types in a row
Heather0K Feb 29, 2024
40bb4cc
single topic block
Heather0K Mar 1, 2024
3450589
add opacity option to crowdsourcing banner
Heather0K Mar 1, 2024
72fa027
change label to title on item list
Heather0K Mar 1, 2024
68f26d8
update docker build
Heather0K Mar 1, 2024
2988413
update atlas viewer
Heather0K Mar 1, 2024
164b049
update iif vault
Heather0K Mar 1, 2024
8d948a6
console log
Heather0K Mar 1, 2024
326b360
update more pkg
Heather0K Mar 1, 2024
631d1ad
revert package.json changes
Heather0K Mar 1, 2024
68984f7
search results not updating on laod sometimes
Heather0K Mar 1, 2024
6e054a4
latest version of atlas
Heather0K Mar 1, 2024
11e0eee
updated versions
Heather0K Mar 1, 2024
ebe9484
fix error when editing topic
Heather0K Mar 1, 2024
41fbf7f
get correct dependancies and resolutions for atlas and pass tests
Heather0K Mar 4, 2024
4209225
update iiif-parser & vault-helpers to fix build
Heather0K Mar 4, 2024
fbaa18f
update react query change some config on search
Heather0K Mar 4, 2024
23cf86b
roll back
Heather0K Mar 4, 2024
22d4be1
wait for topic
Heather0K Mar 4, 2024
6df6334
wait for topic -wait for facets
Heather0K Mar 4, 2024
6952311
console logs and change loading block condition
Heather0K Mar 4, 2024
4922f39
create topic-search
Heather0K Mar 4, 2024
77d6e80
padding option crowdsourcing banner
Heather0K Mar 4, 2024
cb17aa6
tidy up and fix view in search
Heather0K Mar 5, 2024
af3f440
fix cant edit featured topics and cant create topic
Heather0K Mar 5, 2024
a7327d8
add subtype topicType to search
Heather0K Mar 5, 2024
5f32e28
fix query enable
Heather0K Mar 5, 2024
a43d69a
change resources to apprerances for couns
Heather0K Mar 8, 2024
8189a90
Merge pull request #822 from digirati-co-uk/hotfix/IDA-1118/topic-lis…
Heather0K Mar 8, 2024
b66c5c7
IDA-1139 enter clears search
Heather0K Mar 15, 2024
3dd4214
IDA-1160 fix duplicating facets
Heather0K Mar 15, 2024
47c6e75
IDA-1152 change reset to home icon
Heather0K Mar 15, 2024
845fc60
IDA-1141 add load spinner to facets
Heather0K Mar 15, 2024
84786c4
IDA-1149/add-apply-button-to-bottom
Heather0K Mar 22, 2024
f0f877c
IDA-1133 add option to make menu items bold
Heather0K Mar 22, 2024
ab67f52
fix type errors
Heather0K Mar 22, 2024
b21464f
half width surface
Heather0K Mar 22, 2024
90e0dc9
make search button use border theme colour
Heather0K Mar 22, 2024
b1ea89b
fix margin
Heather0K Mar 22, 2024
9946c3e
Merge pull request #824 from digirati-co-uk/hotfix/IDA-1124/user-rese…
Heather0K Mar 26, 2024
a1753ad
IDA-1158: user feedback and add another button on tagging modal
Heather0K Mar 27, 2024
edf32b5
1136-topics ordering
Heather0K Apr 3, 2024
e8696b2
IDA-1157/timeout for model flicker
Heather0K Apr 3, 2024
f213878
IDA-1144- trunicate text option on search results
Heather0K Apr 3, 2024
8a74191
Merge pull request #826 from digirati-co-uk/IDA-1124/User-research-2
Heather0K Apr 3, 2024
fd286e2
use topic-search for pagination and facets
Heather0K Apr 11, 2024
b802c7e
Merge pull request #828 from digirati-co-uk/hotfix/use-topic-search
Heather0K Apr 11, 2024
2fd6080
useTopicSearch for pagination
Heather0K Apr 11, 2024
b32917c
Merge pull request #829 from digirati-co-uk/hotfix/use-topic-search
Heather0K Apr 11, 2024
f7aea4d
fix window is undefined
Heather0K Apr 12, 2024
9914b6f
Merge pull request #830 from digirati-co-uk/hotfix/topicGrid-500
Heather0K Apr 12, 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
2 changes: 1 addition & 1 deletion .github/workflows/madoc-ts-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: ['main']
tags: ['v*']
pull_request:
branches: ['main', 'feature/v2.1', 'feature/IDA-893-enrichment-integration']
branches: ['main', 'feature/v2.1', 'feature/IDA-893-enrichment-integration', 'feature/IDA-madoc-develop']
paths:
- ".github/workflows/madoc-ts-docker.yaml"
- "services/madoc-ts/src/**"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var_backup
e2e/cypress/fixtures/madoc-test-fixtures
services/enrichment
services/search
services/enrichment
services/madoc-remix
services/madoc-ts/service-jwts/madoc-remix.json
e2e/test-fixtures/postgres/default/default.sql
.DS_Store
/spotlight-model
14 changes: 13 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ services:
condition: service_healthy

search:
image: digirati/madoc-enrichment:qa-deploy
image: digirati/madoc-enrichment:latest
# build:
# context: services/enrichment
# dockerfile: Dockerfile
Expand All @@ -231,9 +231,11 @@ services:
- INLINE_WORKER=True
- GOOGLE_APPLICATION_CREDENTIALS=/app/starsky_google_credentials
- OCR_ENGINE=Google
- DEFAULT_DBPEDIA_URL=http://dbpedia-spotlight/rest
links:
- shared-postgres
- gateway-redis
- spotlight.en
# volumes:
# - ./services/enrichment/app:/app:delegated
ports:
Expand All @@ -243,3 +245,13 @@ services:
sysctls:
- net.core.somaxconn=1024
- net.ipv4.tcp_syncookies=0

spotlight.en:
image: digirati/spotlight-alpine:multi-platform
container_name: dbpedia-spotlight
volumes:
- ./spotlight-model:/opt/spotlight/models
restart: unless-stopped
ports:
- "2222:80"
command: spotlight.sh en
6 changes: 3 additions & 3 deletions services/madoc-ts/Dockerfile
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 Down Expand Up @@ -29,7 +29,7 @@ RUN yarn build:vite-scheduler
RUN yarn build:frontend
RUN yarn build:vite-server

FROM node:18 as modules
FROM node:18-bullseye as modules

WORKDIR /home/node/app

Expand All @@ -39,7 +39,7 @@ COPY --from=build /home/node/app/npm /home/node/app/npm

RUN yarn install --no-interactive --frozen-lockfile --production=true

FROM node:18
FROM node:18-bullseye

WORKDIR /home/node/app

Expand Down
30 changes: 15 additions & 15 deletions services/madoc-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,46 +36,46 @@
},
"browserslist": "> 0.25%, not dead",
"resolutions": {
"@atlas-viewer/atlas": "https://pkg.csb.dev/atlas-viewer/atlas/commit/842002cd/@atlas-viewer/atlas",
"@atlas-viewer/atlas": "^2.1.0",
"@babel/core": "^7.20.12",
"@babel/runtime": "7.20.13",
"@babel/runtime": "^7.20.13",
"@babel/generator": "^7.20.14",
"@babel/types": "7.20.7",
"@iiif/vocabulary": "1.0.17",
"@iiif/presentation-3": "^1.1.3",
"immutable": "3.8.2",
"react-i18next": "11.18.4",
"scheduler": "0.19.1",
"styled-components": "5.3.3",
"styled-components": "^5.3.5",
"slonik-sql-tag-raw": "1.0.2",
"@atlas-viewer/iiif-image-api": "2.0.5",
"@iiif/parser": "^1.0.13",
"@atlas-viewer/iiif-image-api": "^2.0.5",
"@iiif/parser": "1.*",
"@iiif/vault": "^0.9.19",
"@iiif/vault-helpers": "^0.9.8",
"@iiif/vault-helpers": "^0.9.11",
"@types/styled-components": "^5.1.0",
"deepmerge": "4.2.2",
"react-dnd": "^11.1.3",
"react-dnd-multi-backend": "^6.0.2",
"dnd-multi-backend": "6.0.0",
"html-entities": "1.4.0",
"formik": "^2.2.9",
"react": "17.0.2",
"react-dom": "17.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@types/react": "^17.0.50",
"@types/react-dom": "^17.0.17",
"ws": "^8.8.0",
"popmotion": "^8.7.6",
"immer": "^9"
"immer": "^9.0.6"
},
"dependencies": {
"@atlas-viewer/atlas": "https://pkg.csb.dev/atlas-viewer/atlas/commit/842002cd/@atlas-viewer/atlas",
"@atlas-viewer/atlas": "^2.1.0",
"@atlas-viewer/iiif-image-api": "^2.0.5",
"@babel/runtime": "^7.20.13",
"@iiif/parser": "^1.0.13",
"@iiif/parser": "^2.0.2",
"@iiif/presentation-2": "^1.0.2",
"@iiif/presentation-3": "^1.1.3",
"@iiif/vault": "^0.9.19",
"@iiif/vault-helpers": "^0.9.8",
"@iiif/vault": "^0.9.22",
"@iiif/vault-helpers": "^0.10.0",
"@koa/router": "^10.1.1",
"@madoc.io/types": "./npm/madoc-types",
"@slonik/migrator": "^0.2.0",
Expand Down Expand Up @@ -162,7 +162,7 @@
"react-functional-select": "^3.3.3",
"react-helmet": "^6.1.0",
"react-i18next": "^11.18.4",
"react-iiif-vault": "https://pkg.csb.dev/digirati-co-uk/react-iiif-vault/commit/548ec37f/react-iiif-vault",
"react-iiif-vault": "^1.0.9",
"react-intersection-observer": "^8.26.2",
"react-mosaic-component": "^4.1.1",
"react-query": "^2.26.4",
Expand Down Expand Up @@ -320,4 +320,4 @@
"lib/"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type TopicExplorerProps = {
value: {
slug?: string;
id?: string;
type: string;
} | null;
};

Expand All @@ -34,7 +35,6 @@ export const TopicExplorer: FieldComponent<TopicExplorerProps> = ({ value, updat
return api.enrichment.entityAutoComplete(topicType, '', page);
},
{
enabled: !!topicType,
getFetchMore: lastPage => {
if (lastPage.pagination.totalPages === lastPage.pagination.page) {
return undefined;
Expand Down Expand Up @@ -69,19 +69,21 @@ export const TopicExplorer: FieldComponent<TopicExplorerProps> = ({ value, updat
{pages?.map((page, key) => {
return (
<React.Fragment key={key}>
{page.results.map(item => (
<RoundedCard
key={item.id}
size="small"
interactive
onClick={() => {
updateValue({ slug: item.slug, id: item.id });
}}
>
<LocaleString as={Subheading1}>{item.title}</LocaleString>
<LocaleString as={Subheading3}>{item.label}</LocaleString>
</RoundedCard>
))}
{page.results.map(item => {
return (
<RoundedCard
key={item.id}
size="small"
interactive
onClick={() => {
updateValue({ slug: item.slug, id: item.id, type: item.type_slug });
}}
>
<LocaleString as={Subheading1}>{item.title}</LocaleString>
<LocaleString as={Subheading3}>{item.label}</LocaleString>
</RoundedCard>
);
})}
</React.Fragment>
);
})}
Expand All @@ -98,16 +100,19 @@ export const GetTopic: React.FC<{
value:
| {
slug?: string;
type?: string;
id?: string;
}
| string;
}> = ({ value }) => {
const { topicType } = useParams<Record<'topicType', any>>();

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const slug = !value.slug && typeof value === 'string' ? value : value.slug;
const { data } = useApiTopic(topicType, slug);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const type = !value.type && typeof value === 'string' ? topicType : value.type;
const { data } = useApiTopic(type, slug);

if (data) {
return <TopicSnippetCard topic={data} cardBorder="black" size={'small'} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const TopicItemExplorer: FieldComponent<TopicItemExplorerProps> = ({ valu
['topic-items', {}],
async (key, _, page?: number) => {
return api.getSearchQuery(
{ facets: [{ type: 'entity', group_id: data?.id }], resource_type: 'manifest' } as any,
{ facets: [{ type: 'entity', group_id: topic }], resource_type: 'manifest' } as any,
page
);
},
Expand Down
8 changes: 4 additions & 4 deletions services/madoc-ts/src/extensions/enrichment/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ export class EnrichmentExtension extends BaseDjangoExtension {
}

// Entity - List, filtered by chosen Entity Type
getEntities(slug: string, page?: number) {
return this.api.request<EntitiesListResponse>(`/api/enrichment/entity/${slug}/?page=${page}`);
getEntities(slug: string, page?: number, order_by?: string) {
return this.api.request<any>(`/api/enrichment/entity/${slug}/?page=${page}&order_by=${order_by}`);
}

// Entity - Retrieve
getEntity(entity_type_slug: string, slug: string) {
return this.api.request<EntityFull>(`/api/enrichment/entity/${entity_type_slug}/${slug}/`);
return this.api.request<any>(`/api/enrichment/entity/${entity_type_slug}/${slug}/`);
}

// Entity - Upsert
Expand All @@ -175,7 +175,7 @@ export class EnrichmentExtension extends BaseDjangoExtension {
}

// Entity - Autocomplete Search
entityAutoComplete(type: string, fullText: string, page = 1) {
entityAutoComplete(type?: string, fullText?: string, page = 1) {
return this.api.request<EntityAutoCompleteResponse>(`/api/enrichment/entity_autocomplete/?${stringify({ page })}`, {
method: 'POST',
body: {
Expand Down
14 changes: 5 additions & 9 deletions services/madoc-ts/src/extensions/enrichment/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ export const entityTypeModel: CaptureModelShorthand<EntityTypeQuery> = {
label: 'Featured topic',
pluralLabel: 'Featured topics',
},
other_data: {
allowMultiple: false,
label: 'Images',
labelledBy: 'id',
},
},

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
thumbnail: { type: 'madoc-media-explorer', label: 'Thumbnail' },
hero: { type: 'madoc-media-explorer', label: 'Hero image' },
'featured_topics.slug': { type: 'topic-explorer', label: 'featured topics' },
'other_data.main_image': { type: 'madoc-media-explorer', label: 'Hero image' },
'other_data.thumbnail': { type: 'madoc-media-explorer', label: 'Thumbnail' },
};

export const entityModel: CaptureModelShorthand<EntityQuery> = {
Expand Down Expand Up @@ -51,10 +47,10 @@ export const entityModel: CaptureModelShorthand<EntityQuery> = {

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
thumbnail: { type: 'madoc-media-explorer', label: 'Thumbnail' },
hero: { type: 'madoc-media-explorer', label: 'Hero image' },
'featured_resources.madoc_id': { type: 'topic-item-explorer', label: 'featured resources' },
'other_data.topic_summary': { type: 'international-field', label: 'Summary' },
'other_data.secondary_heading': { type: 'international-field', label: 'Secondary heading' },
'other_data.aliases': { type: 'international-field', label: 'Aliases', allowMultiple: true },
'other_data.main_image': { type: 'madoc-media-explorer', label: 'Hero image' },
'other_data.thumbnail': { type: 'madoc-media-explorer', label: 'Thumbnail' },
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import simpleMarkdownBlock from './simple-markdown-block/simple-markdown-block';
import { EmbedItem } from '../../frontend/site/features/EmbedItem';
import { SiteLogoNavItem } from '../../frontend/shared/components/SiteLogoNavItem';
import { DropDownMenu } from '../../frontend/site/features/DropdownMenu';
import { SingleTopic } from '../../frontend/shared/components/SingleTopic';

export function getDefaultPageBlockDefinitions(): PageBlockDefinition<any, any, any, any>[] {
return [
Expand All @@ -27,5 +28,6 @@ export function getDefaultPageBlockDefinitions(): PageBlockDefinition<any, any,
// todo remove when plugin is updated
(DropDownMenu as any)[Symbol.for('slot-model')] as any,
simpleMarkdownBlock,
(SingleTopic as any)[Symbol.for('slot-model')] as any,
];
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { captureModelShorthand } from '../../../frontend/shared/capture-models/helpers/capture-model-shorthand';
import { HTMLPageBlockDefinition } from '../extension';

const definition: HTMLPageBlockDefinition<{ html: string }> = {
const definition: HTMLPageBlockDefinition<{ html: string; maxWidth?: string }> = {
label: 'Simple HTML block',
type: 'simple-html-block',
renderType: 'html',
Expand All @@ -14,6 +14,7 @@ const definition: HTMLPageBlockDefinition<{ html: string }> = {
defaultData: {
html: '',
},

render: data => {
return data.html;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ModalFooter } from '../../../frontend/shared/layout/Modal';
import { blockEditorFor } from '../block-editor-for';
import { PageBlockEditor, ReactPageBlockDefinition } from '../extension';
import { StaticMarkdownBlock } from './static-markdown-block';
import { maxWidth } from '../../../frontend/site/variables/global';

const MarkdownEditorWrapper = styled.div`
padding: 0.6em 0.6em 0.6em 2em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export function ListManifestTags() {
}>();
const [selectedId, setSelectedId] = useState<string | undefined>(undefined);

const onSelect = (id: string | undefined) => {
setSelectedId(id);
const onSelect = (i: string | undefined) => {
setSelectedId(i);
};

const [createTag, createTagStatus] = useMutation(async (entityId: string) => {
Expand Down
Loading