Skip to content

Commit

Permalink
Clean up changes to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
mfechner committed Oct 15, 2024
1 parent 6f61833 commit 441a723
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 50 deletions.
8 changes: 5 additions & 3 deletions ui/src/CurrentUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ export class CurrentUser {
}

@action
private setLoggedIn = (value: boolean) => { this.loggedIn = value; }
private setLoggedIn = (value: boolean) => {
this.loggedIn = value;
};

@action
private setConnectionErrorMessage(message: string | null): void {
private setConnectionErrorMessage = (message: string | null): void => {
this.connectionErrorMessage = message;
}
};

public token = (): string => {
if (this.tokenCache !== null) {
Expand Down
12 changes: 6 additions & 6 deletions ui/src/application/Applications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ class Applications extends Component<Stores<'appStore'>> {
}

@action
private setDeleteId(id: number | false) {
private setDeleteId = (id: number | false) => {
this.deleteId = id;
}
};

@action
private setUpdateId(id: number | false) {
private setUpdateId = (id: number | false) => {
this.updateId = id;
}
};

@action
private setCreateDialog(dialog: boolean) {
private setCreateDialog = (dialog: boolean) => {
this.createDialog = dialog;
}
};

public componentDidMount = () => this.props.appStore.refresh();

Expand Down
1 change: 1 addition & 0 deletions ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {ClientStore} from './client/ClientStore';
import {PluginStore} from './plugin/PluginStore';
import {registerReactions} from './reactions';

// the development server of vite will proxy this to the backend
const devUrl = '/api/';

const {port, hostname, protocol, pathname} = window.location;
Expand Down
1 change: 1 addition & 0 deletions ui/src/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class Header extends Component<IProps> {
super(props);
makeObservable(this);
}

public render() {
const {
classes,
Expand Down
14 changes: 7 additions & 7 deletions ui/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ class Layout extends React.Component<
}

@action
private setNavOpen(open: boolean) {
private setNavOpen = (open: boolean) => {
this.navOpen = open;
}
};

@action
private setShowSettings = (show: boolean) => {
this.showSettings = show;
};

@action
public componentDidMount() {
Expand All @@ -83,11 +88,6 @@ class Layout extends React.Component<
}
}

@action
private setShowSettings(show: boolean) {
this.showSettings = show;
}

@action
public render() {
const {showSettings, currentTheme} = this;
Expand Down
10 changes: 5 additions & 5 deletions ui/src/user/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class Login extends Component<Stores<'currentUser'>> {
this.password = value;
};

@action
private setRegisterDialog = (open: boolean) => {
this.registerDialog = open;
};

public render() {
const {username, password, registerDialog} = this;
return (
Expand Down Expand Up @@ -83,11 +88,6 @@ class Login extends Component<Stores<'currentUser'>> {
);
}

@action
private setRegisterDialog = (open: boolean) => {
this.registerDialog = open;
};

@action
private login = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
Expand Down
12 changes: 6 additions & 6 deletions ui/src/user/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ class Users extends Component<WithStyles<'wrapper'> & Stores<'userStore'>> {
private editId: number | false = false;

@action
private setCreateDialog(dialog: boolean) {
private setCreateDialog = (dialog: boolean) => {
this.createDialog = dialog;
}
};

@action
private setDeleteId(id: number | false) {
private setDeleteId = (id: number | false) => {
this.deleteId = id;
}
};

@action
private setEditId(id: number | false) {
private setEditId = (id: number | false) => {
this.editId = id;
}
};

public componentDidMount = () => this.props.userStore.refresh();

Expand Down
47 changes: 24 additions & 23 deletions ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
{
"compilerOptions": {
"target": "es5",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": [
"es6",
"DOM",
"ES2020",
"DOM"
],
"sourceMap": true,
"module": "ESNext",
"skipLibCheck": true,
"esModuleInterop": true,

"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strict": true,
"isolatedModules": true,
"noEmit": true,

"module": "esnext",
"resolveJsonModule": true,
"keyofStringsOnly": true,
"noFallthroughCasesInSwitch": true,

/* Vite */
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",

/* Linting */
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"suppressImplicitAnyIndexErrors": true,
"noFallthroughCasesInSwitch": true,

"types": [
"vite/client"
]
Expand Down
10 changes: 10 additions & 0 deletions ui/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

0 comments on commit 441a723

Please sign in to comment.