diff --git a/projects/bp-gallery/cypress/e2e/start.cy.ts b/projects/bp-gallery/cypress/e2e/start.cy.ts
index 2c8474679..a6df6bd85 100644
--- a/projects/bp-gallery/cypress/e2e/start.cy.ts
+++ b/projects/bp-gallery/cypress/e2e/start.cy.ts
@@ -5,12 +5,12 @@ describe('Start view', () => {
it('shows the archive cards and browse view', () => {
cy.get('.archives').should('exist');
- cy.get('.archive').should('exist');
+ cy.get('[data-testid="archive"]').should('exist');
cy.get('.browse-container').should('exist');
});
it('shows the picture count for the archive cards', () => {
- cy.contains('.archive', 'Herbert-Ahrens-Bilderarchiv').contains('5 Bilder');
+ cy.contains('[data-testid="archive"]', 'Herbert-Ahrens-Bilderarchiv').contains('5 Bilder');
});
it('should have a visible navigation bar', () => {
diff --git a/projects/bp-gallery/src/components/views/archives/ArchiveCheckboxField.tsx b/projects/bp-gallery/src/components/views/archives/ArchiveCheckboxField.tsx
index eb1478d3c..73b1b3be9 100644
--- a/projects/bp-gallery/src/components/views/archives/ArchiveCheckboxField.tsx
+++ b/projects/bp-gallery/src/components/views/archives/ArchiveCheckboxField.tsx
@@ -25,7 +25,7 @@ const ArchiveCheckboxField = ({ defaultValue, id, onChange, label }: ArchiveInpu
);
return (
-
+
{
paypalDonationText: '',
paypalPurpose: '',
links: [],
+ hidden: false,
restrictImageDownloading: false,
dirty: false,
});
@@ -97,6 +99,7 @@ const ArchiveEditView = ({ archiveId }: ArchiveEditViewProps) => {
paypalDonationText: archive?.paypalDonationText ?? '',
paypalPurpose: archive?.paypalPurpose ?? '',
links: archive?.links ?? [],
+ hidden: archive?.hidden ?? false,
restrictImageDownloading: archive?.restrictImageDownloading ?? false,
});
}, [archive]);
@@ -180,6 +183,7 @@ const ArchiveEditView = ({ archiveId }: ArchiveEditViewProps) => {
'paypalClient',
'paypalDonationText',
'paypalPurpose',
+ 'hidden',
'restrictImageDownloading',
]),
logo,
@@ -200,6 +204,7 @@ const ArchiveEditView = ({ archiveId }: ArchiveEditViewProps) => {
'paypalClient',
'paypalDonationText',
'paypalPurpose',
+ 'hidden',
'restrictImageDownloading',
]),
},
@@ -331,6 +336,12 @@ const ArchiveEditView = ({ archiveId }: ArchiveEditViewProps) => {
onBlur={value => updateForm({ paypalPurpose: value, dirty: true })}
placeholder={t('archives.edit.paypal.purpose-placeholder')}
/>
+ updateForm({ hidden: value, dirty: true })}
+ />
{
fallback: { clientId: '', donationText: '', purposeText: '' },
});
- const archiveCards = archives?.map(archive => {
- const sharedProps = {
- archiveName: archive.name,
- archiveDescription: archive.shortDescription ?? '',
- archiveId: archive.id,
- archivePictureCount: pictureCounts?.find(pictureCount => pictureCount.id === archive.id)
- ?.count,
- };
+ const archiveCards = useMemo(
+ () =>
+ archives
+ ?.filter(archive => isLoggedIn || !archive.hidden)
+ ?.map(archive => {
+ const sharedProps = {
+ archiveName: archive.name,
+ archiveDescription: archive.shortDescription ?? '',
+ archiveId: archive.id,
+ archivePictureCount: pictureCounts?.find(pictureCount => pictureCount.id === archive.id)
+ ?.count,
+ };
- return (
-
- {archive.showcasePicture ? (
-
- ) : (
-
- )}
-
- );
- });
+ return (
+
+ {archive.showcasePicture ? (
+
+ ) : (
+
+ )}
+
+ );
+ }),
+ [archives, isLoggedIn, pictureCounts]
+ );
const showStories = useFlag('showstories');
const tabs: OverviewContainerTab[] = useMemo(() => {
diff --git a/projects/bp-gallery/src/graphql/APIConnector.tsx b/projects/bp-gallery/src/graphql/APIConnector.tsx
index ca9ee0ec4..0655984a7 100644
--- a/projects/bp-gallery/src/graphql/APIConnector.tsx
+++ b/projects/bp-gallery/src/graphql/APIConnector.tsx
@@ -42,6 +42,7 @@ export type ArchiveTag = {
createdAt?: Maybe;
email?: Maybe;
exhibitions?: Maybe;
+ hidden?: Maybe;
links?: Maybe;
logo?: Maybe;
longDescription?: Maybe;
@@ -96,6 +97,7 @@ export type ArchiveTagFiltersInput = {
createdAt?: InputMaybe;
email?: InputMaybe;
exhibitions?: InputMaybe;
+ hidden?: InputMaybe;
id?: InputMaybe;
links?: InputMaybe;
longDescription?: InputMaybe;
@@ -116,6 +118,7 @@ export type ArchiveTagFiltersInput = {
export type ArchiveTagInput = {
email?: InputMaybe;
exhibitions?: InputMaybe>>;
+ hidden?: InputMaybe;
links?: InputMaybe>>;
logo?: InputMaybe;
longDescription?: InputMaybe;
@@ -2772,6 +2775,7 @@ export type GetAllArchiveTagsQuery = {
attributes?: {
name: string;
shortDescription?: string | null;
+ hidden?: boolean | null;
showcasePicture?: {
data?: {
id?: string | null;
@@ -2855,6 +2859,7 @@ export type GetArchiveQuery = {
paypalClient?: string | null;
paypalDonationText?: string | null;
paypalPurpose?: string | null;
+ hidden?: boolean | null;
restrictImageDownloading?: boolean | null;
logo?: {
data?: {
@@ -4569,6 +4574,7 @@ export const GetAllArchiveTagsDocument = gql`
attributes {
name
shortDescription
+ hidden
showcasePicture {
data {
id
@@ -4944,6 +4950,7 @@ export const GetArchiveDocument = gql`
paypalClient
paypalDonationText
paypalPurpose
+ hidden
restrictImageDownloading
logo {
data {
diff --git a/projects/bp-gallery/src/graphql/operation.graphql b/projects/bp-gallery/src/graphql/operation.graphql
index 8550b2ac5..ca81c6a8c 100644
--- a/projects/bp-gallery/src/graphql/operation.graphql
+++ b/projects/bp-gallery/src/graphql/operation.graphql
@@ -1,12 +1,12 @@
# NOTE: this file is auto-generated, edit /projects/bp-graphql/operations instead
query canRunOperation( $operation: String! $variableSets: [JSON!] $withSomeVariables: Boolean ) { canRunOperation( operation: $operation variableSets: $variableSets withSomeVariables: $withSomeVariables ) }
-query getAllArchiveTags($sortBy: [String] = ["createdAt:asc"]) { archiveTags(sort: $sortBy) { data { id attributes { name shortDescription showcasePicture { data { id attributes { media { data { attributes { url updatedAt provider } } } } } } } } } }
+query getAllArchiveTags($sortBy: [String] = ["createdAt:asc"]) { archiveTags(sort: $sortBy) { data { id attributes { name shortDescription hidden showcasePicture { data { id attributes { media { data { attributes { url updatedAt provider } } } } } } } } } }
query getAllCollections { collections(publicationState: PREVIEW) { data { id attributes { name parent_collections(publicationState: PREVIEW) { data { id attributes { name } } } } } } }
query getAllKeywordTags { keywordTags { data { id attributes { name visible synonyms { name } } } } }
query getAllLocationTags { getAllLocationTags }
query getAllPersonTags { personTags { data { id attributes { name synonyms { name } } } } }
query getAllPictureIds { pictures { data { id } } }
-query getArchive($archiveId: ID!) { archiveTag(id: $archiveId) { data { id attributes { name shortDescription longDescription email paypalClient paypalDonationText paypalPurpose restrictImageDownloading logo { data { id attributes { width height formats updatedAt provider } } } showcasePicture { data { id attributes { media { data { id attributes { width height formats url updatedAt provider } } } } } } links { data { id attributes { title url } } } } } } }
+query getArchive($archiveId: ID!) { archiveTag(id: $archiveId) { data { id attributes { name shortDescription longDescription email paypalClient paypalDonationText paypalPurpose hidden restrictImageDownloading logo { data { id attributes { width height formats updatedAt provider } } } showcasePicture { data { id attributes { media { data { id attributes { width height formats url updatedAt provider } } } } } } links { data { id attributes { title url } } } } } } }
query getArchiveNames( $filters: ArchiveTagFiltersInput = {} $sortBy: [String] = ["createdAt:asc"] ) { archiveTags(filters: $filters sort: $sortBy) { data { id attributes { name } } } }
query getArchivePictureCounts { archivePictureCounts { data { id attributes { count } } } }
query getCollectionInfoById($collectionId: ID!) { collection(id: $collectionId) { data { id attributes { name description child_collections(sort: "name:asc" publicationState: PREVIEW) { data { id attributes { name publishedAt pictures(pagination: { limit: 1 }) { data { id } } child_collections(pagination: { limit: 1 } publicationState: PREVIEW) { data { id } } parent_collections(publicationState: PREVIEW) { data { id attributes { name } } } } } } } } } }
diff --git a/projects/bp-gallery/src/graphql/schema/schema.json b/projects/bp-gallery/src/graphql/schema/schema.json
index 488fd627f..9feb72f65 100644
--- a/projects/bp-gallery/src/graphql/schema/schema.json
+++ b/projects/bp-gallery/src/graphql/schema/schema.json
@@ -4987,6 +4987,16 @@
},
"defaultValue": null
},
+ {
+ "name": "hidden",
+ "description": null,
+ "type": {
+ "kind": "INPUT_OBJECT",
+ "name": "BooleanFilterInput",
+ "ofType": null
+ },
+ "defaultValue": null
+ },
{
"name": "createdAt",
"description": null,
@@ -5208,6 +5218,16 @@
},
"defaultValue": null
},
+ {
+ "name": "hidden",
+ "description": null,
+ "type": {
+ "kind": "SCALAR",
+ "name": "Boolean",
+ "ofType": null
+ },
+ "defaultValue": null
+ },
{
"name": "publishedAt",
"description": null,
@@ -5513,6 +5533,18 @@
"isDeprecated": false,
"deprecationReason": null
},
+ {
+ "name": "hidden",
+ "description": null,
+ "args": [],
+ "type": {
+ "kind": "SCALAR",
+ "name": "Boolean",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
{
"name": "createdAt",
"description": null,
diff --git a/projects/bp-gallery/src/shared/locales/de.json b/projects/bp-gallery/src/shared/locales/de.json
index b3cd0719a..154444a07 100755
--- a/projects/bp-gallery/src/shared/locales/de.json
+++ b/projects/bp-gallery/src/shared/locales/de.json
@@ -530,6 +530,7 @@
"thankyou-label": "Vielen Dank für Ihre Spende von {{amount}}€",
"error-label": "Es ist ein Fehler aufgetreten. Es wurde nichts von ihrem Konto abgebucht, bitte versuchen Sie es erneut."
},
+ "hidden": "Archiv verstecken",
"restrictImageDownloading": "Herunterladen von Bildern einschränken"
}
},
diff --git a/projects/bp-graphql/src/operations/getAllArchiveTags.ts b/projects/bp-graphql/src/operations/getAllArchiveTags.ts
index b08eb8fce..cf048db4b 100644
--- a/projects/bp-graphql/src/operations/getAllArchiveTags.ts
+++ b/projects/bp-graphql/src/operations/getAllArchiveTags.ts
@@ -10,6 +10,7 @@ export default {
attributes {
name
shortDescription
+ hidden
showcasePicture {
data {
id
diff --git a/projects/bp-graphql/src/operations/getArchive.ts b/projects/bp-graphql/src/operations/getArchive.ts
index 52ac3dde9..5d13c4dc6 100644
--- a/projects/bp-graphql/src/operations/getArchive.ts
+++ b/projects/bp-graphql/src/operations/getArchive.ts
@@ -15,6 +15,7 @@ export default {
paypalClient
paypalDonationText
paypalPurpose
+ hidden
restrictImageDownloading
logo {
data {
diff --git a/projects/bp-strapi/src/api/archive-tag/content-types/archive-tag/schema.json b/projects/bp-strapi/src/api/archive-tag/content-types/archive-tag/schema.json
index 10ed9ac61..f44304e35 100644
--- a/projects/bp-strapi/src/api/archive-tag/content-types/archive-tag/schema.json
+++ b/projects/bp-strapi/src/api/archive-tag/content-types/archive-tag/schema.json
@@ -43,7 +43,9 @@
"type": "media",
"multiple": false,
"required": false,
- "allowedTypes": ["images"]
+ "allowedTypes": [
+ "images"
+ ]
},
"paypalClient": {
"type": "string"
@@ -65,6 +67,10 @@
"relation": "oneToMany",
"target": "api::exhibition.exhibition",
"mappedBy": "archive_tag"
+ },
+ "hidden": {
+ "type": "boolean",
+ "default": false
}
}
-}
\ No newline at end of file
+}