fix(routes): desk to app

This commit is contained in:
Rushabh Mehta 2020-12-18 13:17:58 +05:30
parent 70cfc4df15
commit 2cd41bca06
14 changed files with 19 additions and 24 deletions

View File

@ -128,7 +128,7 @@ frappe.ui.form.on('Assessment Result Tool', {
result_table.find(`span[data-student=${assessment_result.student}].total-score-grade`).html(assessment_result.grade);
let link_span = result_table.find(`span[data-student=${assessment_result.student}].total-result-link`);
$(link_span).css("display", "block");
$(link_span).find("a").attr("href", "/desk/Form/Assessment Result/"+assessment_result.name);
$(link_span).find("a").attr("href", "/app/assessment-result/"+assessment_result.name);
}
});
}

View File

@ -25,7 +25,7 @@ frappe.ui.form.on('Course Scheduling Tool', {
<thead><tr><th>${__("Course")}</th><th>${__("Date")}</th></tr></thead>
<tbody>
${course_schedules.map(
c => `<tr><td><a href="/desk/Form/Course Schedule/${c.name}">${c.name}</a></td>
c => `<tr><td><a href="/app/course-schedule/${c.name}">${c.name}</a></td>
<td>${c.schedule_date}</td></tr>`
).join('')}
</tbody>

View File

@ -23,10 +23,10 @@ frappe.ui.form.on("Tally Migration", {
frappe.msgprint({
message: __("An error has occurred during {0}. Check {1} for more details",
[
repl("<a href='/desk/Form/Tally Migration/%(tally_document)s' class='variant-click'>%(tally_document)s</a>", {
repl("<a href='/app/tally-migration/%(tally_document)s' class='variant-click'>%(tally_document)s</a>", {
tally_document: frm.docname
}),
"<a href='/desk/List/Error Log' class='variant-click'>Error Log</a>"
"<a href='/app/error-log' class='variant-click'>Error Log</a>"
]
),
title: __("Tally Migration Error"),

View File

@ -134,7 +134,7 @@ frappe.ui.form.on("BOM", {
frm.set_intro(__('This is a Template BOM and will be used to make the work order for {0} of the item {1}',
[
`<a class="variants-intro">variants</a>`,
`<a href="/desk/Form/Item/${frm.doc.item}">${frm.doc.item}</a>`,
`<a href="/app/item/${frm.doc.item}">${frm.doc.item}</a>`,
]), true);
frm.$wrapper.find(".variants-intro").on("click", () => {

View File

@ -26,7 +26,7 @@ frappe.listview_settings['Task'] = {
},
gantt_custom_popup_html: function(ganttobj, task) {
var html = `<h5><a style="text-decoration:underline"\
href="/desk/Form/Task/${ganttobj.id}""> ${ganttobj.name} </a></h5>`;
href="/app/task/${ganttobj.id}""> ${ganttobj.name} </a></h5>`;
if(task.project) html += `<p>Project: ${task.project}</p>`;
html += `<p>Progress: ${ganttobj.progress}</p>`;

View File

@ -85,7 +85,7 @@ class CallPopup {
<br>
<a
class="text-small text-muted"
href="/desk/Form/Call Log/${this.call_log.name}">
href="/app/call-log/${this.call_log.name}">
${__('View call log')}
</a>
`,
@ -167,7 +167,7 @@ class CallPopup {
const issue_field = this.dialog.get_field("last_issue");
issue_field.set_value(issue.subject);
issue_field.$wrapper.append(`
<a class="text-medium" href="/desk/List/Issue?customer=${issue.customer}">
<a class="text-medium" href="/app/issue?customer=${issue.customer}">
${__('View all issues from {0}', [issue.customer])}
</a>
`);

View File

@ -84,7 +84,7 @@ frappe.ui.form.on("Communication", {
frm.reload_doc();
frappe.show_alert({
message: __("Opportunity {0} created",
['<a href="/desk/Form/Opportunity/'+r.message+'">' + r.message + '</a>']),
['<a href="/app/opportunity/'+r.message+'">' + r.message + '</a>']),
indicator: 'green'
});
}

View File

@ -127,11 +127,9 @@ erpnext.setup.slides_settings = [
options: "", fieldtype: 'Select'
},
{ fieldname: 'view_coa', label: __('View Chart of Accounts'), fieldtype: 'Button' },
{ fieldtype: "Section Break", label: __('Financial Year') },
{ fieldname: 'fy_start_date', label: __('Start Date'), fieldtype: 'Date', reqd: 1 },
{ fieldtype: "Column Break" },
{ fieldname: 'fy_end_date', label: __('End Date'), fieldtype: 'Date', reqd: 1 },
{ fieldname: 'fy_start_date', label: __('Financial Year Begins On'), fieldtype: 'Date', reqd: 1 },
// end date should be hidden (auto calculated)
{ fieldname: 'fy_end_date', label: __('End Date'), fieldtype: 'Date', reqd: 1, hidden: 1 },
],
onload: function (slide) {

View File

@ -436,7 +436,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
callback: function(r) {
if(r.message) {
frappe.msgprint(__('Material Request {0} submitted.',
['<a href="/desk/Form/Material Request/'+r.message.name+'">' + r.message.name+ '</a>']));
['<a href="/app/material-request/'+r.message.name+'">' + r.message.name+ '</a>']));
}
d.hide();
me.frm.reload_doc();

View File

@ -198,7 +198,7 @@ erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callb
freeze: true,
callback: function(r) {
frappe.show_alert(__('Stock Entry {0} created',
['<a href="/desk/Form/Stock Entry/'+r.message.name+'">' + r.message.name+ '</a>']));
['<a href="/app/stock-entry/'+r.message.name+'">' + r.message.name+ '</a>']));
dialog.hide();
callback(r);
},

View File

@ -102,7 +102,7 @@ frappe.ui.form.on('Batch', {
},
callback: (r) => {
frappe.show_alert(__('Stock Entry {0} created',
['<a href="/desk/Form/Stock Entry/'+r.message.name+'">' + r.message.name+ '</a>']));
['<a href="/app/stock-entry/'+r.message.name+'">' + r.message.name+ '</a>']));
frm.refresh();
},
});

View File

@ -85,7 +85,7 @@ frappe.ui.form.on("Item", {
}
if (frm.doc.variant_of) {
frm.set_intro(__('This Item is a Variant of {0} (Template).',
[`<a href="/desk/Form/Item/${frm.doc.variant_of}">${frm.doc.variant_of}</a>`]), true);
[`<a href="/app/item/${frm.doc.variant_of}">${frm.doc.variant_of}</a>`]), true);
}
if (frappe.defaults.get_default("item_naming_by")!="Naming Series" || frm.doc.variant_of) {
@ -649,7 +649,7 @@ $.extend(erpnext.item, {
if (r.message) {
var variant = r.message;
frappe.msgprint_dialog = frappe.msgprint(__("Item Variant {0} already exists with same attributes",
[repl('<a href="/desk/Form/Item/%(item_encoded)s" class="strong variant-click">%(item)s</a>', {
[repl('<a href="/app/item/%(item_encoded)s" class="strong variant-click">%(item)s</a>', {
item_encoded: encodeURIComponent(variant),
item: variant
})]

View File

@ -14,6 +14,6 @@ frappe.ui.form.on("Item Price", {
frm.add_fetch("item_code", "stock_uom", "uom");
frm.set_df_property("bulk_import_help", "options",
'<a href="/desk/data-import-tool/Item Price">' + __("Import in Bulk") + '</a>');
'<a href="/app/data-import-tool/Item Price">' + __("Import in Bulk") + '</a>');
}
});

View File

@ -189,10 +189,7 @@ frappe.ui.form.on("Issue", {
subject: dialog.fields_dict.subject.value,
communication_id: e.currentTarget.closest(".timeline-item").getAttribute("data-name")
}, (r) => {
let url = window.location.href
let arr = url.split("/");
let result = arr[0] + "//" + arr[2]
frappe.msgprint(`New issue created: <a href="${result}//desk/Form/Issue/${r.message}">${r.message}</a>`)
frappe.msgprint(`New issue created: <a href="/app/issue/${r.message}">${r.message}</a>`)
frm.reload_doc();
dialog.hide();
});