-
-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[13.0][MIG] website_snippet_preset #688
Conversation
[IMP] website_snippet_preset: black, isort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! please, use ES6
|
||
.o_snippet_preset_del { | ||
position: absolute; | ||
right: 0px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right: 0px; | |
right: 0; |
.o_snippet_preset_del { | ||
position: absolute; | ||
right: 0px; | ||
top: 0px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top: 0px; | |
top: 0; |
|
||
odoo.define('website_snippet_preset', function (require) { | ||
'use strict'; | ||
var editor = require('web_editor.snippet.editor'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var editor = require('web_editor.snippet.editor'); | |
const editor = require('web_editor.snippet.editor'); |
odoo.define('website_snippet_preset', function (require) { | ||
'use strict'; | ||
var editor = require('web_editor.snippet.editor'); | ||
var core = require('web.core'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var core = require('web.core'); | |
const core = require('web.core'); |
'use strict'; | ||
var editor = require('web_editor.snippet.editor'); | ||
var core = require('web.core'); | ||
var Dialog = require('web.Dialog'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var Dialog = require('web.Dialog'); | |
const Dialog = require('web.Dialog'); |
dialog.on('save', this, function (name) { | ||
self.presetExists(snippet, name).done(function (exists) { | ||
var save = function () { | ||
self.savePreset(snippet, name, arch, exists); | ||
dialog.close(); | ||
}; | ||
if (exists) { | ||
new OverwriteDialog(dialog).open().done(save); | ||
} else { | ||
save(); | ||
} | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dialog.on('save', this, function (name) { | |
self.presetExists(snippet, name).done(function (exists) { | |
var save = function () { | |
self.savePreset(snippet, name, arch, exists); | |
dialog.close(); | |
}; | |
if (exists) { | |
new OverwriteDialog(dialog).open().done(save); | |
} else { | |
save(); | |
} | |
}); | |
}); | |
dialog.on('save', this, name => { | |
this.presetExists(snippet, name).done(exists => { | |
const save = () => { | |
this.savePreset(snippet, name, arch, exists); | |
dialog.close(); | |
}; | |
if (exists) { | |
new OverwriteDialog(dialog).open().done(save); | |
} else { | |
save(); | |
} | |
}); | |
}); |
dialog.open(); | ||
}, | ||
presetExists: function (snippet, name) { | ||
var get_done = $.Deferred(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var get_done = $.Deferred(); | |
const get_done = $.Deferred(); |
return save; | ||
}, | ||
applyPreset: function (arch) { | ||
var $arch = $(arch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var $arch = $(arch); | |
const $arch = $(arch); |
return get_done.promise(); | ||
}, | ||
savePreset: function (snippet, name, arch, id) { | ||
var self = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var self = this; |
}, | ||
savePreset: function (snippet, name, arch, id) { | ||
var self = this; | ||
var save = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var save = null; | |
let save = null; |
Hey @tarteo ! Thanks, it work very well. We need the V13 for our migration and it seems to be practically done. I was wondering if the project was at a standstill or you thought to finish it, we can take it over if necessary. |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
No description provided.