argos/dmp-frontend/src/app/dmps/dmps.html

238 lines
13 KiB
HTML
Raw Normal View History

2017-11-14 15:06:00 +01:00
<table *ngIf="stateConfig.dmps.tableVisible" class="table table-striped customTable" [mfData]="tableData | dmpTableFilter : filterQuery | dmpVersionFilter : versionFilter |dmpstatusFilter: statusFilter"
#mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
<thead>
2017-11-07 17:08:20 +01:00
<tr class="rowFilter">
<th colspan="1">
2017-11-02 09:50:01 +01:00
<input class="form-control" [(ngModel)]="filterQuery" placeholder='Search in Labels' />
2017-11-01 13:01:14 +01:00
</th>
<th colspan="1">
2017-11-07 12:35:31 +01:00
<button class="btn btn-default " (click)="getDmps('false')">
<span class="glyphicon glyphicon-refresh"></span>
2017-11-03 18:57:06 +01:00
</button>
</th>
2017-11-02 08:57:08 +01:00
2017-11-07 17:08:20 +01:00
<th class="rowFilterTopBorder" colspan="3">
2017-11-07 15:03:12 +01:00
<button type="button" class="btn btn-info btnMoreFilters" data-toggle="collapse" data-target="#demo" (click)="clickFilters($event.target)">More filters</button>
2017-11-02 08:57:08 +01:00
<div id="demo" class="collapse">
2017-11-07 17:08:20 +01:00
<input style="margin-top: 5px;" class="form-control" type="number" [(ngModel)]="versionFilter" placeholder='Version' />
<select style="margin-top: 5px;" class="form-control" [id]="statusid" [(ngModel)]="statusFilter" [name]="statusDropDown"
#datasetfield>
2017-11-07 13:13:58 +01:00
<option *ngFor="let opt of statusDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
2017-11-02 08:57:08 +01:00
</div>
</th>
</tr>
2017-11-07 17:08:20 +01:00
<tr>
<th [ngClass]="{true:'visible', false:'invisible'}[showIDs]">
<mfDefaultSorter by="id">ID</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="label">Label</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="version">Version</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="previous">Previous</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="project">Project</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="description">Description</mfDefaultSorter>
</th>
2017-11-03 18:57:06 +01:00
<th>
<mfDefaultSorter by="created">Created at</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="status">Status</mfDefaultSorter>
</th>
<th>
2017-11-03 18:57:06 +01:00
Actions
</th>
2017-11-14 23:51:39 +01:00
<th>
</th>
2017-11-02 08:57:08 +01:00
</tr>
</thead>
<tbody>
<tr class="grayout-empty-table" *ngIf="!mf.data[0]">
<td colspan="5">No elements</td>
</tr>
<tr *ngFor="let dmp of mf.data" class="hover">
2017-11-03 18:57:06 +01:00
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dmp?.id}}</td>
<td>{{dmp?.label}}</td>
2017-11-15 11:59:08 +01:00
<td style="width:20px;">{{dmp?.version}}</td>
<td style="width:300px;">{{dmp?.previous}}</td>
<td>{{dmp?.project?.label}}</td>
2017-11-15 11:59:08 +01:00
<td>{{(dmp?.description?.length > 20) ? (dmp?.description | slice:0:20)+'...':(dmp?.description) }}</td>
2017-11-03 18:57:06 +01:00
<td>{{dmp?.created | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
<td>{{dmp?.status | statusToString }}</td>
2017-11-14 15:06:00 +01:00
<td>
2017-11-14 23:51:39 +01:00
<a class="editGridColumn cursor-link" (click)="editDmp(dmp)"> <!--btn btn-primary btn-rounded css for button style -->
2017-11-14 15:06:00 +01:00
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit properties" id="editDMP"></i></a>
2017-11-14 23:51:39 +01:00
<a class="editGridColumn cursor-link" (click)="editDmpVersion(dmp)">
<i class="fa fa-clone fa-fw" data-toggle="tooltip" title="create new version" id="changeVersionDMP"></i> </a>
2017-11-14 15:06:00 +01:00
<a class="editGridColumn cursor-link" (click)="markDMPForDelete(dmp)">
<i class="fa fa-eraser fa-fw" data-toggle="modal" data-target="#delete-dmp-confirm" title="delete DMP"></i> </a>
2017-11-14 23:51:39 +01:00
<!--
<a class="editGridColumn cursor-link" (click)="selectDmp(dmp)">
2017-11-14 15:06:00 +01:00
<i class="fa fa-table fa-fw" data-toggle="tooltip" title="show dataset for this DMP" id="showDatasets"></i></a>
2017-11-14 23:51:39 +01:00
-->
</td>
<td style="max-width:100px;">
<button type="button" class="btn btn-default table-button" (click)="showDatasetsOfDmp(dmp)"> <i class="fa fa-folder-o" aria-hidden="true"></i> Datasets</button>
2017-11-14 15:06:00 +01:00
</td>
</tr>
</tbody>
<tfoot>
<tr>
2017-11-14 23:51:39 +01:00
<td colspan="8">
2017-11-15 11:59:08 +01:00
<button type="button" class="btn btn-info btncustom" (click)="newDmpForm(item)">Create New</button>
<mfBootstrapPaginator [rowsOnPageSet]="[5,20,40]"></mfBootstrapPaginator>
</td>
</tr>
</tfoot>
</table>
2017-11-01 16:54:14 +01:00
<!-- </div> -->
<!--Modal for new and edit DMP-->
2017-10-27 16:08:10 +02:00
<div class="modal fade" id="newDmpModal" tabindex="-1" role="dialog" aria-labelledby="newDmpModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
2017-11-15 11:59:08 +01:00
<div class="modal-header centered-text">
<h4 class="modal-title" id="exampleModalLabel"><b>{{ dmp?.id ? "Edit Data Management Plan" : "New Data Management Plan" }}</b></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form #newProjectForm="ngForm" (ngSubmit)="SaveNewDmp()">
<div class="form-group">
<div class="form-group">
<label for="label-name" class="form-control-label">Label:</label>
2017-11-15 11:59:08 +01:00
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label">
</div>
<label for="recipient-name" class="col-form-label">Project:</label>
2017-11-15 11:59:08 +01:00
<select class="form-control" id="projectsDropDownKey" [ngModel]="dmp?.project" (ngModelChange)="dmp.project=$event" name="projectsDropDown">
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
2017-11-01 16:42:01 +01:00
<div class="form-group">
<label for="status-name" class="col-form-label">Status:</label>
2017-11-15 11:59:08 +01:00
<select class="form-control" id="statusid" [ngModel]="dmp?.status" (ngModelChange)="dmp.status=$event" name="statusDropDown" (change)="SelectDMPStatus(dmp, $event, oldValue);">
2017-11-01 16:42:01 +01:00
<option *ngFor="let opt of statusDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
2017-10-30 09:37:00 +01:00
<div class="form-group">
<label for="label-name" class="form-control-label">Previous:</label>
2017-11-15 11:59:08 +01:00
<input type="text" class="form-control" id="label-previous" [ngModel]="dmp?.previous" (ngModelChange)="dmp.previous=$event" name="previous" disabled>
2017-10-30 09:37:00 +01:00
</div>
<div class="form-group">
2017-10-30 15:56:50 +01:00
<label for="abbreviation-text" class="form-control-label">Version:</label>
2017-11-15 11:59:08 +01:00
<input class="form-control" id="abbreviation-text" [ngModel]="dmp?.version" (ngModelChange)="dmp.version=$event" name="version" disabled>
</div>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Description:</label>
2017-11-15 11:59:08 +01:00
<textarea rows="3" class="form-control" id="abbreviation-text" [ngModel]="dmp?.description" (ngModelChange)="dmp.description=$event" name="description"></textarea>
</div>
2017-11-14 15:06:00 +01:00
<!--
<div class="form-group">
2017-10-30 15:56:50 +01:00
<label for="reference-text" class="form-control-label">Profile Data:</label>
2017-11-15 11:59:08 +01:00
<textarea class="form-control" id="reference-text" [(ngModel)]="dmp?.profileData" name="profileData"></textarea>
</div>
<div class="form-group">
<label for="start-date" class="form-control-label">Start Date:</label>
2017-11-15 11:59:08 +01:00
<input class="form-control" id="startDate-date" [(ngModel)]= "dmp?.startDate" name = "startDate">
</div>
<div class="form-group">
<label for="end-date" class="form-control-label">End Date:</label>
2017-11-15 11:59:08 +01:00
<input class="form-control" id="endDate-date" [(ngModel)]= "dmp?.endDate" name = "endDate">
2017-11-14 15:06:00 +01:00
</div>
-->
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" (click)="SaveDmp();">Save Dmp</button>
</div>
</div>
</div>
</div>
<!--Modal for changing version-->
<div class="modal fade" id="newVersionDmpModal" tabindex="-1" role="dialog" aria-labelledby="newVersionDmpModalLabel" aria-hidden="true">
2017-11-02 08:57:08 +01:00
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">DMP</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
2017-11-02 08:57:08 +01:00
</div>
<div class="modal-body">
<form #newProjectForm="ngForm" (ngSubmit)="SaveNewDmp()">
<div class="form-group">
2017-11-02 08:57:08 +01:00
<label for="label-name" class="form-control-label">Label:</label>
2017-11-15 11:59:08 +01:00
<input type="text" class="form-control" id="label-name" [ngModel]="dmp?.label" (ngModelChange)="dmp.label=$event" name="label">
</div>
2017-11-07 17:08:20 +01:00
<div class="form-group" hidden>
<label for="recipient-name" class="col-form-label">Project:</label>
2017-11-15 11:59:08 +01:00
<select class="form-control" [id]="projectsDropDownKey" [ngModel]="dmp?.project" (ngModelChange)="dmp.project=$event" [name]="projectsDropDown" #datasetfield>
2017-11-07 17:08:20 +01:00
<option *ngFor="let opt of projectsDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
<div class="form-group" hidden>
<label for="label-name" class="form-control-label">Previous:</label>
2017-11-15 11:59:08 +01:00
<input type="text" class="form-control" id="label-previous" [ngModel]="dmp?.previous" (ngModelChange)="dmp.previous=$event" name="previous">
2017-11-07 17:08:20 +01:00
</div>
<div class="form-group" hidden>
<label for="abbreviation-text" class="form-control-label">Version:</label>
2017-11-15 11:59:08 +01:00
<input class="form-control" id="abbreviation-text" [ngModel]="dmp?.version" (ngModelChange)="dmp.version=$event" name="version">
2017-11-07 17:08:20 +01:00
</div>
2017-11-02 08:57:08 +01:00
</form>
2017-11-14 10:36:21 +01:00
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" (click)="cloneDMP(dmp);">Save Dmp</button>
</div>
</div>
</div>
2017-11-14 10:36:21 +01:00
</div>
2017-11-14 10:36:21 +01:00
<div class="modal" tabindex="-1" id="messageForChangingStatus" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Change Staus</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>The submitted status is available only when all the DMP's datasets are "Submitted" or "Cancel"</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
2017-11-14 15:06:00 +01:00
2017-11-14 10:36:21 +01:00
<!--DATASET TABLE-->
2017-11-14 15:06:00 +01:00
<datasets-table *ngIf="stateConfig.datasets.tableVisible" [dmpIdforDatasets]="stateConfig.dmps.selectedID" [dmpLabelforDatasets]="stateConfig.dmps.selectedLabel" [(dataSetVisibe)]="stateConfig.datasets.tableVisible"></datasets-table>
2017-11-07 14:07:25 +01:00
2017-11-14 10:36:21 +01:00
<!-- Confirmation module- do not delete -->
2017-11-14 15:06:00 +01:00
<confirmation [confirmationID]="'delete-dmp-confirm'" [confirmationTitle]="'Caution'" [confirmationDescr]="'This action will delete this DMP. Are you sure ? This is not revertable !'" (responseSender)="deleteDMP($event)"></confirmation>