onSelectAutomation(autoIndex)}
- >
-
-
- {isModified && (
- }
- onClick={() =>
- onSave({
- ...auto,
- tags: Object.fromEntries(tags),
- metadata: {
- ...auto.metadata,
- alias,
- },
- })
- }
- />
- )}
- onRemove(autoIndex)} icon={} />
-
-
- );
-};
diff --git a/webapp/src/components/AutomationList/AutomationMetadataBox.css b/webapp/src/components/AutomationList/AutomationMetadataBox.css
deleted file mode 100644
index 43b9c2d..0000000
--- a/webapp/src/components/AutomationList/AutomationMetadataBox.css
+++ /dev/null
@@ -1,101 +0,0 @@
-.automation-list-box--body--item--title {
- display: flex;
- flex-direction: column;
- padding-left: 0.25em;
- flex: 1;
-}
-
-.automation-list-box--body--item--title>b {
- font-size: 1em;
- display: flex;
- align-items: center;
- gap: 0.25em;
-}
-
-.automation-list-box--body--item--title .input-text-view span {
- max-height: 1.5em;
-}
-
-.automation-list-box--body--item--title>span, .automation-list-box--body--item--title>b>span {
- font-size: 0.75em;
-}
-
-
-.automation-list-box--body--item--tags {
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- font-size: 0.75em;
- justify-content: left;
- align-items: flex-start;
- overflow: auto;
- max-height: 100%;
- gap: 0.25em;
-}
-
-.automation-list-box--body--item--tags>span {
- border-color: var(--mui-grey-400);
- border-style: solid;
- border-width: 1px;
- border-radius: 0.5em;
- padding: 0.1em 0.5em;
-}
-
-.automation-list-box--body--item--tags--item {
- color: white;
- border-color: white;
- border-style: solid;
- border-width: 1px;
- border-radius: 0.5em;
- padding: 0.1em 0.5em;
-
- display: flex;
- flex-direction: row;
- gap: 0.25em;
- max-width: min-content;
- align-items: center;
-
-}
-
-.automation-list-box--body--item--tags--item>.text:hover {
- text-decoration: underline;
- cursor: pointer;
-}
-
-.automation-list-box--body--item--tags--item>.text {
- position: relative;
-}
-
-.automation-list-box--body--item--tags--item>.text .MuiFilledInput-root {
- padding: 0;
- min-width: 6em;
- max-width: 10em;
- background-color: var(--mui-common-black);
-}
-
-.automation-list-box--body--item--tags--item>.text .icon {
- position: absolute;
- right: 0.5em;
- top: 0.5em;
- cursor: pointer;
-}
-
-.automation-list-box--body--item--tags--item>.text .icon:hover {
- background-color: var(--mui-grey-400);
- border-radius: 20px;
-}
-
-.automation-list-box--body--item--tags--item>.text .icon:hover svg {
- fill: var(--mui-common-black);
-}
-
-.automation-list-box--body--item--tags--item .delete {
- font-size: 1em;
- color: var(--mui-error-light);
-}
-
-.automation-list-box--body--item--tags--item .delete:hover {
- color: var(--mui-error-dark);
- outline: 1px solid var(--mui-error-dark);
- border-radius: 20px;
-}
\ No newline at end of file
diff --git a/webapp/src/components/AutomationList/AutomationMetadataBox.tsx b/webapp/src/components/AutomationList/AutomationMetadataBox.tsx
deleted file mode 100644
index 5982997..0000000
--- a/webapp/src/components/AutomationList/AutomationMetadataBox.tsx
+++ /dev/null
@@ -1,181 +0,0 @@
-import "./AutomationMetadataBox.css";
-import { CheckMarkIcon } from "components/Icons";
-import { FC, useState } from "react";
-import { AutomationMetadata } from "types/automations";
-import { InputAutoComplete } from "components/Inputs/InputAutoComplete";
-import { TagDB } from "./TagDB";
-import DeleteIcon from "@mui/icons-material/ClearTwoTone";
-import { InputTextView } from "components/Inputs/InputTextView";
-
-export const MetadataBox: FC<{
- metadata: AutomationMetadata;
- onAliasUpdate: (t: string) => void;
- onTagUpdate: (t: [string, string][]) => void;
- tags: [string, string][];
- tagsDB: TagDB;
-}> = ({ tags, onTagUpdate, onAliasUpdate, tagsDB, metadata }) => {
- // state
- const [newTag, setNewTag] = useState<
- | {
- on: false;
- }
- | {
- on: true;
- name: string;
- value: string;
- }
- >({ on: false });
- // alias
- const tagOptions = tagsDB.getTagNames(tags.map((t) => t[0]));
-
- // render
- let title =
- {title}
-
- {tags.map(([tagName, tagValue], tagIndex) => (
-
- onTagUpdate([
- ...tags.slice(0, tagIndex),
- ...tags.slice(tagIndex + 1),
- ])
- }
- onChange={([newName, newValue]) =>
- onTagUpdate([
- ...tags.slice(0, tagIndex),
- [newName, newValue],
- ...tags.slice(tagIndex + 1),
- ])
- }
- />
- ))}
- {newTag.on ? (
- {
- setNewTag({
- on: true,
- name,
- value,
- });
- }}
- onToggle={(em) => {
- if (!em) {
- if (newTag.name.trim() !== "" && newTag.value.trim() !== "") {
- onTagUpdate(tags.concat([[newTag.name, newTag.value]]));
- setNewTag({
- on: false,
- });
- }
- }
- setNewTag({
- on: false,
- });
- }}
- />
- ) : (
-
- setNewTag({
- on: true,
- name: "",
- value: "",
- })
- }
- >
- +
-
- )}
-
-
- );
-};
-
-export const MetadataBoxTag: FC<{
- value: [string, string];
- onChange: (t: [string, string]) => void;
- options: [string[], string[]];
- initialState?: boolean;
- onToggle?: (em: boolean) => void;
- onDelete?: () => void;
-}> = (props) => {
- const [editMode, setEditMode] = useState(
- props.initialState ? props.initialState : false
- );
- const toggle = () => {
- if (editMode) {
- if (props.value[0].trim() === "" || props.value[1].trim() === "") {
- props.onToggle && props.onToggle(true);
- return setEditMode(true);
- }
- }
- props.onToggle && props.onToggle(!editMode);
- setEditMode(!editMode);
- };
- return (
-