Year in review — 2019.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

2 Pages12>
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

Anatolii  
#2 Posted : Sunday, October 20, 2019 7:18:24 PM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Hello, Snavas.

Sorry for the slow response.
Try to in onActivate step add that code:

"{{ #function $['canvas'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct()},1000) }) }}"

When moving from the second step back to the first one, you will again have a product return to the state.
And here it is necessary to replace the widget selector $ ['canvas']

Anatoliy Churikov
Support Egnineer | Aurigma, Inc
____________________________

p: 800.661.8190
e: a.Churikov@aurigma.com

CustomerCanvas.com by aurigma.com
Powerful web-to-print online editor
snavas  
#3 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
}



Anatolii  
#4 Posted : Monday, October 21, 2019 2:26:58 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Shabana,

Do you need to try add code into canvas block, for example:
....
"widgets": [
{ "onActivate": [
"{{ #function $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct()},1000) }) }}",
"{{ #function $['cc'].getHiResImages(800,800) }}"
]
},
....

Anatoliy Churikov
Support Egnineer | Aurigma, Inc
____________________________

p: 800.661.8190
e: a.Churikov@aurigma.com

CustomerCanvas.com by aurigma.com
Powerful web-to-print online editor
snavas  
#5 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 ^^.
Anatolii  
#6 Posted : Monday, October 21, 2019 8:49:59 PM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Shabana,

Probably this version code can be work:

"{{ #function (()=> { if (!window.isRevert) { $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct()},1000) }); window.isRevert = true; } })() }}",

If you will be trouble, I can advise for an upgrade CC to a newer version..

Anatoliy Churikov
Support Egnineer | Aurigma, Inc
____________________________

p: 800.661.8190
e: a.Churikov@aurigma.com

CustomerCanvas.com by aurigma.com
Powerful web-to-print online editor
snavas  
#7 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

Anatolii  
#8 Posted : Tuesday, October 22, 2019 1:51:58 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Shabana,

If you do not want to update uiFramework, we can try to re-create your system and test, but this may take some time.

Anatoliy Churikov
Support Egnineer | Aurigma, Inc
____________________________

p: 800.661.8190
e: a.Churikov@aurigma.com

CustomerCanvas.com by aurigma.com
Powerful web-to-print online editor
snavas  
#9 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.
Anatolii  
#10 Posted : Thursday, October 24, 2019 2:47:37 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Hello Shabana,

I again discussed it with the team, and we think that the update good idea.
You can create a copy of the website where you can update uiFramework, if that case can be hard we can help you.

Best regards,
Anatolii Churikov
Anatolii  
#11 Posted : Thursday, October 24, 2019 2:47:48 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Hello Shabana,

I again discussed it with the team, and we think that the update good idea.
You can create a copy of the website where you can update uiFramework, if that case can be hard we can help you.

Best regards,
Anatolii Churikov
snavas  
#12 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

Anatolii  
#13 Posted : Friday, November 8, 2019 1:58:13 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Hello Shabana,

For a test send me please your design files.

Best regards,
Anatolii Churikov

snavas  
#14 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

Anatolii  
#15 Posted : Tuesday, November 12, 2019 2:39:40 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Hello,

I used your config and files, in my local CC all works and saving, all changes are transferred to another surface with changes, and I get hires and preview images with changes.

Best regards,
Anatoliy Churikov
snavas  
#16 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();
})
});

});
Anatolii  
#17 Posted : Tuesday, November 12, 2019 9:02:19 PM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Shabana, you try load PSD file - it will not work. You can only load statefile which is obtained after editing PSD in CC.

Best regards,
Anatoliy Churikov
snavas  
#18 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.
Anatolii  
#19 Posted : Wednesday, November 13, 2019 3:49:56 AM(UTC)
Anatolii

Rank: Member

Groups: Member, Moderator
Joined: 7/11/2019(UTC)
Posts: 13

Shabana,

Are you trying to get a var productdefinition: yourPSDfile
But you need to get var productdefinition: stateId

Best regards,
Anatoliy Churikov
snavas  
#20 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

Users browsing this topic
2 Pages12>
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.