Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .changeset/fifty-rice-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@frontify/guideline-blocks-settings": patch
"@frontify/app-bridge": patch
---

chore: remove empty visibility property from Document and DocumentPage type definitions
1 change: 0 additions & 1 deletion packages/app-bridge/src/AppBridgeTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ export interface AppBridgeTheme<
* @property title - Indicates title of a page.
* @property documentId - Indicates to witch document the page belongs to.
* @property categoryId - Indicates to witch category the page belongs to.
* @property visibility - Indicates whether the page is visible only to the editor or everyone.
* @property linkUrl - Indicates whether the page is link or not.
*/
updateDocumentPage(documentPage: DocumentPageUpdate): Promise<DocumentPage>;
Expand Down
1 change: 0 additions & 1 deletion packages/app-bridge/src/react/useGuidelineActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ export const useGuidelineActions = (appBridge: AppBridgeTheme) => {
* @property title - Indicates title of a page.
* @property documentId - Indicates to witch document the page belongs to.
* @property categoryId - Indicates to witch category the page belongs to.
* @property visibility - Indicates whether the page is visible only to the editor or everyone.
* @property linkUrl - Indicates whether the page is link or not.
*/
const updateDocumentPage = useCallback(
Expand Down
1 change: 0 additions & 1 deletion packages/app-bridge/src/tests/DocumentApiDummy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export class DocumentApiDummy {
project_id: 345,
valid_from: '2022-03-03t15:41:33.000+00:00',
valid_to: null,
visibility: 'private',
portal_id: 3495,
title: `Document ${id}`,
slug: `document-${id}`,
Expand Down
4 changes: 1 addition & 3 deletions packages/app-bridge/src/tests/DocumentPageApiDummy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* (c) Copyright Frontify Ltd., all rights reserved. */

import { type DocumentPageApi, DocumentPageVisibility } from '../types';
import { type DocumentPageApi } from '../types';

export class DocumentPageApiDummy {
static with(id: number): DocumentPageApi {
Expand All @@ -21,7 +21,6 @@ export class DocumentPageApiDummy {
link_type: 'INTERNAL',
link_url: null,
view_count: 0,
visibility: DocumentPageVisibility.Everyone,
targets: null,
permanent_link: `/r/document-page-${id}`,
};
Expand All @@ -44,7 +43,6 @@ export class DocumentPageDuplicateApiDummy {
name: 'Document page duplicate dummy',
sections: [],
url: `document-page-duplicate-dummy-${id}`,
visibility: 'EVERYONE',
},
};
}
Expand Down
1 change: 0 additions & 1 deletion packages/app-bridge/src/types/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type DocumentApi = Simplify<
document_group_id?: Nullable<number>;
valid_from: string;
valid_to: Nullable<string>;
visibility: Nullable<string>;
portal_id: Nullable<number>;
title: string;
slug: Nullable<string>;
Expand Down
9 changes: 1 addition & 8 deletions packages/app-bridge/src/types/DocumentPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import { type CamelCasedPropertiesDeep, type RequireAtLeastOne, type SetRequired

import { type SingleTargetApi } from './Targets';

export enum DocumentPageVisibility {
Everyone = 'EVERYONE',
Editor = 'EDITOR',
}

type DocumentPageApiAsLink = {
link_type: 'EXTERNAL';
link_url: string;
Expand All @@ -34,7 +29,6 @@ export type DocumentPageApi = {
slug: string;
sort: number;
view_count: number;
visibility: DocumentPageVisibility;
targets: Nullable<SingleTargetApi['target'][]>;
category?: Nullable<Record<string, unknown>>;
parent_document?: Nullable<Record<string, unknown>>;
Expand All @@ -51,14 +45,13 @@ type DocumentPageRequest = {
documentId: number;
linkUrl?: Nullable<string>;
categoryId?: Nullable<number>;
visibility?: DocumentPageVisibility;
};

export type DocumentPageCreate = Omit<SetRequired<DocumentPageRequest, 'title' | 'documentId'>, 'id'>;

export type DocumentPageUpdate = RequireAtLeastOne<
DocumentPageRequest,
'documentId' | 'categoryId' | 'linkUrl' | 'title' | 'visibility'
'documentId' | 'categoryId' | 'linkUrl' | 'title'
>;

export type DocumentPageDelete = Pick<DocumentPageRequest, 'id' | 'documentId' | 'categoryId'>;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* (c) Copyright Frontify Ltd., all rights reserved. */

import { DocumentPageVisibility, type DocumentPageApi } from '@frontify/app-bridge';
import { type DocumentPageApi } from '@frontify/app-bridge';

enum LinkType {
External = 'EXTERNAL',
Expand Down Expand Up @@ -37,7 +37,6 @@ type DocumentApi = {
document_group_id?: number | null;
valid_from: string;
valid_to: string | null;
visibility: string | null;
portal_id: number | null;
title: string;
slug: string | null;
Expand Down Expand Up @@ -88,7 +87,6 @@ export class DocumentApiDummy {
project_id: 345,
valid_from: '2022-03-03t15:41:33.000+00:00',
valid_to: null,
visibility: 'private',
portal_id: 3495,
title: `Document ${id}`,
slug: `document-${id}`,
Expand Down Expand Up @@ -137,7 +135,6 @@ export class DocumentPageApiDummy {
link_type: 'INTERNAL',
link_url: null,
view_count: 0,
visibility: DocumentPageVisibility.Everyone,
targets: null,
permanent_link: `/r/document-page-${id}`,
} as DocumentPageApi;
Expand Down
Loading