Meet us at Drupa 24. Dusseldorf/Germany. May. 28 - Jun 7.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
snavas  
#1 Posted : Wednesday, October 16, 2019 10:33:30 PM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

I'm trying to integrate the UIFrameWork with Drupal 7 Commerce and I'm currently using the calendar.json configs for testing and things are working fine with exception to editing. So, I can currently load the editor, modify the PSD, on finishing, send it off to Customers Canvas and I successfully get back a stateID. The problem occurs when I try to edit that after.

When trying to edit the saved version that we just created, the editor loads the original initially, instead of our changes. We have to then click on the 'Revert' button to see our changes again. Once revert is clicked, our saved changes appear, however, the HeaderType doesn't change on the left side bar. It remains on the first one instead of the Header that we had selected prior. So, it's almost like we have to redo our changes again when editing a saved version.

I'm using version 3.8.6 of the UI Framework. The configs are almost identical to the sample for original calendar.json. Any help would be appreciated. Thanks.

customers_canvas_edit.gif

Edited by user Wednesday, October 16, 2019 10:42:10 PM(UTC)  | Reason: Not specified

snavas  
#2 Posted : Monday, October 21, 2019 12:32:26 AM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Thanks for replying. So, I've added it and this is what my onActivate currently looks like:

Quote:
"onActivate": [
"{{ #function $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct(TRUE)},1000) }) }}",
"{{ #function $['cc'].getHiResImages(800,800) }}"
]


However, adding that new line still doesn't load my saved changes when I edit the PSD. Instead, it actually resets the state to the original (unedited version) when I try to preview a change and hit 'Back'. So, not sure what to do. This is my full config:

