Skip to content

Commit

Permalink
types
Browse files Browse the repository at this point in the history
  • Loading branch information
MiRo1310 committed Oct 19, 2024
1 parent 6618076 commit 4c4d136
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 980 deletions.
728 changes: 0 additions & 728 deletions admin/app.ts

This file was deleted.

208 changes: 104 additions & 104 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.

5 changes: 4 additions & 1 deletion admin/src/components/btn-Input/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export interface EventSelect {
}
class Select extends Component<SelectProps> {
onChangeHandler = (event: React.ChangeEvent<HTMLSelectElement> | undefined): void => {
this.props.callback({ id: this.props.id, val: event?.target?.value });
if (!event) {
return;
}
this.props.callback({ id: this.props.id, val: event.target.value });
};

render(): React.ReactNode {
Expand Down
5 changes: 4 additions & 1 deletion admin/src/components/btn-Input/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { PropsTextarea, StateTextarea } from "admin/app";

class Textarea extends Component<PropsTextarea, StateTextarea> {
onChangeHandler = (event: React.ChangeEvent<HTMLTextAreaElement> | undefined): void => {
this.props.callback({ val: event?.target.value, index: this.props.index, id: this.props.id });
if (!event) {
return;
}
this.props.callback({ val: event?.target.value, index: this.props.index as number, id: this.props.id });
};

render(): React.ReactNode {
Expand Down
1 change: 0 additions & 1 deletion admin/src/lib/movePosition.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Dropbox, SetStateFunction } from "admin/app";


const drag = { dragStartX: 0, dragStartY: 0, dragEndX: 0, dragEndY: 0 };

export function onDragStart(event: React.DragEvent<HTMLDivElement> | undefined): void {
Expand Down
2 changes: 1 addition & 1 deletion admin/src/lib/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function getAllTelegramInstances(socket: socket, callback: (val: string[]) => vo
console.error("Error getAllTelegramInstance: " + JSON.stringify(err));
}

function isAdapterTelegram(objects: Record<string, ioBroker.InstanceObject & { type: "instance" }>, obj: string): boolean {
function isAdapterTelegram(objects: Record<string, any & { type: "instance" }>, obj: string): boolean {
return "telegram" === objects?.[obj]?.common.name;
}
}
Expand Down
4 changes: 2 additions & 2 deletions admin/src/pages/AppContentHeaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class HeaderMenu extends Component<PropsHeaderMenu> {
this.props.callback.setStateApp({ showPopupMenuList: !this.props.data.state.showPopupMenuList });
};

showList() {
showList(): boolean {
return this.props.data.state.showPopupMenuList;
}

isActiveMenu() {
isActiveMenu(): boolean {
return this.props.data.state.activeMenu != undefined;
}

Expand Down
4 changes: 2 additions & 2 deletions admin/src/pages/AppContentHeaderTelegramUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class HeaderTelegramUsers extends Component<PropsHeaderTelegramUsers, StateHeade
return true;
}
};
isUserGroupLength() {
return Object.keys(this.props.data.usersInGroup).length;
isUserGroupLength(): boolean {
return Object.keys(this.props.data.usersInGroup).length !== 0;
}

render(): React.ReactNode {
Expand Down
2 changes: 1 addition & 1 deletion admin/src/pages/AppContentTabActionContentRowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class AppContentTabActionContentRowEditor extends Component<PropsRowEditPopupCar
isValueChanged: false,
triggerName: "",
renamedTriggerName: "",
saveData: { checkboxesToCopy: [], copyToMenu: "", activeMenu: "", tab: "", rowIndexToEdit: 0 },
saveData: { checkboxesToCopy: [], copyToMenu: "", activeMenu: "", tab: "", rowIndexToEdit: 0, newTriggerName: "" },
targetCheckboxes: {},
isValueOk: false,
};
Expand Down
12 changes: 3 additions & 9 deletions admin/src/pages/AppContentTabNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class TabNavigation extends Component<PropsTabNavigation, StateTabNavigation> {
this.setState({ newRow: obj, rowPopup: true });
};

popupHelperCard = (isOK: boolean): void => {
if (isOK) {
popupHelperCard = ({ value }: EventButton): void => {
if (value) {
const copyNewRow = deepCopy(this.state.newRow);
if (!copyNewRow) {
return;
Expand Down Expand Up @@ -135,13 +135,7 @@ class TabNavigation extends Component<PropsTabNavigation, StateTabNavigation> {
</Table>
</TableContainer>
{this.state.rowPopup ? (
<TableNavEditRow
state={this.state}
setState={this.setState.bind(this)}
data={this.props.data}
entries={this.props.data.entries}
popupRowCard={this.popupRowCard}
/>
<TableNavEditRow state={this.state} setState={this.setState.bind(this)} data={this.props.data} popupRowCard={this.popupRowCard} />
) : null}
{this.state.helperText ? (
<TableNavHelper
Expand Down
8 changes: 1 addition & 7 deletions admin/src/pages/AppContentTabNavigationTableRowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ class TableNavEditRow extends Component<PropsTableNavEditRow> {
if (id) {
copyNewRow[id] = val.toString();
}
//REVIEW -
// else {
// Object.keys(data).forEach((key) => {
// copyNewRow[key] = data[key];
// });
// }
this.props.setState({ newRow: copyNewRow });
};
changeCheckbox = ({ isChecked, id }: EventCheckbox): void => {
Expand Down Expand Up @@ -67,7 +61,7 @@ class TableNavEditRow extends Component<PropsTableNavEditRow> {
callback={{ onChangeInput: this.changeInput, onChangeCheckbox: this.changeCheckbox }}
inUse={this.props.state.callInUse}
openHelperText={this.openHelperText}
entries={this.props.entries}
entries={this.props.data.entries}
newRow={this.props.state.newRow}
/>
</PopupContainer>
Expand Down
1 change: 0 additions & 1 deletion admin/src/types/props-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export interface PropsTableNavEditRow {
state: StateTabNavigation;
setState: SetStateFunction;
data: DataMainContent & { entries: TabValueEntries[] };
entries: TabValueEntries[];
popupRowCard: ({ }: EventButton) => void;
}

Expand Down
117 changes: 0 additions & 117 deletions admin/src/types/props-types.ts

This file was deleted.

Loading

0 comments on commit 4c4d136

Please sign in to comment.