Skip to content

Commit

Permalink
Introduced Reusable JSON Parser and Validator with Schema, File Previ…
Browse files Browse the repository at this point in the history
…ew, and Selected Import Support for XLSX/CSV Files (#7367)

* added new package

* removed 2 packages

* changed route for external result import modal

* updated schemas

* custom schema parser

* modified schema parser

* added file drag and drop component

* modified assest import modal to use reusable component

* excel viewer component

* modified import name

* external result upload modal

* lazy import

* Modified templete for external results import file

* cypress fix

* updated cypress templete

* fixes incorrect date format with csv files

* cypress fix

* Added documentation

* code reviews

* Error on hover

* merges pr #7339

* fix the flaky test

* change the cypress to use Reusable component

* fix type errors

* lint fix

---------

Co-authored-by: Gigin George <[email protected]>
Co-authored-by: Mohammed Nihal <[email protected]>
Co-authored-by: Ashesh3 <[email protected]>
  • Loading branch information
4 people authored Apr 24, 2024
1 parent b4b70e4 commit 782a77d
Show file tree
Hide file tree
Showing 16 changed files with 1,171 additions and 835 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/external_results_spec/external_result.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ describe("Edit Profile Testing", () => {
cy.intercept("POST", "/api/v1/external_result/bulk_upsert").as("import");
cy.get("div").contains("Import/Export").click();
cy.get("div").contains("Import Results").click();
cy.get("[id=result-upload]")
.selectFile("cypress/fixtures/externalresultsample.csv")
cy.get("[data-testid=import-file]")
.selectFile("cypress/fixtures/externalresultsample.csv", { force: true })
.wait(100);
cy.get("button").contains("Save").click();
cy.submitButton("Import");
cy.wait("@import").then((interception) => {
expect(interception.response.statusCode).to.equal(202);
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/externalresultsample.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
District,srf id,name,age,age in,gender,mobile number,address,ward,local body,local body type,source,Sample Collection Date,result date,test type,lab name,sample type,patient status,Is Repeat,patient category,result
District,SRF ID,Name,Age,Age in,Gender,Mobile Number,Address,Ward,Local Body,Local Body Type,Source,Sample Collection Date,Result Date,Test Type,Lab Name,Sample Type,Patient Status,Is Repeat,Patient Category,Result
Ernakulam,00/EKM/0000,Test Upload,24,years,m,8888888888,Upload test address,7,Poothrikka,grama panchayath,Secondary contact aparna,2020-10-14,2020-10-14,Antigen,Karothukuzhi Laboratory,Ag-SD_Biosensor_Standard_Q_COVID-19_Ag_detection_kit,Asymptomatic,NO,Cat 17: All individuals who wish to get themselves tested,Negative
2 changes: 1 addition & 1 deletion cypress/pageobject/Asset/AssetCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class AssetPage {
}

importAssetFile() {
cy.get("[data-testid=import-asset-file]")
cy.get("[data-testid=import-file]")
.selectFile("cypress/fixtures/sampleAsset.xlsx", { force: true })
.wait(100);
}
Expand Down
Loading

0 comments on commit 782a77d

Please sign in to comment.