customization fixes

This commit is contained in:
argirok 2022-07-25 17:01:00 +03:00
parent fa6cb6cce3
commit 97481480df
1 changed files with 9 additions and 7 deletions

View File

@ -60,6 +60,7 @@ declare var UIkit;
height: 96%;
border: none;
border-radius:10px;
background-color: white;
}
`]
@ -161,15 +162,16 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" },
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
});
}
this.publishedLayout.layoutOptions = this.draftCustomizationOptions;
this.publishedLayout.layoutOptions = this.copyObject(this.draftCustomizationOptions);
this.publishedCustomizationOptions = this.copyObject(this.publishedLayout.layoutOptions)
this.publishedLayout.date = new Date();
this.subscriptions.push(this.layoutService.saveLayout(this.properties, this.communityId, this.publishedLayout).subscribe(layout => {
this.subscriptions.push(this.layoutService.createCSS(this.communityId, this.publishedLayout.date.valueOf(), this.publishedLayout.layoutOptions).subscribe(data => {
console.log(data)
this.initializeCustomizationOptions(JSON.stringify(this.publishedCustomizationOptions) != this.previewCustomization);
this.deleteOldImages();
this.publishedCustomizationOptions = layout.layoutOptions;
this.subscriptions.push(this.layoutService.createCSS(this.communityId, this.publishedLayout.date.valueOf()).subscribe(data => {
console.log(data)
UIkit.notification("Customizations was successfully saved!", {
status: 'success',
timeout: 6000,
@ -215,7 +217,8 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" },
this.draftCustomizationOptions = this.copyObject(this.publishedCustomizationOptions);
this.appliedCustomizationOptions = this.copyObject(this.publishedCustomizationOptions);
if(updatePreviewUrl){
this.previewUrl = this.getCommunityUrlSatinized(JSON.stringify(this.appliedCustomizationOptions));
this.previewCustomization = this.copyObject(this.publishedCustomizationOptions);
this.previewUrl = this.getCommunityUrlSatinized(null);
}
}
@ -227,7 +230,6 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" },
let prefix = "-preview-" + d.valueOf();
this.subscriptions.push(this.layoutService.createCSS(this.communityId, prefix, this.appliedCustomizationOptions).subscribe(data => {
this.previewUrl = this.getCommunityUrlSatinized(this.communityId + prefix);
console.log(data)
}, error => {