Skip to content

Commit

Permalink
feature/2755/service-versions-view-edit (#748)
Browse files Browse the repository at this point in the history
* requested changes from #2755, updates view/edit pop-up card on service versions tab

* Change card title from 'Version Tag' to 'Service Version'

* fix broken cypress test, change service_path validation message from 'Workflow' to 'Service'

* change input to text for reference and service path, remove service form validation, fix cypress test

* change 'Version Tag' to 'Workflow Version'
  • Loading branch information
Ldcabansay authored Aug 26, 2019
1 parent f1363db commit c0a27af
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 4 additions & 1 deletion cypress/integration/immutableDatabaseTests/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ describe('Dockstore Home', () => {
cy.contains('TRS: ').should('be.visible');
checkVersionsTab();
// Hidden version not visible on public page
// View button visible on public page, otherwise Edit
cy.contains('button', 'View');
cy.contains('td', 'test').should('not.be.visible');
checkFilesTab();
});
Expand Down Expand Up @@ -118,6 +120,8 @@ describe('Dockstore Home', () => {
// TRS only visibile in public page
cy.contains('TRS: ').should('not.be.visible');
checkVersionsTab();
//Edit button only in my-services
cy.contains('button', 'Edit');
checkFilesTab();
});
});
Expand Down Expand Up @@ -152,7 +156,6 @@ describe('Dockstore Home', () => {
cy.contains('td', 'Jul 19, 2019, 1:13:48 PM');
cy.contains('tr', 'Valid');
cy.contains('tr', 'Verified Platforms');
cy.contains('button', 'View');
}
function checkFilesTab() {
goToTab('Files');
Expand Down
22 changes: 12 additions & 10 deletions src/app/workflow/version-modal/version-modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<h4 mat-dialog-title>{{ isPublic || !canWrite ? 'View' : 'Edit' }} Version Tag</h4>
<h4 mat-dialog-title>{{ isPublic || !canWrite ? 'View' : 'Edit' }} {{ (isService$ | async) ? 'Service Version' : 'Workflow Version' }}</h4>
<div mat-dialog-content>
<app-alert></app-alert>
<fieldset [disabled]="!canWrite || isPublic">
Expand All @@ -25,20 +25,25 @@ <h4 mat-dialog-title>{{ isPublic || !canWrite ? 'View' : 'Edit' }} Version Tag</
</label>
<div class="col-sm-9 col-md-9 col-lg-9">
<input
*ngIf="!(isService$ | async)"
type="text"
class="form-control"
name="reference"
ngModel="{{ version.reference ? version.reference : 'n/a' }}"
disabled
/>
<div *ngIf="isService$ | async" class="label-value">
{{ version.reference ? version.reference : 'n/a' }}
</div>
</div>
</div>
<div class="form-group form-group-sm">
<label class="col-sm-3 col-md-3 col-lg-3 control-label">
Workflow Path:
{{ (isService$ | async) ? 'Service Path:' : 'Workflow Path:' }}
</label>
<div class="col-sm-9 col-md-9 col-lg-9">
<input
*ngIf="!(isService$ | async)"
type="text"
class="form-control"
name="workflow_path"
Expand All @@ -51,12 +56,15 @@ <h4 mat-dialog-title>{{ isPublic || !canWrite ? 'View' : 'Edit' }} Version Tag</
placeholder="e.g. CancerCollaboratory/dockstore-tool-liftover"
[readonly]="(isService$ | async) || isPublic || !canWrite || workflow?.mode === WorkflowType.ModeEnum.HOSTED"
/>
<div *ngIf="isService$ | async" class="label-value">
{{ version.workflow_path }}
</div>
<mat-card *ngIf="formErrors.workflow_path && !(isService$ | async)" class="alert alert-danger">
{{ formErrors.workflow_path }}
</mat-card>
</div>
</div>
<div class="form-group form-group-sm" *ngIf="(descriptorType$ | async) !== ToolDescriptor.TypeEnum.NFL">
<div class="form-group form-group-sm" *ngIf="!(isService$ | async) && (descriptorType$ | async) !== ToolDescriptor.TypeEnum.NFL">
<label class="col-sm-3 col-md-3 col-lg-3 control-label">
Test Parameter File(s):
</label>
Expand Down Expand Up @@ -155,13 +163,7 @@ <h4 mat-dialog-title>{{ isPublic || !canWrite ? 'View' : 'Edit' }} Version Tag</
<div class="col-sm-9 col-md-9 col-lg-9">
<div>
<label>
<input
type="checkbox"
name="checkbox"
[(ngModel)]="version.hidden"
matTooltip="Hide tag from public view."
[disabled]="isService$ | async"
/>
<input type="checkbox" name="checkbox" [(ngModel)]="version.hidden" matTooltip="Hide tag from public view." />
</label>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/workflow/view/view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->

<button type="button" mat-button color="accent" class="btn-block" (click)="showVersionModal()">
{{ isPublic || !canWrite || (entryType$ | async) === EntryType.Service ? 'View' : 'Edit' }}
{{ isPublic || !canWrite ? 'View' : 'Edit' }}
</button>
<ng-container *ngIf="!isPublic">
<button
Expand Down

0 comments on commit c0a27af

Please sign in to comment.