#159: workflow steps ui

This commit is contained in:
Benjamin Gamard 2018-01-27 23:41:57 +01:00
parent 5f9094c540
commit 8284169923
4 changed files with 68 additions and 2 deletions

View File

@ -48,6 +48,12 @@ public class RouteStep {
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private RouteStepTransition transition; private RouteStepTransition transition;
/**
* Comment.
*/
@Column(name = "RTP_COMMENT_C", length = 500)
private String comment;
/** /**
* Target ID (user or group). * Target ID (user or group).
*/ */
@ -86,6 +92,7 @@ public class RouteStep {
.add("name", name) .add("name", name)
.add("type", type) .add("type", type)
.add("transition", transition) .add("transition", transition)
.add("comment", comment)
.add("targetId", targetId) .add("targetId", targetId)
.add("order", order) .add("order", order)
.add("createDate", createDate) .add("createDate", createDate)

View File

@ -1,6 +1,6 @@
create table T_ROUTE_MODEL ( RTM_ID_C varchar(36) not null, RTM_NAME_C varchar(50) not null, RTM_DATA_C varchar(5000) not null, RTM_CREATEDATE_D datetime not null, RTM_DELETEDATE_D datetime, primary key (RTM_ID_C) ); create table T_ROUTE_MODEL ( RTM_ID_C varchar(36) not null, RTM_NAME_C varchar(50) not null, RTM_DATA_C varchar(5000) not null, RTM_CREATEDATE_D datetime not null, RTM_DELETEDATE_D datetime, primary key (RTM_ID_C) );
create cached table T_ROUTE ( RTE_ID_C varchar(36) not null, RTE_IDDOCUMENT_C varchar(36) not null, RTE_CREATEDATE_D datetime not null, RTE_DELETEDATE_D datetime, primary key (RTE_ID_C) ); create cached table T_ROUTE ( RTE_ID_C varchar(36) not null, RTE_IDDOCUMENT_C varchar(36) not null, RTE_CREATEDATE_D datetime not null, RTE_DELETEDATE_D datetime, primary key (RTE_ID_C) );
create cached table T_ROUTE_STEP ( RTP_ID_C varchar(36) not null, RTP_IDROUTE_C varchar(36) not null, RTP_NAME_C varchar(200) not null, RTP_TYPE_C varchar(50) not null, RTP_TRANSITION_C varchar(50), RTP_IDTARGET_C varchar(36) not null, RTP_ORDER_N int not null, RTE_CREATEDATE_D datetime not null, RTP_ENDDATE_D datetime, RTP_DELETEDATE_D datetime, primary key (RTP_ID_C) );; create cached table T_ROUTE_STEP ( RTP_ID_C varchar(36) not null, RTP_IDROUTE_C varchar(36) not null, RTP_NAME_C varchar(200) not null, RTP_TYPE_C varchar(50) not null, RTP_TRANSITION_C varchar(50), RTP_COMMENT_C varchar(500), RTP_IDTARGET_C varchar(36) not null, RTP_ORDER_N int not null, RTE_CREATEDATE_D datetime not null, RTP_ENDDATE_D datetime, RTP_DELETEDATE_D datetime, primary key (RTP_ID_C) );;
alter table T_ROUTE add constraint FK_RTE_IDDOCUMENT_C foreign key (RTE_IDDOCUMENT_C) references T_DOCUMENT (DOC_ID_C) on delete restrict on update restrict; alter table T_ROUTE add constraint FK_RTE_IDDOCUMENT_C foreign key (RTE_IDDOCUMENT_C) references T_DOCUMENT (DOC_ID_C) on delete restrict on update restrict;
alter table T_ROUTE_STEP add constraint FK_RTP_IDROUTE_C foreign key (RTP_IDROUTE_C) references T_ROUTE (RTE_ID_C) on delete restrict on update restrict; alter table T_ROUTE_STEP add constraint FK_RTP_IDROUTE_C foreign key (RTP_IDROUTE_C) references T_ROUTE (RTE_ID_C) on delete restrict on update restrict;
update T_CONFIG set CFG_VALUE_C = '15' where CFG_ID_C = 'DB_VERSION'; update T_CONFIG set CFG_VALUE_C = '15' where CFG_ID_C = 'DB_VERSION';

View File

@ -18,6 +18,10 @@ angular.module('docs').controller('SettingsWorkflowEdit', function($scope, $dial
Restangular.one('routemodel', $stateParams.id).get().then(function (data) { Restangular.one('routemodel', $stateParams.id).get().then(function (data) {
$scope.workflow = data; $scope.workflow = data;
}); });
} else {
$scope.workflow = {
steps: []
}
} }
/** /**

View File

@ -8,7 +8,7 @@
<div class="form-group" ng-class="{ 'has-error': !editWorkflowForm.name.$valid && editWorkflowForm.$dirty, success: editWorkflowForm.name.$valid }"> <div class="form-group" ng-class="{ 'has-error': !editWorkflowForm.name.$valid && editWorkflowForm.$dirty, success: editWorkflowForm.name.$valid }">
<label class="col-sm-2 control-label" for="inputName">{{ 'settings.workflow.edit.name' | translate }}</label> <label class="col-sm-2 control-label" for="inputName">{{ 'settings.workflow.edit.name' | translate }}</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input name="name" type="text" id="inputName" required ng-disabled="isEdit()" class="form-control" <input name="name" type="text" id="inputName" required class="form-control"
ng-minlength="3" ng-maxlength="50" ng-attr-placeholder="{{ 'settings.workflow.edit.name' | translate }}" ng-model="workflow.name"/> ng-minlength="3" ng-maxlength="50" ng-attr-placeholder="{{ 'settings.workflow.edit.name' | translate }}" ng-model="workflow.name"/>
</div> </div>
@ -19,6 +19,61 @@
</div> </div>
</div> </div>
<div class="panel panel-default" ng-repeat="step in workflow.steps">
<div class="panel-body">
<div class="row" style="display: flex; align-items: center;">
<div class="col-xs-1 text-center" style="font-size: 200%;">
<div class="glyphicon glyphicon-move pointer" uib-tooltip="Drag and drop to rorder the step"></div>
</div>
<div class="col-xs-1 text-center" style="font-size: 200%">
<div>{{ $index + 1 }}</div>
<!--<div class="glyphicon glyphicon-ok-circle"></div>-->
<!--<div class="glyphicon glyphicon-transfer"></div>-->
</div>
<div class="col-xs-10">
<div class="row">
<div class="col-xs-6" style="margin-bottom: 10px">
<strong>
Step type
<span class="glyphicon glyphicon-info-sign"
uib-tooltip-html="'<strong>Approve:</strong> Review and continue the workflow<br/><strong>Validate:</strong> Accept or reject the review'"></span>
</strong>
</div>
<div class="col-xs-6">
<strong>Assigned to</strong>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<select class="form-control" required>
<option value="APPROVE">Approve</option>
<option value="VALIDATE">Validate</option>
</select>
</div>
<div class="col-xs-6">
<input required ng-maxlength="50" class="form-control" type="text" id="inputTarget"
ng-attr-placeholder="{{ 'directive.acledit.search_user_group' | translate }}" name="target" ng-model="acl.target" autocomplete="off"
uib-typeahead="target as target.name for target in getTargetAclTypeahead($viewValue)"
typeahead-template-url="partial/docs/directive.typeahead.acl.html"
typeahead-wait-ms="200" />
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-xs-12">
<textarea type="text" class="form-control" required placeholder="Step name or description" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10 btn-link pointer" ng-click="workflow.steps.push({})">
<span class="glyphicon glyphicon-plus-sign"></span> Add a workflow step
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" ng-click="edit()" ng-disabled="!editWorkflowForm.$valid"> <button type="submit" class="btn btn-primary" ng-click="edit()" ng-disabled="!editWorkflowForm.$valid">