macro icon

This commit is contained in:
Jan Prochazka
2020-11-01 12:54:27 +01:00
parent 8ff44e41b1
commit c9308255a7
6 changed files with 19 additions and 40 deletions

View File

@@ -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) => <i className="fas fa-archive" />;
const Icon = StartIcon;
const Icon = MacroIcon;
const matcher = (filter) => filterName(filter, name, title);
const groupTitle = group;

View File

@@ -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 (
<Container>
<Header>
<ReferenceIcon />
<MacroIcon />
<HeaderText>{selectedMacro.title}</HeaderText>
</Header>
<Buttons>

View File

@@ -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;

View File

@@ -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);