Unverified Commit 06446a38 authored by Nestor Diaz's avatar Nestor Diaz Committed by GitHub

Add help link to file list field and apply some feedback to BIA template (#430)

Add help link to file list field and apply some feedback to BIA template
parent bc01e3e2
Pipeline #109263 passed with stages
in 10 minutes and 10 seconds
......@@ -2,7 +2,10 @@
<label>
<h6 class="m-0">
{{fieldName}}
<i *ngIf="hasHelpText" [tooltip]="fieldHelpText" class="fa fa-question-circle" aria-hidden="true"></i>
<a *ngIf="hasHelpLink" class="small ml-1" href="{{fieldHelpLink}}" target="_blank">
<i class="fa fa-question-circle"></i> {{fieldHelpText}}
</a>
<i *ngIf="hasHelpText && !hasHelpLink" [tooltip]="fieldHelpText" class="fa fa-question-circle ml-1" aria-hidden="true"></i>
<span class="small text-muted" [hidden]="isReadonly || isValid">
<span *ngIf="valueLength.isAtLeast">
(at least {{valueLength.min}}
......
......@@ -56,6 +56,10 @@ export class SubmFieldComponent {
return this.fieldType.helpText;
}
get fieldHelpLink(): string {
return this.fieldType.helpLink;
}
get isEmpty(): boolean {
return isStringEmpty(this.fieldControl!.control.value as string);
}
......@@ -88,6 +92,10 @@ export class SubmFieldComponent {
return this.fieldHelpText.length > 0;
}
get hasHelpLink(): boolean {
return this.fieldHelpLink.length > 0;
}
get errors(): string[] {
return this.fieldControl.errors;
}
......
......@@ -10,7 +10,7 @@ export const biaTemplate = {
{
name: "Title",
icon: "fa-heading",
valueType: { name: "largetext", minlength: 25 },
valueType: { name: "largetext" },
display: "required",
},
{
......@@ -420,11 +420,6 @@ export const biaTemplate = {
{
name: "Imaging Method",
icon: "fa-comment",
valueType: { name: "text" },
},
{
name: "Technology Type",
icon: "fa-comment",
valueType: {
name: "select",
values: [
......@@ -452,6 +447,22 @@ export const biaTemplate = {
"unsupervised transmission electron microscopy",
"wide field fluorescence deconvolution microscopy",
"wide-field epi-fluorescence microscopy"
]
},
},
{
name: "Technology Type",
icon: "fa-comment",
valueType: {
name: "select",
values: [
"cell line screen",
"compound screen",
"gene deletion screen",
"geographic screen",
"ORF overexpression screen",
"protein screen",
"RNAi screen",
],
},
},
......@@ -460,6 +471,8 @@ export const biaTemplate = {
icon: "fa-file",
valueType: { name: "file" },
display: "required",
helpLink: "https://www.ebi.ac.uk/biostudies/BioImages/help",
helpText: "Help"
},
{
name: "Comment",
......
......@@ -239,6 +239,7 @@ export class FieldType extends TypeBase {
readonly display: string;
readonly displayType: DisplayType;
readonly helpText: string;
readonly helpLink: string;
readonly icon: string;
readonly valueType: ValueType;
......@@ -253,6 +254,7 @@ export class FieldType extends TypeBase {
this.valueType = ValueTypeFactory.create(data.valueType || {});
this.icon = data.icon || 'fa-pencil-square-o';
this.helpText = data.helpText || '';
this.helpLink = data.helpLink || '';
this.displayType = DisplayType.create( data.display || parentDisplayType.name);
this.display = this.displayType.name;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment