Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

tarteo
Copy link
Member

@tarteo tarteo commented Jan 17, 2020

No description provided.

Copy link
Member

@Tardo Tardo left a 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
right: 0px;
right: 0;

.o_snippet_preset_del {
position: absolute;
right: 0px;
top: 0px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
top: 0px;
top: 0;


odoo.define('website_snippet_preset', function (require) {
'use strict';
var editor = require('web_editor.snippet.editor');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var Dialog = require('web.Dialog');
const Dialog = require('web.Dialog');

Comment on lines +193 to +205
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();
}
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var get_done = $.Deferred();
const get_done = $.Deferred();

return save;
},
applyPreset: function (arch) {
var $arch = $(arch);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var $arch = $(arch);
const $arch = $(arch);

return get_done.promise();
},
savePreset: function (snippet, name, arch, id) {
var self = this;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var self = this;

},
savePreset: function (snippet, name, arch, id) {
var self = this;
var save = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var save = null;
let save = null;

@Max-282
Copy link

Max-282 commented Apr 7, 2021

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.

@github-actions
Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Sep 18, 2022
@github-actions github-actions bot closed this Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants