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

Implement RFC85 Dynamic Virtual Study #5016

Open
wants to merge 3 commits into
base: master
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
8 changes: 8 additions & 0 deletions src/globalStyles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ div:active {
}
}

.form-group-inline {
@extend .form-group;

label {
margin-right: 6px;
}
}

.posRelative {
position: relative;
}
Expand Down
78 changes: 78 additions & 0 deletions src/pages/studyView/virtualStudy/VirtualStudy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export default class VirtualStudy extends React.Component<
> {
@observable.ref private name: string;
@observable.ref private description: string;
@observable.ref private dynamic: boolean = false;

@observable private saving = false;
@observable private sharing = false;
Expand Down Expand Up @@ -167,6 +168,7 @@ export default class VirtualStudy extends React.Component<
study => study.studyId
),
studies: studies,
dynamic: this.dynamic,
};
return await sessionServiceClient.saveVirtualStudy(
parameters,
Expand Down Expand Up @@ -298,6 +300,82 @@ export default class VirtualStudy extends React.Component<
/>
</div>

<div className="form-group-inline">
<label>Type:</label>
<label>
<input
type="radio"
name="option"
value="static"
checked={!this.dynamic}
onChange={_ =>
(this.dynamic = false)
}
/>{' '}
Static
</label>
<label>
<input
type="radio"
name="option"
value="dynamic"
checked={this.dynamic}
onChange={_ =>
(this.dynamic = true)
}
/>{' '}
Dynamic
</label>
<DefaultTooltip
mouseEnterDelay={0}
placement="right"
overlay={
<div>
<p>
<strong>
Type of Virtual
Study:
</strong>
</p>
<p>
This Virtual Study will
contain the set of sample IDs
currently selected.
Furthermore, you can
define this Virtual Study either
static or dynamic:
</p>
<ul>
<li>
<strong>
Static
</strong>{' '}
– Sample IDs are
the ones currently selected
and no new samples are
added to this Virtual Study set,
even if the database gets updated with
new samples that match the
same filtering/selection criteria
as the samples in the current set.
</li>
<li>
<strong>
Dynamic
</strong>{' '}
– Unlike the Static option,
any new samples added to the database
that match the criteria of this Virtual Study
will automatically be included in its sample set.
</li>
</ul>
</div>
}
>
<FontAwesome name="question-circle" />
</DefaultTooltip>
</div>

<div>
{this.showSaveButton && (
<button
Expand Down
Loading