Quote:
{
"vars": {
"psdApiUrl": "https://h.customerscanvas.com/online-demo/PsdWebService/",
"designs": [{
"title": "Rectangle",
"name": "clients/mycalendars/new/rectangle"
}, {
"title": "Oval",
"name": "clients/mycalendars/new/oval"
}, {
"title": "Left Circle",
"name": "clients/mycalendars/new/left-circle"
}, {
"title": "Top Circle",
"name": "clients/mycalendars/new/top-circle"
}]
},
"language": "en",
"widgets": [{
"name": "image-request",
"type": "ajax",
"params": {
"url": "{{vars.psdApiUrl + '/api/preview'}}",
"lock": "preview",
"method": "POST",
"responseType": "json",
"request": {
"template": "{{ 'mockups/clients/mycalendars/new/preview-mockup-' + $['design-variation']._.name.split('/')[3] }}",
"format": "png",
"unsharpMask": "(1.2, 0.5, 0.05)",
"data": {
"Design": {
"type": "image",
"image": "{{$['cc'].hiResUrls[0]}}",
"dpix": 300,
"dpiY": 300
}
}
}
}
}, {
"name": "preview",
"type": "image-carousel",
"params": {
"containerColor": "#ffffff",
"showImageIndex": false,
"images": [{
"url": "{{$['image-request'].response}}"
}]
}
}, {
"name": "finish-button",
"type": "finish-button",
"params": {
"enabled": true,
"visible": true,
"onClick": ["{{#function $['cc'].getHiResImages(800,800)}}", "{{#function $['order-details'].widgetUpdated}}"]
}
}, {
"name": "order-details",
"type": "order",
"params": {
"images": "{{ [$['image-request'].response] }}",
"downloadUrls": "{{ $['cc'].hiResUrls }}",
"data": "{{ $['cc'].stateId }}"
}
}, {
"name": "option-list",
"type": "group",
"params": {
"type": "noncollapsible",
"tabs": [{
"widgets": [{
"type": "gallery",
"name": "design-variation",
"title": "Header Type",
"params": {
"showTitle": true,
"forceSelection": true,
"items": {
"{{ #each vars.designs as design }}": {
"name": "{{ design.name}}",
"title": "{{ design.title}}",
"previewUrl": "{{ settings.customersCanvasBaseUrl + '/api/ProductTemplates/designs/' + design.name + '?width=400&height=400'}}"
}
}
}
}]
}]
}
}, {
"name": "cc",
"type": "canvas",
"params": {
"initial": {
"editorConfig": {
"defaultItemsConfig": {
"image": {
"width": "50%",
"location": {
"x": "50%",
"y": "50%",
"originX": "center",
"originY": "center"
}
},
"text": {
"font": {
"postScriptName": "ArialMT",
"size": 24,
"fauxBold": false,
"fauxItalic": false
},
"color": "#000"
}
},
"initialMode": "Advanced",
"fontList": {
"appFonts": ["*"]
},
"autoLoadUserInfo": true,
"restoreProductOnReloadEnabled": false,
"canvas": {
"shadowEnabled": false,
"violationWarningButtonsEnabled": true,
"color": "white",
"rulers": {
"enabled": false
}
},
"rendering": {
"proofImageWatermarkEnabled": false
},
"violationWarningsSettings": {
"safetyLineViolationWarningEnabled": true
},
"watermark": {
"text": {
"opacity": 0
}
},
"widgets": {
"TopToolbar": {
"zOrderButtonsEnabled": false,
"textShadowButtonEnabled": false,
"textFontStyleButtonEnabled": false,
"textStrokeButtonEnabled": false,
"opacitySliderEnabled": false,
"imageEditButtonEnabled": false,
"zOrder": {
"zOrderLevelButtonsEnabled": false,
"zOrderSendToButtonsEnabled": false
},
"fontSize": {
"max": 72,
"min": 6,
"step": 1
}
},
"Toolbox": {
"buttons": [{
"translationKey": "Toolbox.TEXT",
"translationKeyTitle": "Toolbox.TITLE_ADD_TEXT",
"iconClass": "cc-icon-add-text",
"buttons": ["Text"]
}, {
"translationKey": "Toolbox.ADD_IMAGE",
"translationKeyTitle": "Toolbox.TITLE_ADD_IMAGE",
"iconClass": "cc-icon-add-image",
"action": "Image",
"tabs": ["My Files"]
}, {
"translationKey": "Toolbox.SHAPE",
"translationKeyTitle": "Toolbox.TITLE_ADD_SHAPE",
"iconClass": "cc-icon-add-shape",
"buttons": ["Line", "Rectangle", "Ellipse"]
}]
},
"ItemMenu": {
"objectManipulationEnabled": true,
"verticalAlignmentEnabled": false,
"horizontalAlignmentEnabled": false,
"changeZOrderEnabled": false
},
"BottomToolbar": {
"snapLinesCheckboxEnabled": false,
"gridCheckboxEnabled": false
},
"ObjectInspector": {
"aboveCanvasOnSmallScreenEnabled": true,
"bgItemEnabled": false,
"position": "Right",
"isHidden": true
},
"GalleryDialog": {
"publicFolderName": "",
"downloadPsdAsImage": false,
"defaultTabName": "My Files",
"tabs": [{
"name": "My Files",
"type": "user",
"categoriesEnabled": true,
"canEdit": true,
"canUpload": true
}]
},
"FinishButton": {
"mode": "Disabled"
}
}
},
"productDefinition": {
"surfaces": [{
"printAreas": [{
"designFile": "{{vars.designs[0].name}}"
}]
}]
}
},
"setPrintArea": {
"{{#if $['design-variation']._}}": {
"options": {
"preserveUserChanges": true,
"updateRevertData": false
},
"data": {
"designFile": "{{ $['design-variation']._.name }}"
}
},
"{{#else}}": {}
}
}
}],
"steps": [{
"name": "Design",
"title": "Design",
"mainPanel": {
"name": "cc"
},
"toolPanel": {
"name": "option-list"
}
}, {
"title": "Preview",
"name": "Preview",
"mainPanel": {
"name": "preview"
},
"onActivate": [
"{{ #function $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct()},1000) }) }}",
"{{ #function $['cc'].getHiResImages(800,800) }}"
]
}],
"userId": 1
}



snavas  
#3 Posted : Monday, October 21, 2019 5:55:38 AM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

I'm getting errors when I add it under the editor section of the Canvas block:

