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
5 changes: 5 additions & 0 deletions databox/indexer/src/handlers/phraseanet/StructureImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export async function addMissingRenditionsConf(
if (!dm.renditions[sd.name]) {
dm.renditions[sd.name] = {
policy: sd.class,
policyAssetEditable: false,
buildMode: RenditionBuildMode.BUILD_FROM_PARENT,
parent: 'main',
useAsPreview: sd.name === 'preview' ? true : undefined,
Expand Down Expand Up @@ -181,6 +182,7 @@ export async function importSubdefsStructure(
useAsAnimatedThumbnail: boolean;
types: Record<string, PhraseanetSubdefStruct>;
policy: string | null;
policyAssetEditable: boolean | false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
policyAssetEditable: boolean | false;
policyAssetEditable: boolean;

labels: Record<string, string>;
}
> = {};
Expand Down Expand Up @@ -213,6 +215,7 @@ export async function importSubdefsStructure(
rendition.useAsAnimatedThumbnail ?? false,
types: {} as Record<string, PhraseanetSubdefStruct>,
policy: rendition['policy'] ?? null,
policyAssetEditable: rendition['policyAssetEditable'] ?? false,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
policyAssetEditable: rendition['policyAssetEditable'] ?? false,
policyAssetEditable: rendition.policyAssetEditable ?? false,

labels: {},
};
}
Expand Down Expand Up @@ -251,6 +254,7 @@ export async function importSubdefsStructure(
subdefToRendition[settings['from']].push(name);
sdByName[name].types[sd.type] = sd;
sdByName[name].labels = sd.labels; // todo: check conflicts
sdByName[name].policyAssetEditable = rendition.policyAssetEditable ?? false;
if (!rendition.policy) {
// use phrnet class
if (sdByName[name].policy === null) {
Expand Down Expand Up @@ -289,6 +293,7 @@ export async function importSubdefsStructure(
name: sd.policy,
workspace: `/workspaces/${workspaceId}`,
public: true,
editable: sd.policyAssetEditable,
});
}

Expand Down
1 change: 1 addition & 0 deletions databox/indexer/src/handlers/phraseanet/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type ConfigPhraseanetSubdef = {
useAsAnimatedThumbnail?: boolean;
buildMode?: number;
policy?: string;
policyAssetEditable?: boolean;
parent?: string | null;
builders: Record<string, ConfigRenditionBuilder>;
};
Expand Down
Loading