Skip to content

Commit

Permalink
Merge branch 'design into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MiRo1310 committed Jun 22, 2024
1 parent 36ee8a0 commit 68c8a10
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 99 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,44 +57,66 @@ You can create different groups with separate menus, and then assign users to th

### 1.6.3 (2024-02-27)

- FIX: Bug in copy card fixed
- FIX: #104 HTTP Request Beta
- FIX: #111 status Value in dynamicSwitch
- FIX: #112 change value
- FIX: Bug in copy card fixed
- FIX: #104 HTTP Request Beta
- FIX: #111 status Value in dynamicSwitch
- FIX: #112 change value
- **_Change!!!_** menu:deleteAll removes automatic Request Ids which are older than 48h from list. The list is completely deleted once during the update
- FIX: menu:number with negativ Values, see the documentation
- FIX: menu:number with negativ Values, see the documentation

### 1.6.2 (2024-01-07)

- FIX: #102 **_Breaking Change!!!_** menu:dynSwitch with decimal numbers, if you use it, you have to adjust the function manually. For more information, see the documentation
- FIX: #106 **_Breaking Change!!!_** fixed change `{status:'id':'ID':true}` has now a new parameter, check docs
- FIX: #107 one line menu without workaround
- FIX: #103 scrollbar in Navigation and Action
- FIX: #102 **_Breaking Change!!!_** menu:dynSwitch with decimal numbers, if you use it, you have to adjust the function manually. For more information, see the documentation
- FIX: #106 **_Breaking Change!!!_** fixed change `{status:'id':'ID':true}` has now a new parameter, check docs
- FIX: #107 one line menu without workaround
- FIX: #103 scrollbar in Navigation and Action
- Small visual changes in actions for small screens
- FIX: Checkbox send menu after restart in settings
- FIX: #94 Menu:number with Float Numbers fixed
- FIX: Checkbox send menu after restart in settings
- FIX: #94 Menu:number with Float Numbers fixed
- Trigger Info - Overview of all menus and users, only visual but without functions
- Remaining text reattached

### 1.6.1 (2023-12-27)

- FIX: Shoppinglist
- FIX: Shoppinglist

### 1.6.0 (2023-12-26)

- Json Table in combination with the alexa-shoppinglist adapter can remove items
- Json Table without Head
- FIX: Menu:back
- Json Table in combination with the alexa-shoppinglist adapter can remove items
- Json Table without Head
- FIX: Menu:back
- Possibility to stop sending Menu after restart (after save)

### 1.5.1 (2023-12-20)

- No Icons in events condition
- FIX: Copy events and echarts
- Moveable DropBox
- No Icons in events condition
- FIX: Copy events and echarts
- Moveable DropBox

### 1.5.0 (2023-12-19)

- FIX: #92 send echarts
- FIX: #93 Scrollbar in Menus
- FIX: #89 go back to menu by setting setDynamicValue
- Delete all Messages by Bot
- FIX: #92 send echarts
- FIX: #93 Scrollbar in Menus
- FIX: #89 go back to menu by setting setDynamicValue
Expand Down
124 changes: 62 additions & 62 deletions admin/build/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions admin/build/index.js.map

Large diffs are not rendered by default.

