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

Metadata uploader base #1445

Merged
merged 207 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
9331f47
reading file with sheetjs
ksierks Aug 31, 2022
74c1369
persisting file contents
ksierks Sep 1, 2022
cee5320
Merge branch 'metadata-uploader-base' into metadata-uploader-parse-file
ksierks Sep 8, 2022
ece38b9
setting sample name column
ksierks Sep 9, 2022
b60996b
starting to show metadata in table on review step
ksierks Sep 9, 2022
becabf5
starting to show metadata in table on review step
ksierks Sep 9, 2022
9789f43
supplementing metadata after sample name column is selected
ksierks Sep 12, 2022
5876171
fixing onCell for sample name collumn
ksierks Sep 13, 2022
f0aebf6
working on validating sample names
ksierks Sep 14, 2022
86daff7
navigating to review page once setting sample name is complete
ksierks Sep 15, 2022
1f2f2b0
starting to create/update samples with metadata
ksierks Sep 16, 2022
f141727
displaying stats on complete page
ksierks Sep 16, 2022
b70cf42
fixing stats
ksierks Sep 20, 2022
5ab8c35
showing errors
ksierks Sep 20, 2022
9201e48
keeping formatted numeric cells instead of raw
ksierks Sep 21, 2022
77702a9
fixing tests
ksierks Sep 21, 2022
cfeafaa
fixing typescript errors
ksierks Sep 21, 2022
2fcfe85
adding table pagination to review table
ksierks Sep 21, 2022
11c6ffa
adding progress bar for saving samples
ksierks Sep 22, 2022
22d4aea
trying chunk uploading
ksierks Sep 23, 2022
a87f615
fixing test
ksierks Sep 23, 2022
e20bc82
adding some spinners to pages to show loading
ksierks Sep 27, 2022
9dd9e60
navigating back to beginning after upload complete
ksierks Sep 27, 2022
facf54f
storing saving and validation details in seperate hashes instead of m…
ksierks Sep 28, 2022
6cb252f
Merge branch 'metadata-uploader-base' into metadata-uploader-parse-file
ksierks Sep 28, 2022
4b8c1d6
skipping saving samples that have already been saved
ksierks Sep 28, 2022
d47b7ff
converting SampleMetadataImportSteps.jsx to typescript
ksierks Sep 28, 2022
29612d2
converting SampleMetadataImportUploadFile.jsx to typescript
ksierks Sep 29, 2022
ef985c4
converting SampleMetadataImportMapHeaders.jsx to typescript
ksierks Oct 4, 2022
ce16ddf
converting SampleMetadataImportReview.tsx to typescript
ksierks Oct 5, 2022
997c1d5
converting SampleMetadataImportComplete.jsx to typescript
ksierks Oct 5, 2022
02987a9
more typescript
ksierks Oct 5, 2022
b907052
getting around deadlock
ksierks Oct 5, 2022
3a17030
fix test
ksierks Oct 5, 2022
a50d6d7
eslinting
ksierks Oct 7, 2022
d5b971a
removing todo
ksierks Oct 11, 2022
ed048d9
starting to add restriction drop-down to map headers step
ksierks Oct 12, 2022
5bde69f
disabling restriction drop-down on sample name column selection
ksierks Oct 13, 2022
079bde3
starting to save restriction level changes
ksierks Oct 13, 2022
3e73b7e
starting to save metadata restrictions
ksierks Oct 14, 2022
edeea0b
removing redundant code
ksierks Oct 14, 2022
7aa1ffe
retreiving restriction drop-down list
ksierks Oct 17, 2022
981db32
saving state on page refresh
ksierks Oct 18, 2022
e208e2a
changing for loop syntax
ksierks Oct 18, 2022
aeeb549
making children not optional for SampleMetadataImportWizardProps
ksierks Oct 18, 2022
0e459f6
fixing wizard layout
ksierks Oct 18, 2022
4da7a74
removing file extension on DragUpload import
ksierks Oct 18, 2022
43b438e
fixing DraagUpload type
ksierks Oct 18, 2022
e022f0d
updating colors to use css variables
ksierks Oct 18, 2022
73a4670
Merge pull request #1362 from phac-nml/metadata-uploader-parse-file
ericenns Oct 24, 2022
012a998
Merge branch 'development' into metadata-uploader-base
ksierks Oct 24, 2022
b320e76
Merge branch 'metadata-uploader-base' into metadata-uploader-restrict…
ksierks Oct 25, 2022
ca2e106
changing restriction select to radio button group
ksierks Oct 25, 2022
0c9197a
replacing table row selection with select sample name column drop down
ksierks Oct 27, 2022
8da49bc
changing updatedHeaders to useRef from useState
ksierks Oct 27, 2022
cefa13b
removing preselecting a sample name column and showing table empty on…
ksierks Oct 27, 2022
08a7fd5
diplaying table on sample name column instead of showing table empty
ksierks Oct 27, 2022
cd02954
making table scrollable
ksierks Oct 27, 2022
b008827
defaulting headers to existing project metadata field restrictions
ksierks Oct 28, 2022
97b7dcd
reset state on completion
ksierks Oct 31, 2022
228e414
assuming metadata fields with restrictions are already created before…
ksierks Nov 1, 2022
2f05516
starting to create a new api endpoint to create metadata fields with …
ksierks Nov 1, 2022
2af3507
fixing create metadata fields api endpoint
ksierks Nov 2, 2022
fa6f962
removing commented out code
ksierks Nov 2, 2022
537540a
storing a separate session for each project
ksierks Nov 3, 2022
baa77cf
removing redirection on completion
ksierks Nov 3, 2022
1eff1a3
adding quick and dirty way to strip leading & trailing whitespace fro…
ksierks Nov 3, 2022
8701f4f
fixing tests
ksierks Nov 3, 2022
2e25abb
starting to create new batch api endpoints
ksierks Nov 4, 2022
e4f8e66
Merge branch 'development' into metadata-uploader-base
ksierks Nov 4, 2022
5d458ac
Merge branch 'metadata-uploader-base' into metadata-uploader-restrict…
ksierks Nov 4, 2022
c186502
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Nov 4, 2022
415a59b
adding table empty
ksierks Nov 7, 2022
b3c4c85
adding table title
ksierks Nov 7, 2022
3ac75f0
using useMemo for table dataSouce
ksierks Nov 7, 2022
9f9a7f7
sending requests in chunks
ksierks Nov 9, 2022
6aa9d6c
fixing error handling
ksierks Nov 9, 2022
6bd6f1e
Merge branch 'development' into metadata-uploader-base
ksierks Nov 10, 2022
bdec14e
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Nov 10, 2022
8e8f642
Merge branch 'metadata-uploader-base' into metadata-uploader-restrict…
ksierks Nov 10, 2022
cb67fb1
changing 'Map Headers' to 'Map Columns'
ksierks Nov 10, 2022
98d84d7
fixing formatting
ksierks Nov 10, 2022
c821719
working on showing existing and target restrictions
ksierks Nov 10, 2022
7fa98a2
converting TargetMetadataRestriction.jsx to typescript
ksierks Nov 10, 2022
1ee66b0
starting to add unique key on label for metadata_field table
ksierks Nov 15, 2022
7052de4
replacing select with radio group buttons in TargetMetadataRestrictio…
ksierks Nov 15, 2022
a425908
fixing test
ksierks Nov 16, 2022
9dafa49
renaming 'Upload File' to 'Select File'
ksierks Nov 16, 2022
cb216c1
changing ant design upload options so it does not do a post request
ksierks Nov 16, 2022
5edd11e
changing ant design upload options so it does not do a post request
ksierks Nov 16, 2022
ef78aeb
making create project modal wider
ksierks Nov 16, 2022
7fb6846
updating project settings metadata fields to use radio group buttons
ksierks Nov 16, 2022
4aee64a
updating project settings metadata fields to use radio group buttons
ksierks Nov 16, 2022
9790a63
removing unused params
ksierks Nov 17, 2022
4f133d1
renaming MetadataFieldModel.java to MetadataEntryModel.java
ksierks Nov 17, 2022
45e33ca
Merge branch 'development' into metadata-uploader-base
ksierks Nov 17, 2022
57f21f8
Merge branch 'metadata-uploader-base' into metadata-uploader-restrict…
ksierks Nov 17, 2022
f14991a
replacing metadata restrictions select with radio group buttons for s…
ksierks Nov 17, 2022
20f092f
fixing tests
ksierks Nov 17, 2022
15db852
getting the locked samples for a project
ksierks Nov 18, 2022
07b5a3c
adding locked sample column to review table
ksierks Nov 21, 2022
2bf3e13
moving locked samples into an alert
ksierks Nov 21, 2022
0b60284
fixing complete stats
ksierks Nov 21, 2022
d11153b
Merge pull request #1383 from phac-nml/metadata-uploader-restrictions
joshsadam Nov 23, 2022
805e01f
disabling buttons and table during loading
ksierks Nov 23, 2022
23aaf61
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Nov 23, 2022
6e72446
adding promise chaining back in
ksierks Nov 25, 2022
bcb14d0
replacing step progress bar with table overlay progress bar
ksierks Dec 1, 2022
e3f82ed
moving loading text into spinner
ksierks Dec 2, 2022
211152d
moving returning ResponseEntity into controller
ksierks Dec 5, 2022
05b1340
fixing broken test
ksierks Dec 5, 2022
d9bb07f
fixing create project sample from modal
ksierks Dec 5, 2022
8a53a63
moving returning ResponseEntity into controller
ksierks Dec 5, 2022
5b83ebe
Merge pull request #1419 from phac-nml/metadata-uploader-progress-bar
joshsadam Dec 5, 2022
60e4bec
adding more tests
ksierks Dec 5, 2022
8845722
adding comments
ksierks Dec 5, 2022
f8ec2ac
Merge branch 'development' into metadata-uploader-base
ksierks Dec 5, 2022
bb75d78
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Dec 5, 2022
d9f98a8
fixing unmounted component error
ksierks Dec 5, 2022
2b79f0a
starting to work on handling duplicate file header names
ksierks Dec 6, 2022
f6d0db7
starting to work on handling duplicate file header names
ksierks Dec 6, 2022
d520b75
starting to work on handling duplicate file header names
ksierks Dec 7, 2022
79d4c90
changing path names
ksierks Dec 7, 2022
b357be2
returning a mult-status response from controller
ksierks Dec 7, 2022
43780af
adding functionality to calculate chunk size
ksierks Dec 7, 2022
a059c96
creating CreateSampleResponse and UpdateSampleResponse objects
ksierks Dec 8, 2022
3f07609
Merge branch 'development' into metadata-uploader-base
ksierks Dec 8, 2022
c162ee4
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Dec 8, 2022
983aa63
fixing tests
ksierks Dec 8, 2022
3576845
playing with a second web driver to have seperate users logged in sim…
ksierks Dec 9, 2022
2993915
cleaning up unused, old code
ksierks Dec 9, 2022
47c19ba
Merge branch 'metadata-uploader-base' into metadata-uploader-validate…
ksierks Dec 9, 2022
8784157
replacing notification with alert
ksierks Dec 9, 2022
2f65a56
setting up delete samples during import test
ksierks Dec 12, 2022
07a587b
setting up create new sample during import test
ksierks Dec 12, 2022
e2c6c7f
setting up remove access during import test
ksierks Dec 12, 2022
ac0fdaa
finishing tests
ksierks Dec 16, 2022
4a394f0
updating documentation
ksierks Dec 16, 2022
3900bda
Merge branch 'development' into metadata-uploader-base
ksierks Dec 16, 2022
ad886b2
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Dec 16, 2022
deca056
trying to fix flaky tests
ksierks Dec 19, 2022
84c31f2
trying to fix flaky tests
ksierks Dec 19, 2022
874f6ab
trying to fix flaky tests
ksierks Dec 20, 2022
eb581b8
removing old restriction code
ksierks Dec 21, 2022
d0b3495
adding more comments
ksierks Dec 21, 2022
4712e69
using metadataSaveDetails from state
ksierks Dec 21, 2022
3eda36c
removing log statements
ksierks Dec 21, 2022
8f6bde8
adding partial success upload notification
ksierks Dec 21, 2022
8665d0c
removing returned metadataSaveDetails as it is redundant
ksierks Dec 21, 2022
687f4bf
creating a import-utilities.js file for refactoring
ksierks Dec 21, 2022
6ee2590
simplifying code and calling Promise.all
ksierks Dec 21, 2022
0d84b2c
using forEach instead of map
ksierks Dec 21, 2022
54cc39e
returning more explicit filter
ksierks Dec 21, 2022
03e22a8
adding comments
ksierks Dec 22, 2022
9071f0c
more refactoring
ksierks Dec 22, 2022
2cd44f6
more refactoring
ksierks Dec 23, 2022
63ca764
fixing some tests
ksierks Jan 4, 2023
9bf838b
adding a test
ksierks Jan 5, 2023
463e7d9
Merge branch 'development' into metadata-uploader-base
ksierks Jan 5, 2023
fc0c5f0
Merge branch 'metadata-uploader-base' into metadata-uploader-validate…
ksierks Jan 5, 2023
5d7b998
Merge branch 'metadata-uploader-base' into metadata-uploader-batch-en…
ksierks Jan 6, 2023
47a06aa
fixing chunkArray function
ksierks Jan 6, 2023
234c460
fixing chunkArray function
ksierks Jan 6, 2023
a62081d
taking care of all the 'any' types
ksierks Jan 6, 2023
b7cbb89
memorizing filter
ksierks Jan 6, 2023
600dcbd
applying eslint suggestions
ksierks Jan 6, 2023
2a6ad22
making a clone of param because splice is destructive
ksierks Jan 6, 2023
c391d57
resolving typescript warning
ksierks Jan 6, 2023
3ce8e16
resolving typescript warning
ksierks Jan 6, 2023
8a388a5
renaming type
ksierks Jan 6, 2023
7931412
fixing tests
ksierks Jan 7, 2023
e17ee8d
applying eslint suggestion
ksierks Jan 9, 2023
7fd0d33
renaming SampleItemResponse
ksierks Jan 9, 2023
3dbcfcc
adding space between drag'n'drop and alert
ksierks Jan 10, 2023
85d4aa0
updating text in message.properties
ksierks Jan 10, 2023
32b31f7
Merge pull request #1408 from phac-nml/metadata-uploader-batch-endpoints
ericenns Jan 10, 2023
69686f2
reading file into a multidimensional array
ksierks Jan 11, 2023
8910820
Merge branch 'metadata-uploader-base' into metadata-uploader-validate…
ksierks Jan 11, 2023
22308b0
fixing tests
ksierks Jan 11, 2023
99d45ee
autofocus on sampleNameColumn drop-down
ksierks Jan 11, 2023
0e6f15c
applying eslint suggestion
ksierks Jan 11, 2023
de691e1
moving empty error message from notification to alert
ksierks Jan 12, 2023
17ba9f2
adding empty and duplicate headers tests
ksierks Jan 12, 2023
a54ec79
storing validation messages in an array
ksierks Jan 12, 2023
757da08
using list component
ksierks Jan 12, 2023
f2fe8f2
reverting back to using an unordered list
ksierks Jan 13, 2023
bb81d34
Merge pull request #1434 from phac-nml/metadata-uploader-validate-file
deepsidhu85 Jan 13, 2023
26f0965
Merge branch 'development' into metadata-uploader-base
ksierks Jan 13, 2023
d9abf36
updating changelog
ksierks Jan 13, 2023
1550f72
fixing eslint errors
ksierks Jan 13, 2023
2193759
Merge branch 'development' into metadata-uploader-base
ksierks Jan 18, 2023
3466791
fixing checkstyle errors from bad merge
ksierks Jan 18, 2023
4103ad7
Merge branch 'development' into metadata-uploader-base
ksierks Jan 23, 2023
8e44302
moving MetadataField into index.d.ts
ksierks Jan 27, 2023
5c50179
trying to type async functions in field.ts
ksierks Jan 27, 2023
4cf05f5
removing empty function calls from AddMemberButton.jsx
ksierks Jan 27, 2023
13ff1fc
starting to convert AddMemberButton.jsx to AddMemberButton.tsx
ksierks Jan 27, 2023
40ca222
fixing warning
ksierks Jan 27, 2023
d859c4c
adding missing file comment
ksierks Jan 27, 2023
ca4e7d1
Merge branch 'development' into metadata-uploader-base
ksierks Jan 27, 2023
0eb00c1
converting index.js to index.tsx
ksierks Jan 27, 2023
8588cc9
trying to resolve some of the eslint errors in AddMemberButton.tsx
ksierks Jan 27, 2023
a179161
trying to resolve some of the eslint errors in index.d.ts
ksierks Jan 27, 2023
d052140
Updating 'press' to 'click' in documentation
ksierks Jan 27, 2023
dea1f20
missing constructor comment
ksierks Jan 27, 2023
e49eef8
Merge branch 'development' into metadata-uploader-base
ksierks Jan 27, 2023
55c2e2a
fixing UpdateSampleResponse and CreateSampleResponse
ksierks Jan 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [UI/Developer]: Removed old notification system hack and updated to use only Ant Design notifications. See [PR 1447](https://github.com/phac-nml/irida/pull/1447)
* [UI]: Fixed bug where the `User` column was named `User Group` on the admin User Groups page. [See PR 1450](https://github.com/phac-nml/irida/pull/1450)
* [Developer]: Replaced Apache OLTU with Nimbusds for performing OAuth2 authentication flow during syncing and Galaxy exporting. See [PR 1432](https://github.com/phac-nml/irida/pull/1432)
* [Developer/UI]: Performance enhancements to the metadata uploader. See [PR 1445](https://github.com/phac-nml/irida/pull/1445).

## [22.09.7] - 2022/01/24
* [UI]: Fixed bugs on NCBI Export page preventing the NCBI `submission.xml` file from being properly written. See [PR 1451](https://github.com/phac-nml/irida/pull/1451)
Expand Down
Binary file added doc/user/user/sample-metadata/images/loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified doc/user/user/sample-metadata/images/upload-preview-errors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/user/user/sample-metadata/images/upload-preview-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/user/user/sample-metadata/images/upload-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/user/user/sample-metadata/images/upload-selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 14 additions & 6 deletions doc/user/user/sample-metadata/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,31 @@ Links to the upload page can be found:

Any CSV or Excel spreadsheet containing metadata for samples in a project can be uploaded through the IRIDA web interface. One of the column in the table __must__ correspond to the sample name within the project. In this example spreadsheet, the `NLEP #` column is the sample name.

The first step is to select the CSV or Excel file containing the data. Either click on the square label `Click or drop Excel/CSV file containing metadata for samples in this project.` or drag and drop the file from your file browser.
The first step is to select the CSV or Excel file containing the data. Either click or drag the file into the drop zone from your file browser.

![Select spreadsheet](images/upload-selection.png)

After uploading a spreadsheet, the column corresponding to the sample name must be selected. After selecting the column header, press the `Preview the data` button.
After uploading a spreadsheet, you will be brought to the `Map Columns` step. The column corresponding to the sample name must be selected.

![Select name column.](images/upload-column.png)
![Select name column.](images/upload-column-before.png)

Rows that do not match an existing sample name are identified with the `New` tag. If selected, these samples will automatically be created. Rows that do match an existing sample name will be updated. Only select the rows that are to be uploaded and press the `Upload the data` button.
Once the sample name column is selected, a table will be displayed listing all the metadata fields. You can review the existing and target metadata field restrictions here. Click the `Review the data` button to continue.

![Select name column.](images/upload-column-after.png)

You may select the rows that are to be uploaded on the `Review Data` step. Rows that do not match an existing sample name are identified with the `New` tag. If selected, these samples will automatically be created. Rows that match an existing sample name will be updated.

![Preview Upload](images/upload-preview.png)

Rows that have an invalid sample name will be highlighted in red. These errors should be fixed within the spreadsheet and re-imported.
Rows that have an invalid sample name will be highlighted in red. These errors should be fixed within the spreadsheet and re-imported. Click the `Upload the data` button to continue.

![Upload Preview Errors](images/upload-preview-errors.png)

The complete page will be displayed on a successful upload. Clicking on the `Upload another file` button will redirect to the beginning of a new upload.
Progress will be displayed while uploading. Please be patient while uploading large data sets. Do not close the window or leave the page.

![Upload Preview Errors](images/loading.png)

On a successful upload, you will be brought to the `Complete` step. Clicking on the `Upload another file` button will redirect to the beginning of a new upload.

![Upload Preview Success](images/upload-preview-success.png)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
package ca.corefacility.bioinformatics.irida.model.sample;

import ca.corefacility.bioinformatics.irida.model.sample.metadata.MetadataEntry;
import org.hibernate.envers.Audited;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.util.List;
import java.util.Objects;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Objects;

import org.hibernate.envers.Audited;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import ca.corefacility.bioinformatics.irida.model.sample.metadata.MetadataEntry;

/**
* Describes an individual field in a {@link MetadataTemplate}.
*/
@Entity
@Table(name = "metadata_field")
@Table(name = "metadata_field",
uniqueConstraints = @UniqueConstraint(columnNames = { "label" }, name = "UK_METADATA_FIELD_LABEL"))
@Audited
@EntityListeners(AuditingEntityListener.class)
public class MetadataTemplateField {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import java.util.List;

import ca.corefacility.bioinformatics.irida.ria.web.ajax.projects.dto.MetadataEntryModel;

/**
* UI Request to create a new sample
*/
public class CreateSampleRequest {
private String name;
private String organism;
private String description;
private List<FieldUpdate> metadata;
private List<MetadataEntryModel> metadata;

public CreateSampleRequest() {
}
Expand All @@ -19,7 +21,7 @@ public CreateSampleRequest(String name, String organism) {
this.organism = organism;
}

public CreateSampleRequest(String name, String organism, String description, List<FieldUpdate> metadata) {
public CreateSampleRequest(String name, String organism, String description, List<MetadataEntryModel> metadata) {
this.name = name;
this.organism = organism;
this.description = description;
Expand Down Expand Up @@ -50,11 +52,11 @@ public void setDescription(String description) {
this.description = description;
}

public List<FieldUpdate> getMetadata() {
public List<MetadataEntryModel> getMetadata() {
return metadata;
}

public void setMetadata(List<FieldUpdate> metadata) {
public void setMetadata(List<MetadataEntryModel> metadata) {
this.metadata = metadata;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package ca.corefacility.bioinformatics.irida.ria.web.ajax.dto;

import java.util.List;

import ca.corefacility.bioinformatics.irida.ria.web.ajax.dto.ajax.AjaxResponse;

/**
* Returns an ajax response with locked sample ids.
*/
public class LockedSamplesResponse extends AjaxResponse {
private List<Long> sampleIds;

public LockedSamplesResponse(List<Long> sampleIds) {
this.sampleIds = sampleIds;
}

public List<Long> getSampleIds() {
return sampleIds;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package ca.corefacility.bioinformatics.irida.ria.web.ajax.dto;

/**
* UI response to create/update a sample with error
*/
public class SampleErrorResponse {
private boolean error;
private String errorMessage;

public SampleErrorResponse() {
}

public SampleErrorResponse(boolean error) {
this.error = error;
}

public SampleErrorResponse(boolean error, String errorMessage) {
this.error = error;
this.errorMessage = errorMessage;
}

public boolean isError() {
return error;
}

public void setError(boolean error) {
this.error = error;
}

public String getErrorMessage() {
return errorMessage;
}

public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package ca.corefacility.bioinformatics.irida.ria.web.ajax.dto;

/**
* UI response to create/update a sample with error and sample id
*/
public class SampleResponse extends SampleErrorResponse {
private Long sampleId;

public SampleResponse(String errorMessage) {
super(true, errorMessage);
}

public SampleResponse(Long sampleId) {
super(false);
this.sampleId = sampleId;
}

public Long getSampleId() {
return sampleId;
}

public void setSampleId(Long sampleId) {
this.sampleId = sampleId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@

import java.util.List;

import ca.corefacility.bioinformatics.irida.ria.web.ajax.projects.dto.MetadataEntryModel;

/**
* UI Request to update an existing sample
*/
public class UpdateSampleRequest extends CreateSampleRequest {
public UpdateSampleRequest(String name, String organism, String description, List<FieldUpdate> metadata) {
private Long sampleId;

public UpdateSampleRequest(Long sampleID, String name, String organism, String description,
List<MetadataEntryModel> metadata) {
super(name, organism, description, metadata);
this.sampleId = sampleID;
}

public Long getSampleId() {
return sampleId;
}

public void setSampleId(Long sampleId) {
this.sampleId = sampleId;
}
}
Loading