Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
huwshimi committed Jan 15, 2024
1 parent 767e72e commit 82e2354
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/RadioInputBox/OptionInputs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ describe("OptionInputs", () => {
expect(onValuesChange).toHaveBeenCalledTimes(1);
await userEvent.type(screen.getByRole("textbox", { name: "fruit" }), "foo");
// On change gets called for each letter that is typed into the textbox.
expect(onValuesChange).toHaveBeenCalledTimes(5);
expect(onValuesChange.mock.calls[4]).toEqual([
expect(onValuesChange).toHaveBeenCalledTimes(4);
expect(onValuesChange.mock.calls[3]).toEqual([
"MyAction",
{ "MyAction-fruit": "foo", "MyAction-veg": "" },
]);
Expand Down
6 changes: 4 additions & 2 deletions src/juju/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ export async function fetchAllModelStatuses(
modelUUIDList.forEach((modelUUID) => {
queue.push(async (done) => {
if (isLoggedIn(getState(), wsControllerURL)) {
const modelWsControllerURL = getModelByUUID(getState(), modelUUID)
?.wsControllerURL;
const modelWsControllerURL = getModelByUUID(
getState(),
modelUUID,
)?.wsControllerURL;
if (modelWsControllerURL) {
await fetchAndStoreModelStatus(
modelUUID,
Expand Down
9 changes: 4 additions & 5 deletions src/pages/EntityDetails/Model/Logs/ActionLogs/ActionLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ export default function ActionLogs() {
() => (modelName ? getModelUUID(modelName) : null),
[modelName],
);
const modelUUID = useSelector(
(state: RootState) => getModelUUIDMemo?.(state),
const modelUUID = useSelector((state: RootState) =>
getModelUUIDMemo?.(state),
);
const modelStatusData = useSelector(getModelStatus(modelUUID));

Expand All @@ -220,9 +220,8 @@ export default function ActionLogs() {
if (operationList?.results) {
setOperations(operationList.results);
const actionsTags = operationList.results
.flatMap(
(operation: OperationResult) =>
operation.actions?.map((action) => action.action.tag),
.flatMap((operation: OperationResult) =>
operation.actions?.map((action) => action.action.tag),
)
.filter((actionTag?: string): actionTag is string => !!actionTag)
.map((actionTag: string) => ({ tag: actionTag }));
Expand Down
4 changes: 2 additions & 2 deletions src/panels/ActionsPanel/ActionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export default function ActionsPanel(): JSX.Element {
() => (modelName ? getModelUUID(modelName) : null),
[modelName],
);
const modelUUID = useSelector(
(state: RootState) => getModelUUIDMemo?.(state),
const modelUUID = useSelector((state: RootState) =>
getModelUUIDMemo?.(state),
);
const [disableSubmit, setDisableSubmit] = useState<boolean>(true);
const [actionData, setActionData] = useState<ActionData>({});
Expand Down

0 comments on commit 82e2354

Please sign in to comment.