[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2022-10-24 23:10:46 +00:00
parent d5beda293b
commit 7c92902e48
16 changed files with 49 additions and 49 deletions

View File

@@ -98,13 +98,13 @@ const AddUser = (props) => {
.then((data) => dispatchPageChange(data, 0))
.then(() => history.push("/"))
.catch(() =>
setErrorAlert(`Failed to update users.`)
setErrorAlert(`Failed to update users.`),
)
: setErrorAlert(
`Failed to create user. ${
data.status == 409 ? "User already exists." : ""
}`
)
}`,
),
)
.catch(() => setErrorAlert(`Failed to create user.`));
}}

View File

@@ -131,7 +131,7 @@ test("Shows a more specific UI error dialogue when user creation returns an impr
});
let errorDialog = screen.getByText(
"Failed to create user. User already exists."
"Failed to create user. User already exists.",
);
expect(errorDialog).toBeVisible();

View File

@@ -81,14 +81,14 @@ const CreateGroup = (props) => {
.then((data) => dispatchPageUpdate(data, 0))
.then(() => history.push("/groups"))
.catch(() =>
setErrorAlert(`Could not update groups list.`)
setErrorAlert(`Could not update groups list.`),
)
: setErrorAlert(
`Failed to create group. ${
data.status == 409
? "Group already exists."
: ""
}`
}`,
);
})
.catch(() => setErrorAlert(`Failed to create group.`));

View File

@@ -107,7 +107,7 @@ test("Shows a more specific UI error dialogue when user creation returns an impr
});
let errorDialog = screen.getByText(
"Failed to create group. Group already exists."
"Failed to create group. Group already exists.",
);
expect(errorDialog).toBeVisible();

View File

@@ -96,8 +96,8 @@ const EditUser = (props) => {
.then(() => history.push("/"))
.catch(() =>
setErrorAlert(
`Could not update users list.`
)
`Could not update users list.`,
),
)
: setErrorAlert(`Failed to edit user.`);
})
@@ -129,7 +129,7 @@ const EditUser = (props) => {
editUser(
username,
updatedUsername != "" ? updatedUsername : username,
admin
admin,
)
.then((data) => {
data.status < 300
@@ -137,7 +137,7 @@ const EditUser = (props) => {
.then((data) => dispatchPageChange(data, 0))
.then(() => history.push("/"))
.catch(() =>
setErrorAlert(`Could not update users list.`)
setErrorAlert(`Could not update users list.`),
)
: setErrorAlert(`Failed to edit user.`);
})

View File

@@ -94,10 +94,10 @@ const GroupEdit = (props) => {
}
let new_users = selected.filter(
(e) => !group_data.users.includes(e)
(e) => !group_data.users.includes(e),
);
let removed_users = group_data.users.filter(
(e) => !selected.includes(e)
(e) => !selected.includes(e),
);
let promiseQueue = [];
@@ -105,7 +105,7 @@ const GroupEdit = (props) => {
promiseQueue.push(addToGroup(new_users, group_data.name));
if (removed_users.length > 0)
promiseQueue.push(
removeFromGroup(removed_users, group_data.name)
removeFromGroup(removed_users, group_data.name),
);
Promise.all(promiseQueue)

View File

@@ -90,7 +90,7 @@ const GroupSelect = (props) => {
>
{e}
</div>
)
),
)}
</div>
</div>

View File

@@ -37,7 +37,7 @@ const Groups = (props) => {
useEffect(() => {
updateGroups(offset, limit).then((data) =>
dispatchPageUpdate(data.items, data._pagination)
dispatchPageUpdate(data.items, data._pagination),
);
}, [offset, limit]);

View File

@@ -38,11 +38,11 @@ const ServerDashboard = (props) => {
adminAsc = (e) => e.sort((a) => (a.admin ? 1 : -1)),
dateDesc = (e) =>
e.sort((a, b) =>
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? -1 : 1
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? -1 : 1,
),
dateAsc = (e) =>
e.sort((a, b) =>
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? 1 : -1
new Date(a.last_activity) - new Date(b.last_activity) > 0 ? 1 : -1,
),
runningAsc = (e) => e.sort((a) => (a.server == null ? -1 : 1)),
runningDesc = (e) => e.sort((a) => (a.server == null ? 1 : -1));
@@ -136,7 +136,7 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() => {
@@ -176,7 +176,7 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() => {
@@ -471,7 +471,7 @@ const ServerDashboard = (props) => {
failedServers.length > 1 ? "servers" : "server"
}. ${
failedServers.length > 1 ? "Are they " : "Is it "
} already running?`
} already running?`,
);
}
return res;
@@ -482,11 +482,11 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() =>
setErrorAlert(`Failed to update users list.`)
setErrorAlert(`Failed to update users list.`),
);
return res;
})
@@ -511,7 +511,7 @@ const ServerDashboard = (props) => {
failedServers.length > 1 ? "servers" : "server"
}. ${
failedServers.length > 1 ? "Are they " : "Is it "
} already stopped?`
} already stopped?`,
);
}
return res;
@@ -522,11 +522,11 @@ const ServerDashboard = (props) => {
dispatchPageUpdate(
data.items,
data._pagination,
name_filter
name_filter,
);
})
.catch(() =>
setErrorAlert(`Failed to update users list.`)
setErrorAlert(`Failed to update users list.`),
);
return res;
})

View File

@@ -369,7 +369,7 @@ test("Shows a UI error dialogue when start all servers fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -403,7 +403,7 @@ test("Shows a UI error dialogue when stop all servers fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -437,7 +437,7 @@ test("Shows a UI error dialogue when start user server fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -471,7 +471,7 @@ test("Shows a UI error dialogue when start user server returns an improper statu
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -505,7 +505,7 @@ test("Shows a UI error dialogue when stop user servers fails", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -539,7 +539,7 @@ test("Shows a UI error dialogue when stop user server returns an improper status
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});
@@ -585,7 +585,7 @@ test("Search for user calls updateUsers with name filter", async () => {
/>
</Switch>
</HashRouter>
</Provider>
</Provider>,
);
});