diff --git a/manifest.xml b/manifest.xml index 6db0cb4..dc4ef4d 100644 --- a/manifest.xml +++ b/manifest.xml @@ -6,17 +6,17 @@ de-DE - - - + + + - https://kabel.casademm.de + https://localhost:3000/ - + ReadWriteDocument @@ -62,14 +62,14 @@ - - - + + + - - - + + + diff --git a/src/taskpane/components/App.tsx b/src/taskpane/components/App.tsx index 5763eb4..7aa957c 100644 --- a/src/taskpane/components/App.tsx +++ b/src/taskpane/components/App.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { useState, useEffect } from "react"; import { makeStyles } from "@fluentui/react-components"; -import { SheetInfo, SheetMappingStatus } from "../models"; +import { SheetInfo, SheetMappingStatus, ConsolidateSettings } from "../models"; import SheetSelector from "./SheetSelector"; import ColumnMapper from "./ColumnMapper"; import StatusNotifier from "./StatusNotifier"; @@ -11,6 +11,8 @@ interface AppProps { title: string; } +declare const DEV_MODE: boolean; + const useStyles = makeStyles({ root: { minHeight: "100vh", @@ -33,6 +35,12 @@ const App: React.FC = () => { const [statusMessage, setStatusMessage] = useState(""); const [isConsolidating, setIsConsolidating] = useState(false); + const [settings, setSettings] = useState({ + colorNew: "#d4edda", // light green + colorChanged: "#fff3cd", // light yellow/orange + colorDeleted: "#f8d7da", // light red + }); + useEffect(() => { // Load internal sheets on mount getAvailableSheets().then(setSheets).catch(err => { @@ -91,7 +99,7 @@ const App: React.FC = () => { setIsConsolidating(true); setStatus("idle"); try { - const rowsCount = await consolidateData(sheetMappings); + const rowsCount = await consolidateData(sheetMappings, settings); setStatus("success"); setStatusMessage(`Erfolgreich! Es wurden ${rowsCount} Zeilen aus ${sheetMappings.length} Blättern zusammengefasst.`); setStep("done"); @@ -105,6 +113,11 @@ const App: React.FC = () => { return (
+ {typeof DEV_MODE !== "undefined" && DEV_MODE && ( +
+ DEV ENVIRONMENT +
+ )} {step === "select_sheets" && ( @@ -120,6 +133,8 @@ const App: React.FC = () => { {step === "map_columns" && ( setStep("select_sheets")} diff --git a/src/taskpane/components/ColumnMapper.tsx b/src/taskpane/components/ColumnMapper.tsx index e1127b3..4df342a 100644 --- a/src/taskpane/components/ColumnMapper.tsx +++ b/src/taskpane/components/ColumnMapper.tsx @@ -13,7 +13,7 @@ import { Label, Spinner, } from "@fluentui/react-components"; -import { SheetMappingStatus, TARGET_COLUMNS } from "../models"; +import { SheetMappingStatus, TARGET_COLUMNS, ConsolidateSettings } from "../models"; interface ColumnMapperProps { sheetMappings: SheetMappingStatus[]; @@ -22,6 +22,8 @@ interface ColumnMapperProps { onBack: () => void; onConsolidate: () => void; isConsolidating: boolean; + settings: ConsolidateSettings; + onSettingsChange: (settings: ConsolidateSettings) => void; } const ColumnMapper: React.FC = ({ @@ -31,6 +33,8 @@ const ColumnMapper: React.FC = ({ onBack, onConsolidate, isConsolidating, + settings, + onSettingsChange, }) => { return (
@@ -119,6 +123,36 @@ const ColumnMapper: React.FC = ({ })} +
+ Hervorhebungen (Farben) +
+ + onSettingsChange({ ...settings, colorNew: e.target.value })} + style={{ width: "60px", padding: "0", cursor: "pointer", height: "30px", border: "none" }} + /> + + + onSettingsChange({ ...settings, colorChanged: e.target.value })} + style={{ width: "60px", padding: "0", cursor: "pointer", height: "30px", border: "none" }} + /> + + + onSettingsChange({ ...settings, colorDeleted: e.target.value })} + style={{ width: "60px", padding: "0", cursor: "pointer", height: "30px", border: "none" }} + /> + +
+
+