Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
showModalEdit(id, oldName, oldUrl) {
let errShowing = false,
that = this;
const forms = [{ id: 'txtName', placeholder: i18n.__('renderer.scheme_name'), value: oldName }];
if (oldUrl) {
forms.push({ id: 'txtUrl', placeholder: i18n.__('renderer.scheme_address'), value: oldUrl });
}
swal.withForm({
title: i18n.__('renderer.edit_scheme'),
text: oldUrl ? i18n.__('renderer.edit_scheme_remote_desc') : i18n.__('renderer.edit_scheme_local_desc'),
showCancelButton: true,
confirmButtonColor: '#DD6B55',
confirmButtonText: i18n.__('renderer.edit_scheme_save'),
cancelButtonText: i18n.__('renderer.cancel'),
closeOnConfirm: false,
formFields: forms
}, function (isConfirm) {
const $errEl = $('.sa-error-container');
const name = this.swalForm.txtName.trim();
let url;
if (oldUrl) {
url = this.swalForm.txtUrl.trim();
}
if (isConfirm) {
if (!name) {
if (!errShowing) {
errShowing = true;
$errEl.find('p')
.text(i18n.__('renderer.scheme_name_empty'));
function localize(key: string, text?: string) {
const vscodeOptions = JSON.parse(
process.env.VSCODE_NLS_CONFIG
).locale.toLowerCase();
let i18n = require('i18n');
let locales = ['en', 'pt-br'];
i18n.configure({
locales: locales,
directory: __dirname + '\\locales'
});
i18n.setLocale(locales.indexOf(vscodeOptions) + 1 ? vscodeOptions : 'en');
return i18n.__(key);
}
AssignMail.owner.interested = (user, task, interested, offer) => {
const to = user.email
const language = user.language || 'en'
i18n.setLocale(language)
setMomentLocale(language)
request(
to,
i18n.__('mail.assign.owner.subject'),
[
{
type: 'text/html',
value: `
<p>${i18n.__('mail.assign.owner.hello')},</p>
<p>${i18n.__('mail.assign.owner.main', { email: interested.email, name: interested.name || interested.username, url: `${process.env.FRONTEND_HOST}/#/task/${task.id}` })}</p>
<p>${i18n.__('mail.assign.owner.suggest', { value: offer.value, suggestedDate: offer.suggestedDate ? offer.suggestedDate : i18n.__('mail.assigned.nodate'), learn: offer.learn ? i18n.__('mail.statement.yes') : i18n.__('mail.statement.no'), comment: offer.comment ? offer.comment : i18n.__('mail.offer.nocomment') })}</p>
<p>${i18n.__('mail.assign.owner.sec')}</p>
${Signatures.buttons(language, {
primary: {
label: 'mail.assign.owner.button.primary',
url: `${process.env.FRONTEND_HOST}/#/task/${task.id}/interested`
},
secondary: {
label: 'mail.assign.owner.button.secondary',
url: `${process.env.FRONTEND_HOST}/#/task/${task.id}`
}
})}
<p>${Signatures.sign(language)}</p>`
},
]
)
}
$('#btnNew')
.attr('title', i18n.__('renderer.btnNew'));
$('#btnRefresh')
.attr('title', i18n.__('renderer.btnRefresh'));
$('#btnExport')
.attr('title', i18n.__('renderer.btnExport'));
$('#btnEdit')
.attr('title', i18n.__('renderer.btnEdit'));
$('#btnCheck')
.attr('title', i18n.__('renderer.btnCheck'));
$('#btnDelete')
.attr('title', i18n.__('renderer.btnDelete'));
$('#btnApply')
.attr('title', i18n.__('renderer.btnApply'));
$('#btnApplyTxt').text(i18n.__('renderer.btnApply'));
$('#btnSys')
.attr('title', i18n.__('renderer.btnSysTxt'));
$('#btnSysTxt').text(i18n.__('renderer.btnSysTxt'));
$('#btnUndo')
.attr('title', `${i18n.__('renderer.btnUndo')}(Ctrl+Z)`);
$('#btnRedo')
.attr('title', `${i18n.__('renderer.btnRedo')}(Ctrl+Shift+Z)`);
$('#btnCopy')
.attr('title', `${i18n.__('renderer.btnCopy')}(Ctrl+C)`);
$('#btnCut')
.attr('title', `${i18n.__('renderer.btnCut')}(Ctrl+X)`);
$('#btnPaste')
.attr('title', `${i18n.__('renderer.btnPaste')}(Ctrl+V)`);
$('#btnSearch')
.attr('title', `${i18n.__('renderer.btnSearch')}(Ctrl+F)`);
async revertBannedUser(req, body) {
await this.userService.revertBannedOrRecycledUser(body.userId, 'banned');
return { code: 200, message: i18n_1.__('Revert banned user successfully') };
}
async revertRecycledUser(req, body) {
getView : function (step)
{
if (step === null) {
return errOutput;
}
var view = [
i18n.__('Cool, love that project!'),
i18n.__('What task are you on?'),
''
],
previousStep = step.getParam('previousStep'),
dailyEntries = previousStep.getParam('entries').day_entries;
_.each(step.getOptions(), function (option, value) {
if (option.type === 'task') {
view.push(value + '. ' + option.name + (timerTools.isRunningTask(option.id, option.project_id, dailyEntries) ? i18n.__(' (Currently running)') : ''));
}
});
view.push('');
view.push(i18n.__('Just type {{{commandName}}} followed by a number to choose it or write \'{{{commandName}}} no\' if you picked the wrong project.', {
commandName : commandName
global.ValidationError = errorFactory('ValidationError', function (errorMsg) {
this.status = 400;
this.message = [
`${i18n.__('error.validation.field')}: `,
...errorMsg.map(item => `- ${item.param}: ${item.msg}.`),
].join('\n');
this.messageHtml = [
`<p>${i18n.__('error.validation.field')}: </p>`,
'<ul>',
...errorMsg.map(item => `<li>${escapeHtml(item.param)}: ${escapeHtml(item.msg)}.</li>`),
'</ul>',
].join('\n');
});
async findAllOrganizations() {
const data = await this.organizationService.findAllTrees();
return { code: 200, message: i18n_1.__('Get all organizations successful'), data };
}
async findChildrenOrganizations(req, body) {
async findInfoItemsByGroupId(req, body) {
const data = await this.infoGroupService.findItemsById(body.groupId);
return { code: 200, message: i18n_1.__('Query the information item in the information group successfully'), data };
}
};