Skip to content

Commit c7d87a7

Browse files
committed
feat: PieceGeneric type - optional nameShort and nameTruncated
1 parent 8a83cf0 commit c7d87a7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/blueprints-integration/src/documents/pieceGeneric.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ export interface IBlueprintPieceGeneric<TPrivateData = unknown, TPublicData = un
3434
externalId: string
3535
/** User-presentable name for the timeline item */
3636
name: string
37+
/** Optionals that can be used to have production specific handling of truncation and shortening */
38+
/** nameShort should be less than 20 characters */
39+
/** nameTruncated should be less than 50 characters */
40+
/** e.g: A nameTruncated with the first part and the last part of a very long "path+fileName" */
41+
nameShort?: string
42+
nameTruncated?: string
43+
3744
/** Arbitraty data storage for internal use in the blueprints */
3845
privateData?: TPrivateData
3946
/** Arbitraty data relevant for other systems, made available to them through APIs */

packages/job-worker/src/blueprints/context/lib.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export const IBlueprintPieceObjectsSampleKeys = allKeysOfObject<IBlueprintPiece>
8080
pieceType: true,
8181
extendOnHold: true,
8282
name: true,
83+
nameShort: true,
84+
nameTruncated: true,
8385
privateData: true,
8486
publicData: true,
8587
sourceLayerId: true,
@@ -201,6 +203,8 @@ function convertPieceGenericToBlueprintsInner(piece: ReadonlyDeep<PieceGeneric>)
201203
const obj: Complete<IBlueprintPieceGeneric> = {
202204
externalId: piece.externalId,
203205
name: piece.name,
206+
nameShort: piece.nameShort,
207+
nameTruncated: piece.nameTruncated,
204208
privateData: clone(piece.privateData),
205209
publicData: clone(piece.publicData),
206210
lifespan: piece.lifespan,

0 commit comments

Comments
 (0)