Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N21-1250 CTL board element #2818

Merged
merged 14 commits into from
Sep 22, 2023
23 changes: 9 additions & 14 deletions src/components/administration/ExternalToolSection.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ describe("ExternalToolSection", () => {
[NOTIFIER_MODULE_KEY.valueOf()]: notifierModule,
[AUTH_MODULE_KEY.valueOf()]: authModule,
},
stubs: {
VIcon: true,
},
});

return {
Expand Down Expand Up @@ -152,25 +155,17 @@ describe("ExternalToolSection", () => {
const firstRow = tableRows.at(0).findAll("td");
const secondRow = tableRows.at(1).findAll("td");

expect(firstRow.at(1).text()).toEqual(
expect(firstRow.at(1).find("span").text()).toEqual(
"components.externalTools.status.latest"
);
expect(
firstRow
.at(1)
.findComponent({ name: "v-icon" })
.find("path")
.attributes("d")
).toEqual(mdiCheckCircle);
expect(secondRow.at(1).text()).toEqual(
expect(firstRow.at(1).findComponent({ name: "v-icon" }).text()).toEqual(
mdiCheckCircle
);
expect(secondRow.at(1).find("span").text()).toEqual(
"components.externalTools.status.outdated"
);
expect(
secondRow
.at(1)
.findComponent({ name: "v-icon" })
.find("path")
.attributes("d")
secondRow.at(1).findComponent({ name: "v-icon" }).text()
).toEqual(mdiRefreshCircle);
});

Expand Down
18 changes: 13 additions & 5 deletions src/components/data-board/BoardApi.composable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ import {
BoardCardApiFactory,
BoardColumnApiFactory,
BoardElementApiFactory,
BoardResponse,
CardResponse,
ColumnResponse,
ContentElementType,
CreateCardBodyParamsRequiredEmptyElementsEnum,
CreateContentElementBodyParams,
ExternalToolElementContent,
FileElementContent,
RichTextElementContent,
CreateCardBodyParamsRequiredEmptyElementsEnum,
RoomsApiFactory,
BoardResponse,
CardResponse,
SubmissionContainerElementContent,
} from "@/serverApi/v3";
import { $axios, mapAxiosErrorToResponseError } from "@/utils/api";
import { AnyContentElement } from "@/types/board/ContentElement";
import { AxiosPromise } from "axios";
import { $axios, mapAxiosErrorToResponseError } from "@/utils/api";
import { createApplicationError } from "@/utils/create-application-error.factory";
import { AxiosPromise } from "axios";

export const useBoardApi = () => {
const boardApi = BoardApiFactory(undefined, "/v3", $axios);
Expand Down Expand Up @@ -90,6 +91,13 @@ export const useBoardApi = () => {
};
}

if (element.type === ContentElementType.ExternalTool) {
return {
content: element.content as ExternalToolElementContent,
type: ContentElementType.ExternalTool,
};
}

throw new Error("element.type mapping is undefined for updateElementCall");
};

Expand Down
Loading
Loading