40 changes: 18 additions & 22 deletions admin/src/pages/TabNavigation/nav/TableNavBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,11 @@ class TableDndNav extends Component<PropsTableDndNav, StateTableDndNav> {
handleDrop = (event, index) => {
let currentElement = event.target;
while (currentElement) {
// Überprüfe, ob das Element eine tr ist und nicht die Klasse SubTable hat
if (currentElement.tagName === "TR") {
// Setze draggable auf true oder false, je nach Bedarf
if (currentElement.classList.contains("draggingDropBox")) {
return;
}
// Beende die Schleife, wenn das passende Element gefunden wurde
}
// Gehe eine Ebene höher im DOM
currentElement = currentElement.parentNode;
}
if (index !== this.state.dropStart && index != 0) {
Expand All @@ -93,45 +89,45 @@ class TableDndNav extends Component<PropsTableDndNav, StateTableDndNav> {
render() {
return (
<TableBody>
{this.state.rows.map((row, index1) => (
{this.state.rows.map((row, indexRow) => (
<TableRow
key={index1}
key={indexRow}
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
className={
"no-select" + " " + (index1 === 0 ? (row.call != "" && row.call != "-" ? "startSideActive" : "startSideInactive") : "")
"no-select" + " " + (indexRow === 0 ? (row.call != "" && row.call != "-" ? "startSideActive" : "startSideInactive") : "")
}
draggable={handleDraggable(index1)}
onDrop={(event) => this.handleDrop(event, index1)}
draggable={handleDraggable(indexRow)}
onDrop={(event) => this.handleDrop(event, indexRow)}
onDragStart={(event) =>
handleDragStart(
index1,
indexRow,
event,
this.state.mouseOverNoneDraggable,
this.setState.bind(this),
this.props.callback.setState ? this.props.callback.setState({ draggingRowIndex: index1 }) : "",
this.props.callback.setState ? this.props.callback.setState({ draggingRowIndex: indexRow }) : "",
)
}
onDragEnd={() => handleDragEnd(this.setState.bind(this), this.props)}
onDragOver={(event) => handleDragOver(index1, event)}
onDragEnter={() => handleDragEnter(index1, this.setState.bind(this))}
style={handleStyleDragOver(index1, this.state.dropOver, this.state.dropStart)}
onDragOver={(event) => handleDragOver(indexRow, event)}
onDragEnter={() => handleDragEnter(indexRow, this.setState.bind(this))}
style={handleStyleDragOver(indexRow, this.state.dropOver, this.state.dropStart)}
>
{this.props.entries.map((entry, index) => (
<TableCell key={index} component="td" style={{ width: entry.width ? entry.width : undefined }}>
{this.props.entries.map((entry, indexCell) => (
<TableCell key={indexCell} component="td" style={{ width: entry.width ? entry.width : undefined }}>
<span
className="noneDraggable"
onMouseOver={(e) => handleMouseOver(e)}
onMouseLeave={index1 == 0 ? undefined : (e) => handleMouseOut(e)}
onMouseLeave={indexRow == 0 ? undefined : (e) => handleMouseOut(e)}
>
{getElementIcon(row[entry.name])}{" "}
<span
draggable={false}
className={
"textSubmenuInfo noneDraggable " +
(index === 0 ? (row.call === "" || row.call === "-" ? "" : "startsideHideInfo") : "startsideHideInfo")
(indexCell === 0 && (row.call === "" || row.call === "-") ? "" : "startSideHideInfo")
}
>
{I18n.t("This is a Submenu!")}
{indexRow === 0 && (row.call === "" || row.call === "-") ? <span>{I18n.t("This is a Submenu!")}</span> : null}
</span>
</span>
</TableCell>
Expand All @@ -142,11 +138,11 @@ class TableDndNav extends Component<PropsTableDndNav, StateTableDndNav> {
editRow={this.editRow}
moveDown={() => {}}
moveUp={() => {}}
deleteRow={() => deleteRow(index1, this.props, this.props.card)}
deleteRow={() => deleteRow(indexRow, this.props, this.props.card)}
rows={this.state.rows}
index={index1}
index={indexRow}
showButtons={this.props.showButtons}
notShowDelete={index1 == 0}
notShowDelete={indexRow == 0}
></ButtonCard>
</TableRow>
))}
Expand Down
4 changes: 2 additions & 2 deletions admin/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ div.MuiTabPanel-root {
background-color: #96d15a !important;
}
.MenuNavigation-Container .startSideInactive {
background-color: #eac9c7 !important;
background-color: #99c0f9 !important;
}
.MenuNavigation-Container .startsideHideInfo {
.MenuNavigation-Container .startSideHideInfo {
display: none;
}
.MenuNavigation-Container .textSubmenuInfo {
Expand Down
14 changes: 5 additions & 9 deletions src/lib/backend/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,10 @@ function generateActions(action: Actions, userObject: NewObjectNavStructure): {
}
userObject[element.trigger] = { switch: [] };
element.IDs.forEach(function (id: string, index: number) {
// Liste zum überwachen der Ids
listOfSetStateIds.push(id);
const toggle = element.switch_checkbox[index] === "true";
let value;
// Aus true oder false einen boolean machen

if (element.values[index] === "true" || element.values[index] === "false") {
value = element.values[index] === "true";
} else {
Expand Down Expand Up @@ -376,20 +375,17 @@ const adjustValueType = (value: keyof NewObjectNavStructure, valueType: string):
if (!parseFloat(value as string)) {
error([{ text: "Error: Value is not a number:", val: value }]);
return false;
} else {
return parseFloat(value as string);
}
} else if (valueType == "boolean") {
return parseFloat(value as string);
}
if (valueType == "boolean") {
if (value == "true") {
return true;
} else if (value == "false") {
return false;
}
error([{ text: "Error: Value is not a boolean:", val: value }]);
return false;
} else {
return value;
}
return value;
};

const checkEvent = (
Expand Down
5 changes: 4 additions & 1 deletion src/lib/backend/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ interface LoggingTypes {
[];

type Logging = "debug" | "error" | "info";
let _this: TelegramMenu;
const logging = (type: Logging, obj: LoggingTypes[]): void => {
const _this = TelegramMenu.getInstance();
if (!_this) {
_this = TelegramMenu.getInstance();
}
if (obj) {
obj.forEach((element) => {
let text: string = "";
Expand Down

0 comments on commit 68c8a10

Please sign in to comment.