Skip to content

Commit

Permalink
merge develop in main (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerberizer authored Jul 9, 2024
2 parents 5e96df5 + 270edc5 commit ea6e0d4
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/DataTable/TemplateTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import { useSetIsShosen } from "../store/store";
import { ontLookup } from "./CategoryLookUp";

const columns = [
{
accessorKey: "uuid",
header: "UUID",
cell: (props) => <>{props.getValue()}</>,
},
{
accessorKey: "template_name",
header: "Template Name",
Expand Down Expand Up @@ -75,6 +80,11 @@ export default function TemplateTable({ data }) {
globalFilter: filtering,
rowSelection,
},
initialState: {
columnVisibility: {
uuid: false,
},
},
});

const setIdShosen = useSetIsShosen();
Expand Down Expand Up @@ -110,6 +120,7 @@ export default function TemplateTable({ data }) {
</tr>
))}
</thead>
{/* {console.log(table.getRowModel().rows[0]?.original?.uuid)} */}
{table.getRowModel().rows?.length ? (
table.getRowModel().rows.map((row) => (
<tbody>
Expand Down
8 changes: 7 additions & 1 deletion src/SurveyComp/SurveyComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
useIntermediateData,
} from "../store/store";

import { useLocation } from "react-router-dom";

import config from "../utils/config";

import "survey-core/defaultV2.min.css";
Expand All @@ -36,7 +38,11 @@ function SurveyComponent({ setResult }) {
const idShosen = useIsShosen();
const setIntermediateData = useSetIntermediateData();

const id = idShosen ? idShosen : UUID;
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const uuidParams = queryParams.get("uuid");

const id = idShosen ? idShosen : UUID || uuidParams;

// eslint-disable-next-line react-hooks/exhaustive-deps
async function getTemplateInfo() {
Expand Down
8 changes: 1 addition & 7 deletions src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ export default function HomePage() {
const uuidParams = queryParams.get("uuid");
const wizardParams = queryParams.get("wizard");

// if (uuidParams) {
// setUUID(uuidParams);
// }

console.log("home", UUID);

return (
<>
{wizardParams && <WizardPage />}
{UUID ? <TemplatePage uuid={UUID} /> : null}
{uuidParams || UUID ? <TemplatePage uuid={UUID} /> : null}
{!uuidParams && !wizardParams && <StartScreenComp />}
</>
);
Expand Down
46 changes: 46 additions & 0 deletions test/other_tests/create-and-find.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* eslint-disable no-undef */
const { Builder, Browser, By } = require("selenium-webdriver");

describe("Create New Template and Find it in Table", function () {
let driver;

const templateNme = "Template for testing1";

before(async function () {
driver = await new Builder().forBrowser(Browser.CHROME).build();
});

it("should create a New Template", async function () {
await driver.get("https://enm-dev.adma.ai/designer");

await driver.findElement(By.className("createNewBtn")).click();

await driver.findElement(By.id("name")).sendKeys(templateNme);

await driver
.findElement(By.id("author"))
.sendKeys("Selenium Testing: Author");

await driver
.findElement(By.id("template_acknowledgment"))
.sendKeys("Selenium Testing: Acknowledgment");

await driver.findElement(By.id("create_new")).click();

await driver.sleep(5000);

await driver.findElement(By.className("logoWrap")).click();
});

it("should find a New Template in Table", async function () {
await driver
.findElement(By.className("search"))
.sendKeys(templateNme, Key.RETURN);

await driver.sleep(5000);
});

after(async function () {
await driver.quit();
});
});

0 comments on commit ea6e0d4

Please sign in to comment.