-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
99 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,9 @@ Node Names | |
orphaned files. | ||
Contacts | ||
Contact cells act as string cells with the following expected syntax: | ||
``Contact Name <[email protected]>``. The email can be omitted. | ||
``Contact Name <[email protected]>``. The email can be omitted. Multiple | ||
contacts can be provided using the semicolon character as a delimter. For | ||
example: ``Contact1 <c1.example.com>;Contact1 <c2.example.com>``. | ||
Dates | ||
Date cells also provide standard string editing but enforce the ISO 8601 | ||
``YYYY-MM-DD`` syntax. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -774,6 +774,35 @@ def test_post_performer(self): | |
obj.refresh_from_db() | ||
self.assertEqual(obj.performer, value) | ||
|
||
def test_post_performer_list(self): | ||
"""Test POST with process performer and list value""" | ||
obj = Process.objects.filter(study=self.study, assay=None).first() | ||
value = [ | ||
'Alice Example <[email protected]>', | ||
'Bob Example <[email protected]>', | ||
] | ||
self.values['updated_cells'].append( | ||
{ | ||
'uuid': str(obj.sodar_uuid), | ||
'header_name': 'Performer', | ||
'header_type': 'performer', | ||
'obj_cls': 'Process', | ||
'value': value, | ||
} | ||
) | ||
with self.login(self.user): | ||
response = self.client.post( | ||
reverse( | ||
'samplesheets:ajax_edit_cell', | ||
kwargs={'project': self.project.sodar_uuid}, | ||
), | ||
json.dumps(self.values), | ||
content_type='application/json', | ||
) | ||
self.assertEqual(response.status_code, 200) | ||
obj.refresh_from_db() | ||
self.assertEqual(obj.performer, ';'.join(value)) | ||
|
||
def test_post_perform_date(self): | ||
"""Test POST with process perform date""" | ||
obj = Process.objects.filter(study=self.study, assay=None).first() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,6 +296,25 @@ describe('DataCellRenderer.vue', () => { | |
expect(cell.classes()).not.toContain('text-muted') | ||
}) | ||
|
||
it('renders contact cell with list value', async () => { | ||
const table = copy(studyTablesOneCol).tables.study | ||
table.field_header[0] = studyTables.tables.study.field_header[5] | ||
table.table_data[0][0] = studyTables.tables.study.table_data[0][5] | ||
table.table_data[0][0].value = 'John Doe <[email protected]>;Jane Doe' | ||
const wrapper = mountSheetTable({ table: table }) | ||
await waitAG(wrapper) | ||
await waitRAF() | ||
|
||
const cell = wrapper.find('.sodar-ss-data-cell') | ||
const cellData = cell.find('.sodar-ss-data') | ||
expect(cellData.text()).toContain('John Doe;') | ||
expect(cellData.text()).toContain('Jane Doe') | ||
expect(cellData.find('a').exists()).toBe(true) | ||
expect(cellData.find('a').attributes().href).toBe('mailto:[email protected]') | ||
expect(cell.classes()).not.toContain('text-right') | ||
expect(cell.classes()).not.toContain('text-muted') | ||
}) | ||
|
||
it('renders contact cell with bracket syntax', async () => { | ||
const table = copy(studyTablesOneCol).tables.study | ||
table.field_header[0] = studyTables.tables.study.field_header[5] | ||
|