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

Docs: Update Metadata Import #797

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions docs-site/docs/user/project/samples/sample-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ A dialog will pop-up where you can update the metadata.

## Learn About Importing Metadata

Importing metadata allows you to add multiple metadata fields to multiple samples all at once. This requires a spreadsheet in .csv, .xls, or .xlsx format.
Importing metadata allows you to add multiple metadata fields to multiple samples all at once. This requires a spreadsheet in .csv, .tsv, .xls, or .xlsx format.

This is an example of the expected spreadsheet format:

Expand All @@ -83,7 +83,7 @@ The following metadata will be added:
| MetadataField2 | value5 |
| MetadataField3 | value6 |

When creating the spreadsheet, you are required to have a column that contains a sample identifier. The identifier is case-sensitive and can contain either the sample names or IDs.
When creating the spreadsheet, you are required to have a column that contains a sample identifier. The identifier is case-sensitive and can contain either the sample names or IDs. When importing metadata from a **project**, the sample identifier can be either the **sample name or ID**. If importing metadata from a **group**, the sample identifier must be the **sample ID**.

**An important note:** When importing a metadata spreadsheet, you will be asked if you'd like to **Ignore empty values**. If this is **selected**, any metadata fields without an associated value will be ignored and those metadata keys will not be removed from the sample if present. However, if this **not selected**, any samples with the metadata key and empty value will be **deleted**.

Expand Down Expand Up @@ -137,15 +137,15 @@ This would result in the following sample metadata:

Prerequisites:

- You must have at least a **Maintainer** role for the sample's project
- A sample added to the project
- You must have at least a **Maintainer** role for the sample's project or group
- A sample added to the project or group

1. From the left sidebar, select **Projects**
2. Select the project
1. From the left sidebar, select **Projects** or **Groups**
2. Select the project or group
3. From the left sidebar, select **Samples**
4. Click **Import Metadata**

A dialog will pop-up to select the spreadsheet to be imported. After selecting the spreadsheet file, identify which column contains the sample identifier and whether you'd like to [Ignore empty values](sample-metadata#learn-about-importing-metadata)
A dialog will pop-up to select the spreadsheet to be imported. After selecting the spreadsheet file, identify which column contains the sample identifier and whether you'd like to [Ignore empty values](sample-metadata#learn-about-importing-metadata).

## Delete Metadata

Expand Down
3 changes: 1 addition & 2 deletions test/system/projects/samples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,13 @@ class SamplesTest < ApplicationSystemTestCase

Project.reset_counters(project2.id, :samples_count)
visit namespace_project_samples_url(namespace1, project2)

assert_text strip_tags(I18n.t(:'viral.pagy.limit_component.summary', from: 1, to: 20, count: 220,
locale: @user.locale))

click_button I18n.t(:'projects.samples.index.select_all_button')

within 'tbody' do
assert_selector 'input[name="sample_ids[]"]:checked', count: 20
assert_selector 'input[name="sample_ids[]"]:checked', count: 20, wait: 1
end
within 'tfoot' do
assert_text 'Samples: 220'
Expand Down
Loading