au.editor.js:681 2019-10-21 19:12:08,450 ERROR [au-widget-canvas3] Failed to perform an action on Customer's Canvas.
Unexpected error object was passed in. Could not resolve it, stringified object: {"msg":"updatePrintAreas failed","exception":{"__zone_symbol__currentTask":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"<root>","cancelFn":null,"runCount":0}}}

I'm using editor version 3.8.6 and as I mentioned, my config json looks like the above ^^.
snavas  
#4 Posted : Monday, October 21, 2019 9:48:38 PM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Thanks for continuing to help me. Really appreciate it! Unfortunately, neither of those changes are getting the latest changes to load on editing the saved version. :( I'm seeing this error in the console as well:

au.editor.js:681 2019-10-22 11:15:48,801 ERROR [au-widget-canvas3] Failed to perform an action on Customer's Canvas.
Unexpected error object was passed in. Could not resolve it, stringified object: {"msg":"updatePrintAreas failed","exception":{"__zone_symbol__currentTask":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"<root>","cancelFn":null,"runCount":0}}}

To make things worse, at the moment, we can't upgrade the editor to the latest version either because it was breaking a lot of things.

So, really, have no idea where/how to add config to load the latest saved version. My latest changes:

Quote:
{
"vars": {
"psdApiUrl": "https://h.customerscanvas.com/online-demo/PsdWebService/"
},
"language": "en",
"widgets": [
{
"name": "image-request",
"type": "ajax",
"params": {
"url": "{{vars.psdApiUrl + '/api/preview'}}",
"lock": "preview",
"method": "POST",
"responseType": "json",
"request": {
"template": "{{ 'mockups/clients/example/new/preview-mockup-' + $['design-variation']._.name.split('/')[3] }}",
"format": "png",
"unsharpMask": "(1.2, 0.5, 0.05)",
"data": {
"Design": {
"type": "image",
"image": "{{$['cc'].hiResUrls[0]}}",
"dpix": 300,
"dpiY": 300
}
}
}
}
},
{
"name": "preview",
"type": "image-carousel",
"params": {
"containerColor": "#ffffff",
"showImageIndex": false,
"images": [
{
"url": "{{$['image-request'].response}}"
}
]
}
},
{
"name": "finish-button",
"type": "finish-button",
"params": {
"enabled": true,
"visible": true,
"onClick": [
"{{#function $['cc'].getHiResImages(800,800)}}",
"{{#function $['order-details'].widgetUpdated}}"
]
}
},
{
"name": "order-details",
"type": "order",
"params": {
"images": "{{ [$['image-request'].response] }}",
"downloadUrls": "{{ $['cc'].hiResUrls }}",
"data": "{{ $['cc'].stateId }}"
}
},
{
"name": "option-list",
"type": "group",
"params": {
"type": "noncollapsible",
"tabs": [
{
"widgets": [
{
"type": "gallery",
"name": "design-variation",
"title": "Header Type",
"params": {
"showTitle": true,
"forceSelection": true,
"items": {
"{{ #each vars.designs as design }}": {
"name": "{{ design.name}}",
"title": "{{ design.title}}",
"previewUrl": "{{ settings.customersCanvasBaseUrl + '/api/ProductTemplates/designs/' + design.name + '?width=400&height=400'}}"
}
}
}
}
]
}
]
}
},
{
"name": "cc",
"type": "canvas",
"params": {
"initial": {
"editorConfig": {
"defaultItemsConfig": {
"image": {
"width": "50%",
"location": {
"x": "50%",
"y": "50%",
"originX": "center",
"originY": "center"
}
},
"text": {
"font": {
"postScriptName": "Roboto-Medium",
"size": 24,
"fauxBold": false,
"fauxItalic": false
},
"color": "#000"
}
},
"defaultProductTheme": "Beige",
"productThemes": {
"Beige": {
"C01": "#dac0a3"
}
},
"initialMode": "Advanced",
"fontList": {
"appFonts": [
"*"
]
},
"autoLoadUserInfo": true,
"restoreProductOnReloadEnabled": false,
"canvas": {
"shadowEnabled": false,
"violationWarningButtonsEnabled": true,
"color": "white",
"rulers": {
"enabled": false
}
},
"rendering": {
"proofImageWatermarkEnabled": false
},
"violationWarningsSettings": {
"safetyLineViolationWarningEnabled": true
},
"watermark": {
"text": {
"opacity": 0
}
},
"widgets": {
"onActivate": [
"{{ #function (()=> { if (!window.isRevert) { $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct()},1000) }); window.isRevert = true; } })() }}"
],
"TopToolbar": {
"zOrderButtonsEnabled": false,
"textShadowButtonEnabled": false,
"textFontStyleButtonEnabled": false,
"textStrokeButtonEnabled": false,
"opacitySliderEnabled": false,
"imageEditButtonEnabled": false,
"zOrder": {
"zOrderLevelButtonsEnabled": false,
"zOrderSendToButtonsEnabled": false
},
"fontSize": {
"max": 72,
"min": 6,
"step": 1
}
},
"Toolbox": {
"buttons": [
{
"translationKey": "Toolbox.TEXT",
"translationKeyTitle": "Toolbox.TITLE_ADD_TEXT",
"iconClass": "cc-icon-add-text",
"buttons": [
"Text"
]
},
{
"translationKey": "Toolbox.ADD_IMAGE",
"translationKeyTitle": "Toolbox.TITLE_ADD_IMAGE",
"iconClass": "cc-icon-add-image",
"action": "Image",
"tabs": [
"My Files"
]
},
{
"translationKey": "Toolbox.SHAPE",
"translationKeyTitle": "Toolbox.TITLE_ADD_SHAPE",
"iconClass": "cc-icon-add-shape",
"buttons": [
"Line",
"Rectangle",
"Ellipse"
]
}
]
},
"ItemMenu": {
"objectManipulationEnabled": true,
"verticalAlignmentEnabled": false,
"horizontalAlignmentEnabled": false,
"changeZOrderEnabled": false
},
"BottomToolbar": {
"snapLinesCheckboxEnabled": false,
"gridCheckboxEnabled": false
},
"ObjectInspector": {
"aboveCanvasOnSmallScreenEnabled": true,
"bgItemEnabled": false,
"position": "Right",
"isHidden": true
},
"GalleryDialog": {
"publicFolderName": "",
"downloadPsdAsImage": false,
"defaultTabName": "My Files",
"tabs": [
{
"name": "My Files",
"type": "user",
"categoriesEnabled": true,
"canEdit": true,
"canUpload": true
}
]
},
"FinishButton": {
"mode": "Disabled"
}
}
}
},
"setPrintArea": {
"{{#if $['design-variation']._}}": {
"options": {
"preserveUserChanges": true,
"updateRevertData": false
},
"data": {
"designFile": "{{ $['design-variation']._.name }}"
}
},
"{{#else}}": {}
}
}
}
],
"steps": [
{
"name": "Design",
"title": "Design",
"mainPanel": {
"name": "cc"
},
"toolPanel": {
"name": "option-list"
}
},
{
"title": "Preview",
"name": "Preview",
"mainPanel": {
"name": "preview"
},
"onActivate": [
"{{ #function $['cc'].getHiResImages(800,800) }}"
]
}
]
}

