UI for UseValuesAsIdentifiers operation
This commit is contained in:
parent
5f551370b3
commit
610a8b3100
@ -674,7 +674,11 @@
|
|||||||
"rows": "rows",
|
"rows": "rows",
|
||||||
"records": "records",
|
"records": "records",
|
||||||
"show": "Show",
|
"show": "Show",
|
||||||
"hide": "Hide"
|
"hide": "Hide",
|
||||||
|
"use-values-as-identifiers": "Use values as identifiers",
|
||||||
|
"use-values-as-identifiers2": "Mark cells as reconciled with their values as identifiers",
|
||||||
|
"choose-reconciliation-service": "Choose a reconciliation service",
|
||||||
|
"choose-reconciliation-service-alert": "Please choose a reconciliation service first."
|
||||||
},
|
},
|
||||||
"core-buttons": {
|
"core-buttons": {
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
|
@ -126,6 +126,61 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
|
|||||||
input.focus().data("suggest").textchange();
|
input.focus().data("suggest").textchange();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var doUseValuesAsIdentifiers = function() {
|
||||||
|
var frame = DialogSystem.createDialog();
|
||||||
|
frame.width("400px");
|
||||||
|
|
||||||
|
var header = $('<div></div>').addClass("dialog-header").text($.i18n._('core-views')["use-values-as-identifiers"]).appendTo(frame);
|
||||||
|
var body = $('<div></div>').addClass("dialog-body").appendTo(frame);
|
||||||
|
var footer = $('<div></div>').addClass("dialog-footer").appendTo(frame);
|
||||||
|
|
||||||
|
$('<p></p>').text($.i18n._('core-views')["choose-reconciliation-service"]).appendTo(body);
|
||||||
|
var select = $('<select></select>').appendTo(body);
|
||||||
|
var services = ReconciliationManager.getAllServices();
|
||||||
|
for (var i = 0; i < services.length; i++) {
|
||||||
|
var service = services[i];
|
||||||
|
console.log(service);
|
||||||
|
$('<option></option>').attr('value', service.url)
|
||||||
|
.text(service.name)
|
||||||
|
.appendTo(select);
|
||||||
|
};
|
||||||
|
|
||||||
|
$('<button class="button"></button>').text($.i18n._('core-buttons')["cancel"]).click(function() {
|
||||||
|
DialogSystem.dismissUntil(level - 1);
|
||||||
|
}).appendTo(footer);
|
||||||
|
$('<button class="button"></button>').html($.i18n._('core-buttons')["ok"]).click(function() {
|
||||||
|
|
||||||
|
var service = select.val();
|
||||||
|
var identifierSpace = null;
|
||||||
|
var schemaSpace = null;
|
||||||
|
for(var i = 0; i < services.length; i++) {
|
||||||
|
if(services[i].url === service) {
|
||||||
|
identifierSpace = services[i].identifierSpace;
|
||||||
|
schemaSpace = services[i].schemaSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (identifierSpace === null) {
|
||||||
|
alert($.i18n._('core-views')["choose-reconciliation-service-alert"]);
|
||||||
|
} else {
|
||||||
|
Refine.postCoreProcess(
|
||||||
|
"recon-use-values-as-identifiers",
|
||||||
|
{
|
||||||
|
columnName: column.name,
|
||||||
|
service: service,
|
||||||
|
identifierSpace: identifierSpace,
|
||||||
|
schemaSpace: schemaSpace
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
{ cellsChanged: true, columnStatsChanged: true }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
DialogSystem.dismissUntil(level - 1);
|
||||||
|
}).appendTo(footer);
|
||||||
|
|
||||||
|
var level = DialogSystem.showDialog(frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var doCopyAcrossColumns = function() {
|
var doCopyAcrossColumns = function() {
|
||||||
var frame = $(DOM.loadHTML("core", "scripts/views/data-table/copy-recon-across-columns-dialog.html"));
|
var frame = $(DOM.loadHTML("core", "scripts/views/data-table/copy-recon-across-columns-dialog.html"));
|
||||||
var elmts = DOM.bind(frame);
|
var elmts = DOM.bind(frame);
|
||||||
@ -402,6 +457,12 @@ DataTableColumnHeaderUI.extendMenu(function(column, columnHeaderUI, menu) {
|
|||||||
label: $.i18n._('core-views')["copy-recon"],
|
label: $.i18n._('core-views')["copy-recon"],
|
||||||
tooltip: $.i18n._('core-views')["copy-recon2"],
|
tooltip: $.i18n._('core-views')["copy-recon2"],
|
||||||
click: doCopyAcrossColumns
|
click: doCopyAcrossColumns
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "core/use-values-as-identifiers",
|
||||||
|
label: $.i18n._('core-views')["use-values-as-identifiers"],
|
||||||
|
tooltip: $.i18n._('core-views')['use-values-as-identifiers2'],
|
||||||
|
click: doUseValuesAsIdentifiers
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user