@contrail/flexplm 1.7.1-alpha.69baa36 → 1.7.1-alpha.78479d6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -136,8 +136,8 @@ class ThumbnailUtil {
|
|
|
136
136
|
const eventData = event.data || {};
|
|
137
137
|
const newThumbnailId = eventData[ThumbnailUtil.NEW_THUMBNAIL_ID];
|
|
138
138
|
const existingThumbnailId = eventData[ThumbnailUtil.EXISTING_THUMBNAIL_ID];
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const iteratedThumbnailId = eventData[ThumbnailUtil.THUMBNAIL];
|
|
140
|
+
const thumbnailUrl = iteratedThumbnailId || newThumbnailId || existingThumbnailId;
|
|
141
141
|
// Case 1: REMOVE_THUMBNAIL
|
|
142
142
|
if (newThumbnailId === ThumbnailUtil.REMOVE_THUMBNAIL) {
|
|
143
143
|
if (primaryViewableId) {
|
|
@@ -319,7 +319,6 @@ describe('ThumbnailUtil Tests', () => {
|
|
|
319
319
|
tinyViewableUrl: null,
|
|
320
320
|
};
|
|
321
321
|
mockContentCreate.mockResolvedValue(createdContent);
|
|
322
|
-
// const event = { data: { [ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/thumb.png' } };
|
|
323
322
|
const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/thumb.png' } };
|
|
324
323
|
await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event, entityName: 'color' });
|
|
325
324
|
expect(mockGetRequest).toHaveBeenCalledWith({ urlPath: '/rest/thumbnail/thumb.png', includeUrlContext: false, returnFullResponse: true });
|
|
@@ -351,8 +350,7 @@ describe('ThumbnailUtil Tests', () => {
|
|
|
351
350
|
primaryFileUrl: 'https://files/primary.png', largeViewableUrl: null,
|
|
352
351
|
mediumLargeViewableUrl: null, mediumViewableUrl: null, smallViewableUrl: null, tinyViewableUrl: null,
|
|
353
352
|
});
|
|
354
|
-
|
|
355
|
-
const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/my image.png' } };
|
|
353
|
+
const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/my image.png' } };
|
|
356
354
|
await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event, entityName: 'color' });
|
|
357
355
|
expect(mockGetRequest).toHaveBeenCalledWith({
|
|
358
356
|
urlPath: '/rest/thumbnail/my%20image.png',
|
|
@@ -372,8 +370,7 @@ describe('ThumbnailUtil Tests', () => {
|
|
|
372
370
|
primaryFileUrl: 'https://files/primary.jpg', largeViewableUrl: null,
|
|
373
371
|
mediumLargeViewableUrl: null, mediumViewableUrl: null, smallViewableUrl: null, tinyViewableUrl: null,
|
|
374
372
|
});
|
|
375
|
-
|
|
376
|
-
const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/café-logo.jpg' } };
|
|
373
|
+
const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/café-logo.jpg' } };
|
|
377
374
|
await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event, entityName: 'item' });
|
|
378
375
|
expect(mockGetRequest).toHaveBeenCalledWith({
|
|
379
376
|
urlPath: '/rest/thumbnail/caf%C3%A9-logo.jpg',
|
|
@@ -408,8 +405,7 @@ describe('ThumbnailUtil Tests', () => {
|
|
|
408
405
|
tinyViewableUrl: null,
|
|
409
406
|
};
|
|
410
407
|
mockContentCreate.mockResolvedValue(createdContent);
|
|
411
|
-
|
|
412
|
-
const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/new.jpg' } };
|
|
408
|
+
const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/new.jpg' } };
|
|
413
409
|
await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', primaryViewableId: 'oldPv', event, entityName: 'item' });
|
|
414
410
|
// Creates new content
|
|
415
411
|
expect(mockContentCreate).toHaveBeenCalled();
|