Edited by user Friday, November 8, 2019 1:28:12 AM(UTC)  | Reason: Not specified

snavas  
#5 Posted : Tuesday, October 22, 2019 8:34:28 AM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Yeah, unfortunately, updating the UIFramework is not something we can do right now. I'd appreciate it if we could try and get this current version to work. Please let me know what you'd need from my end. The config I posted above is the latest code.
snavas  
#6 Posted : Thursday, November 7, 2019 11:58:59 PM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Hi Anatoli,

I've now updated our code to use the latest aurigma editor, verison 4.5.5 and it is still doing the exact same thing. When editing the file, the editor doesn't load the saved changes. The Header Type doesn't change either. Seems like we're missing something in the config, perhaps, the setting in the setPrintArea is wrong? Could you please take a look at our config and let me know if we're missing anything:

Quote:
{
"vars": {
"psdApiUrl": "https://h.customerscanvas.com/Users/XXXX/DI",
"designs": [{
"title": "Rectangle",
"name": "clients/example/new/rectangle"
}, {
"title": "Oval",
"name": "clients/example/new/oval"
}, {
"title": "Left Circle",
"name": "clients/example/new/left-circle"
}, {
"title": "Top Circle",
"name": "clients/example/new/top-circle"
}]
},
"language": "en",
"widgets": [{
"name": "image-request",
"type": "ajax",
"params": {
"url": "{{vars.psdApiUrl + '/api/preview'}}",
"lock": "preview",
"method": "POST",
"responseType": "json",
"request": {
"template": "{{ 'clients/example/new/preview-mockup-' + $['design-variation']._.name.split('/')[3] }}",
"format": "png",
"unsharpMask": "(1.2, 0.5, 0.05)",
"data": {
"Design": {
"type": "image",
"image": "{{$['cc'].hiResUrls[0]}}",
"dpix": 300,
"dpiY": 300
}
}
}
}
}, {
"name": "finish-button",
"type": "finish-button",
"params": {
"enabled": true,
"visible": true,
"onClick": ["{{#function $['cc'].getHiResImages(800,800)}}", "{{#function $['order-details'].widgetUpdated}}"]
}
}, {
"name": "order-details",
"type": "order",
"params": {
"images": {
"{{#each $['cc'].proofImageUrls}}": "{{item[0]}}"
},
"downloadUrls": ["{{$['cc'].hiResUrls[0]}}"],
"data": {
"stateId": "{{$['cc'].stateId}}",
"userId": "{{$['cc'].userId}}"
}
}
}, {
"name": "option-list",
"type": "group",
"params": {
"type": "noncollapsible",
"tabs": [{
"widgets": [{
"type": "gallery",
"name": "design-variation",
"title": "Header Type",
"params": {
"showTitle": true,
"forceSelection": true,
"items": {
"{{ #each vars.designs as design }}": {
"name": "{{ design.name}}",
"title": "{{ design.title}}",
"previewUrl": "{{ settings.customersCanvasBaseUrl + '/api/ProductTemplates/designs/' + design.name + '?width=400&height=400'}}"
}
}
}
}]
}]
}
}, {
"name": "cc",
"type": "canvas",
"params": {
"initial": {
"editorConfig": {
"defaultItemsConfig": {
"image": {
"width": "50%",
"location": {
"x": "50%",
"y": "50%",
"originX": "center",
"originY": "center"
}
},
"text": {
"font": {
"postScriptName": "ArialMT",
"size": 24,
"fauxBold": false,
"fauxItalic": false
},
"color": "#000"
}
},
"initialMode": "Advanced",
"fontList": {
"appFonts": ["*"]
},
"autoLoadUserInfo": true,
"restoreProductOnReloadEnabled": false,
"canvas": {
"shadowEnabled": false,
"violationWarningButtonsEnabled": true,
"color": "white",
"rulers": {
"enabled": false
}
},
"rendering": {
"proofImageWatermarkEnabled": false
},
"violationWarningsSettings": {
"safetyLineViolationWarningEnabled": true
},
"watermark": {
"text": {
"opacity": 0
}
},
"widgets": {
"TopToolbar": {
"zOrderButtonsEnabled": false,
"textShadowButtonEnabled": false,
"textFontStyleButtonEnabled": false,
"textStrokeButtonEnabled": false,
"opacitySliderEnabled": false,
"imageEditButtonEnabled": false,
"zOrder": {
"zOrderLevelButtonsEnabled": false,
"zOrderSendToButtonsEnabled": false
},
"fontSize": {
"max": 72,
"min": 6,
"step": 1
}
},
"Toolbox": {
"buttons": [{
"translationKey": "Toolbox.TEXT",
"translationKeyTitle": "Toolbox.TITLE_ADD_TEXT",
"iconClass": "cc-icon-add-text",
"buttons": ["Text"]
}, {
"translationKey": "Toolbox.ADD_IMAGE",
"translationKeyTitle": "Toolbox.TITLE_ADD_IMAGE",
"iconClass": "cc-icon-add-image",
"action": "Image",
"tabs": ["My Files"]
}, {
"translationKey": "Toolbox.SHAPE",
"translationKeyTitle": "Toolbox.TITLE_ADD_SHAPE",
"iconClass": "cc-icon-add-shape",
"buttons": ["Line", "Rectangle", "Ellipse"]
}]
},
"ItemMenu": {
"objectManipulationEnabled": true,
"verticalAlignmentEnabled": false,
"horizontalAlignmentEnabled": false,
"changeZOrderEnabled": false
},
"BottomToolbar": {
"snapLinesCheckboxEnabled": false,
"gridCheckboxEnabled": false
},
"ObjectInspector": {
"aboveCanvasOnSmallScreenEnabled": true,
"bgItemEnabled": false,
"position": "Right",
"isHidden": true
},
"GalleryDialog": {
"publicFolderName": "",
"downloadPsdAsImage": false,
"defaultTabName": "My Files",
"tabs": [{
"name": "My Files",
"type": "user",
"categoriesEnabled": true,
"canEdit": true,
"canUpload": true
}]
},
"FinishButton": {
"mode": "Disabled"
}
}
},
"productDefinition": {
"surfaces": [{
"printAreas": [{
"designFile": "{{vars.designs[0].name}}"
}]
}]
}
},
"setPrintArea": {
"{{#if $['design-variation']._}}": {
"options": {
"preserveUserChanges": true,
"updateRevertData": false
},
"data": {
"designFile": "{{ $['design-variation']._.name }}"
}
},
"{{#else}}": {}
}
}
}],
"steps": [{
"name": "Design",
"title": "Design",
"mainPanel": {
"name": "cc"
},
"toolPanel": {
"name": "option-list"
}
}],
"userId": 1
}


