From c9308255a797ffcefe91f8fbb0060688c6cb03bf Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sun, 1 Nov 2020 12:54:27 +0100 Subject: [PATCH] macro icon --- packages/web/public/icons/double-wrench.svg | 1 + packages/web/public/icons/repair-tool.svg | 13 ++++++++ packages/web/src/appobj/MacroAppObject.js | 4 +-- packages/web/src/freetable/MacroDetail.js | 4 +-- packages/web/src/freetable/macros.js | 36 --------------------- packages/web/src/icons.js | 1 + 6 files changed, 19 insertions(+), 40 deletions(-) create mode 100644 packages/web/public/icons/double-wrench.svg create mode 100644 packages/web/public/icons/repair-tool.svg diff --git a/packages/web/public/icons/double-wrench.svg b/packages/web/public/icons/double-wrench.svg new file mode 100644 index 00000000..8f5a23cb --- /dev/null +++ b/packages/web/public/icons/double-wrench.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/web/public/icons/repair-tool.svg b/packages/web/public/icons/repair-tool.svg new file mode 100644 index 00000000..240f912d --- /dev/null +++ b/packages/web/public/icons/repair-tool.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/packages/web/src/appobj/MacroAppObject.js b/packages/web/src/appobj/MacroAppObject.js index cb5176ab..7b3e1e39 100644 --- a/packages/web/src/appobj/MacroAppObject.js +++ b/packages/web/src/appobj/MacroAppObject.js @@ -1,11 +1,11 @@ import _ from 'lodash'; import { filterName } from '@dbgate/datalib'; -import { StartIcon } from '../icons'; +import { MacroIcon, StartIcon } from '../icons'; const macroAppObject = () => ({ name, type, title, group }, { setOpenedTabs }) => { const key = name; // const Icon = (props) => ; - const Icon = StartIcon; + const Icon = MacroIcon; const matcher = (filter) => filterName(filter, name, title); const groupTitle = group; diff --git a/packages/web/src/freetable/MacroDetail.js b/packages/web/src/freetable/MacroDetail.js index 8a210cab..4acc3b3b 100644 --- a/packages/web/src/freetable/MacroDetail.js +++ b/packages/web/src/freetable/MacroDetail.js @@ -1,7 +1,7 @@ import React from 'react'; import ToolbarButton from '../widgets/ToolbarButton'; import styled from 'styled-components'; -import { ReferenceIcon } from '../icons'; +import { MacroIcon } from '../icons'; import { TabPage, TabControl } from '../widgets/TabControl'; import theme from '../theme'; import JavaScriptEditor from '../sqleditor/JavaScriptEditor'; @@ -63,7 +63,7 @@ function MacroHeader({ selectedMacro, setSelectedMacro, onExecute }) { return (
- + {selectedMacro.title}
diff --git a/packages/web/src/freetable/macros.js b/packages/web/src/freetable/macros.js index 5c02d09f..fba9dbbe 100644 --- a/packages/web/src/freetable/macros.js +++ b/packages/web/src/freetable/macros.js @@ -270,40 +270,4 @@ return { }, ]; -// function f() { -// const selectedColumnNames = modules.lodash.uniq(selectedCells.map((x) => x.column)); -// const selectedRowIndexes = modules.lodash.uniq(selectedCells.map((x) => x.row)); -// const addedColumnNames = modules.lodash.compact(args.year, args.month, args.day, args.hour, args.minute, args.second); -// const selectedRows = modules.lodash.groupBy(selectedCells, 'row'); - -// const resultRows = rows.map((row, rowIndex) => { -// if (!selectedRowIndexes.includes(rowIndex)) return row; -// const mom = selectedRows[index].find((x) => { -// const m = modules.moment(row[x.column]); -// if (m.isValid()) return m; -// }); -// if (!mom) return row; - -// const fields = { -// year: mom.year(), -// month: mom.month(), -// day: mom.day(), -// hour: mom.hour(), -// minute: mom.minute(), -// second: mom.second(), -// }; - -// return { -// ...row, -// ...modules.lodash.pick(fields, addedColumnNames), -// __insertedFields: addedColumnNames, -// }; -// }); -// const resultCols = [...cols, ...addedColumnNames]; -// return { -// rows: resultRows, -// cols: resultCols, -// }; -// } - export default macros; diff --git a/packages/web/src/icons.js b/packages/web/src/icons.js index 757b1090..a8bb5605 100644 --- a/packages/web/src/icons.js +++ b/packages/web/src/icons.js @@ -62,6 +62,7 @@ export const ViewIcon = (props) => getIconImage('view2.svg', props); export const ArchiveTableIcon = (props) => getIconImage('archtable.svg', props); export const DatabaseIcon = (props) => getIconImage('database.svg', props); export const ServerIcon = (props) => getIconImage('server.svg', props); +export const MacroIcon = (props) => getIconImage('double-wrench.svg', props); export const MicrosoftIcon = (props) => getIconImage('microsoft.svg', props); export const MySqlIcon = (props) => getIconImage('mysql.svg', props);