copy json document commented (not needed)

This commit is contained in:
Jan Prochazka 2021-12-05 12:55:37 +01:00
parent b4e777018e
commit 755cb5d6f3

View File

@ -132,13 +132,13 @@
onClick: () => getCurrentDataGrid().openJsonArrayInSheet(), onClick: () => getCurrentDataGrid().openJsonArrayInSheet(),
}); });
registerCommand({ // registerCommand({
id: 'dataGrid.copyJsonDocument', // id: 'dataGrid.copyJsonDocument',
category: 'Data grid', // category: 'Data grid',
name: 'Copy row as JSON document', // name: 'Copy row as JSON document',
testEnabled: () => getCurrentDataGrid()?.copyJsonEnabled(), // testEnabled: () => getCurrentDataGrid()?.copyJsonEnabled(),
onClick: () => getCurrentDataGrid().copyJsonDocument(), // onClick: () => getCurrentDataGrid().copyJsonDocument(),
}); // });
registerCommand({ registerCommand({
id: 'dataGrid.filterSelected', id: 'dataGrid.filterSelected',
@ -563,15 +563,15 @@
}); });
} }
export function copyJsonEnabled() { // export function copyJsonEnabled() {
return isDynamicStructure && _.uniq(selectedCells.map(x => x[0])).length == 1; // return isDynamicStructure && _.uniq(selectedCells.map(x => x[0])).length == 1;
} // }
export function copyJsonDocument() { // export function copyJsonDocument() {
const rowIndex = selectedCells[0][0]; // const rowIndex = selectedCells[0][0];
const rowData = grider.getRowData(rowIndex); // const rowData = grider.getRowData(rowIndex);
copyTextToClipboard(JSON.stringify(rowData, undefined, 2)); // copyTextToClipboard(JSON.stringify(rowData, undefined, 2));
} // }
export function buildFindMenu() { export function buildFindMenu() {
const res = []; const res = [];
@ -1306,7 +1306,7 @@
{ command: 'dataGrid.viewJsonDocument', hideDisabled: true }, { command: 'dataGrid.viewJsonDocument', hideDisabled: true },
{ command: 'dataGrid.viewJsonValue', hideDisabled: true }, { command: 'dataGrid.viewJsonValue', hideDisabled: true },
{ command: 'dataGrid.openJsonArrayInSheet', hideDisabled: true }, { command: 'dataGrid.openJsonArrayInSheet', hideDisabled: true },
{ command: 'dataGrid.copyJsonDocument', hideDisabled: true }, // { command: 'dataGrid.copyJsonDocument', hideDisabled: true },
{ divider: true }, { divider: true },
{ placeTag: 'export' }, { placeTag: 'export' },
{ command: 'dataGrid.generateSqlFromData' }, { command: 'dataGrid.generateSqlFromData' },