Thank you.

Edited by user Friday, November 8, 2019 1:27:23 AM(UTC)  | Reason: Not specified

snavas  
#7 Posted : Friday, November 8, 2019 2:28:51 AM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Here are my files: https://we.tl/t-dBtvYLpgPb

Edited by user Friday, November 8, 2019 2:31:43 AM(UTC)  | Reason: Not specified

snavas  
#8 Posted : Tuesday, November 12, 2019 5:41:04 AM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Yes, we can save and preview the images and everything. But, if you try to load that saved PSD, it will end up resetting back to the initial PSD. This is my js file:

Quote:
// Import necessary modules for building the multi-editor.
const uiFrameworkBaseUrl = "https://cdn.jsdelivr.net/npm/@aurigma/ui-framework@4.0.12";
import moduleLoader from "https://cdn.jsdelivr.net/npm/@aurigma/ui-framework@4.0.12/dist/moduleLoader.js";

document.addEventListener('DOMContentLoaded', async () => {
// Fetch the Drupal multi-editor settings.
var settings = Drupal.settings;

// Get the Customer's Canvas URL to pass to the settings.
var ccSettings = {
customersCanvasUrl: settings.customersCanvasMultiEditor.url
};

// Fetch the product, user, and quantity from the settings.
var product = JSON.parse(settings.customersCanvasMultiEditor.product);
var user = JSON.parse(settings.customersCanvasMultiEditor.user);
var quantity = settings.customersCanvasMultiEditor.quantity;
var config = JSON.parse(settings.customersCanvasMultiEditor.config);

// Now, load the aurigma driver and editor.
let driver = (await moduleLoader.dynamicImport("ecommerceDriver", `${uiFrameworkBaseUrl}/dist/drivers/default-driver.js`)).ecommerceDriver;
let editor = (await moduleLoader.dynamicImportDefault("editor", `${uiFrameworkBaseUrl}/dist/editor.js`)).editor;

let ecommerce = await driver.init(product, editor, config, ccSettings, null, quantity, user);
ecommerce.products.current.renderEditor(document.getElementById("aurigma-editor-root"));

// Fetch data from the editor after the user finishes editing it.
ecommerce.cart.onSubmitted.subscribe(function (data) {
data.lineItems.forEach(function (order) {
// Extract the necessary values from the data, which should include
// the stateId, userId, and images.
var result = {
'proofImageUrls': order.images,
'hiResOutputUrls': order.downloadUrls,
'stateId': order.data.stateId,
'userId': order.data.userId,
};

// Save the result to the finish form.
document.getElementById('editorResult').setAttribute(
'value',
JSON.stringify(result)
);

// Submit the form.
document.forms['customers-canvas-finish'].submit();
})
});

});
snavas  
#9 Posted : Tuesday, November 12, 2019 9:22:04 PM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Could you please give me a sample of how the editor config should look when we're editing the PSD for the multi editor. For example, what the productJson should look like and where the stateID should be, etc.
snavas  
#10 Posted : Wednesday, November 13, 2019 4:24:38 AM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

Yes, that's exactly what we're doing. When we edit the PSD, the productDefinition is set to the stateID, so, our configs looks like this when editing (I've stringified the Json):



Quote:

{"vars":{"psdApiUrl":"https://h.customerscanvas.com/Users/XXXXXXXXX/DI","designs":[{"title":"Rectangle","name":"clients/example/new/rectangle"},{"title":"Oval","name":"clients/example/new/oval"},{"title":"Left Circle","name":"clients/example/new/left-circle"},{"title":"Top Circle","name":"clients/example/new/top-circle"}]},"language":"en","widgets":[{"name":"image-request","type":"ajax","params":{"url":"{{vars.psdApiUrl + '/api/preview'}}","lock":"preview","method":"POST","responseType":"json","request":{"template":"{{ 'clients/example/new/preview-mockup-' + $['design-variation']._.name.split('/')[3] }}","format":"png","unsharpMask":"(1.2, 0.5, 0.05)","data":{"Design":{"type":"image","image":"{{$['cc'].hiResUrls[0]}}","dpix":300,"dpiY":300}}}}},{"name":"finish-button","type":"finish-button","params":{"enabled":true,"visible":true,"onClick":["{{#function $['cc'].getHiResImages(800,800)}}","{{#function $['order-details'].widgetUpdated}}"]}},{"name":"order-details","type":"order","params":{"images":{"{{#each $['cc'].proofImageUrls}}":"{{item[0]}}"},"downloadUrls":["{{$['cc'].hiResUrls[0]}}"],"data":{"stateId":"{{$['cc'].stateId}}","userId":"{{$['cc'].userId}}"}}},{"name":"option-list","type":"group","params":{"type":"noncollapsible","tabs":[{"widgets":[{"type":"gallery","name":"design-variation","title":"Header Type","params":{"showTitle":true,"forceSelection":true,"items":{"{{ #each vars.designs as design }}":{"name":"{{ design.name}}","title":"{{ design.title}}","previewUrl":"{{ settings.customersCanvasBaseUrl + '/api/ProductTemplates/designs/' + design.name + '?width=400&height=400'}}"}}}}]}]}},{"name":"cc","type":"canvas","params":{"initial":{"editorConfig":{"defaultItemsConfig":{"image":{"width":"50%","location":{"x":"50%","y":"50%","originX":"center","originY":"center"}},"text":{"font":{"postScriptName":"ArialMT","size":24,"fauxBold":false,"fauxItalic":false},"color":"#000"}},"initialMode":"Advanced","fontList":{"appFonts":["*"]},"autoLoadUserInfo":true,"restoreProductOnReloadEnabled":false,"canvas":{"shadowEnabled":false,"violationWarningButtonsEnabled":true,"color":"white","rulers":{"enabled":false}},"rendering":{"proofImageWatermarkEnabled":false},"violationWarningsSettings":{"safetyLineViolationWarningEnabled":true},"watermark":{"text":{"opacity":0}},"widgets":{"TopToolbar":{"zOrderButtonsEnabled":false,"textShadowButtonEnabled":false,"textFontStyleButtonEnabled":false,"textStrokeButtonEnabled":false,"opacitySliderEnabled":false,"imageEditButtonEnabled":false,"zOrder":{"zOrderLevelButtonsEnabled":false,"zOrderSendToButtonsEnabled":false},"fontSize":{"max":72,"min":6,"step":1}},"Toolbox":{"buttons":[{"translationKey":"Toolbox.TEXT","translationKeyTitle":"Toolbox.TITLE_ADD_TEXT","iconClass":"cc-icon-add-text","buttons":["Text"]},{"translationKey":"Toolbox.ADD_IMAGE","translationKeyTitle":"Toolbox.TITLE_ADD_IMAGE","iconClass":"cc-icon-add-image","action":"Image","tabs":["My Files"]},{"translationKey":"Toolbox.SHAPE","translationKeyTitle":"Toolbox.TITLE_ADD_SHAPE","iconClass":"cc-icon-add-shape","buttons":["Line","Rectangle","Ellipse"]}]},"ItemMenu":{"objectManipulationEnabled":true,"verticalAlignmentEnabled":false,"horizontalAlignmentEnabled":false,"changeZOrderEnabled":false},"BottomToolbar":{"snapLinesCheckboxEnabled":false,"gridCheckboxEnabled":false},"ObjectInspector":{"aboveCanvasOnSmallScreenEnabled":true,"bgItemEnabled":false,"position":"Right","isHidden":true},"GalleryDialog":{"publicFolderName":"","downloadPsdAsImage":false,"defaultTabName":"My Files","tabs":[{"name":"My Files","type":"user","categoriesEnabled":true,"canEdit":true,"canUpload":true}]},"FinishButton":{"mode":"Disabled"}}},"productDefinition":"93b99bee-5043-40a2-a260-f76b37be548b"},"setPrintArea":{"{{#if $['design-variation']._}}":{"options":{"preserveUserChanges":true,"updateRevertData":false},"data":{"designFile":"{{ $['design-variation']._.name }}"}},"{{#else}}":{}}}}],"steps":[{"name":"Design","title":"Design","mainPanel":{"name":"cc"},"toolPanel":{"name":"option-list"}}],"userId":"NYodwgE7PvCqsgrrD8mBSzQ7YJirTbud9kVqdLczWYY"}


Is there something wrong here?

Edited by user Wednesday, November 13, 2019 4:25:37 AM(UTC)  | Reason: Not specified

snavas  
#11 Posted : Wednesday, November 13, 2019 9:42:21 PM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

I don't understand. So, when the multieditor loads when we're editing a PSD, there's no way to load the saved changes automatically? I only have 1 step here. We select and edit the PSD and click Finish, that's it. There is not even a Preview step. Also, what is this button replace?

Edited by user Wednesday, November 13, 2019 9:45:30 PM(UTC)  | Reason: Not specified

snavas  
#12 Posted : Wednesday, November 13, 2019 11:37:06 PM(UTC)
snavas

Rank: Member

Groups: Member
Joined: 10/16/2019(UTC)
Posts: 12

I don't want a preview step. I'm trying to figure out how in the world I can edit the PSD without it loading the old unchanged version.
alinabo12  
#13 Posted : Sunday, October 23, 2022 11:30:18 PM(UTC)
alinabo12

Rank: Newbie

Groups: Member
Joined: 10/23/2022(UTC)
Posts: 1

Hello, the errors you're mentioning are related to the UI Builder and should not be interfering with your UI working in Edit mode but not in Play mode (that's what's happening, correct?).

Can you take a look at the right side of the free printable 2023 calendar Debugger and check that the layout is computing to valid sizes? Also can you share your UXML contents?

Edited by user Wednesday, October 26, 2022 8:06:01 AM(UTC)  | Reason: Not specified

p.lunev  
#14 Posted : Wednesday, October 26, 2022 7:34:47 AM(UTC)
p.lunev

Rank: Newbie

Groups: Member
Joined: 6/15/2021(UTC)
Posts: 2

Hello alinabo12,

Thank you for your help.

Unfortunately, since this topic was discussed 3 years ago, it may be irrelevant due to major improvements in our product.

If you have any questions, it would be better if you create a ticket using this link: https://customerscanvas.com/account/cases/add
p.lunev  
#15 Posted : Thursday, October 27, 2022 5:45:31 AM(UTC)
p.lunev

Rank: Newbie

Groups: Member
Joined: 6/15/2021(UTC)
Posts: 2

Hello alinabo12,

Could you please clarify what do you mean by UXML contents in terms of Customer's Canvas?

Can you specify your current version of the Customer's Canvas?
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.