Skip to content

Commit

Permalink
Feat openMF#2935 - Add UI for editing submitted on date for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
m-sameer committed Dec 12, 2018
1 parent a10ced9 commit 34e2fc1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 2 additions & 4 deletions app/scripts/controllers/groups/CreateGroupController.js
Expand Up @@ -167,8 +167,7 @@
scope.formData.clientMembers[i] = scope.addedClients[i].id;
}
if (this.formData.active) {
var reqDate = dateFilter(scope.first.date, scope.df);
this.formData.activationDate = reqDate;
this.formData.activationDate = dateFilter(scope.first.date, scope.df);
}
if (routeParams.centerId) {
this.formData.centerId = routeParams.centerId;
Expand All @@ -177,8 +176,7 @@
this.formData.officeId = routeParams.officeId;
}
if (scope.first.submitondate) {
reqDat = dateFilter(scope.first.submitondate, scope.df);
this.formData.submittedOnDate = reqDat;
this.formData.submittedOnDate = dateFilter(scope.first.submitondate, scope.df);
}
this.formData.locale = scope.optlang.code;
this.formData.dateFormat = scope.df;
Expand Down
5 changes: 3 additions & 2 deletions app/scripts/controllers/groups/EditGroupController.js
Expand Up @@ -117,12 +117,13 @@
resourceFactory.groupResource.get({groupId: routeParams.id}, function (data) {
if (data.timeline.submittedOnDate) {
scope.mindate = new Date(data.timeline.submittedOnDate);
scope.first.submitondate = new Date(dateFilter(data.timeline.submittedOnDate, scope.df));
}
});

scope.updateGroup = function () {
var reqDate = dateFilter(scope.first.date, scope.df);
this.formData.activationDate = reqDate;
this.formData.submittedOnDate = dateFilter(scope.first.submitondate, scope.df);
this.formData.activationDate = dateFilter(scope.first.date, scope.df);
this.formData.locale = scope.optlang.code;
this.formData.dateFormat = scope.df;
resourceFactory.groupResource.update({groupId: routeParams.id}, this.formData, function (data) {
Expand Down
8 changes: 8 additions & 0 deletions app/views/groups/editgroup.html
Expand Up @@ -43,6 +43,14 @@
<input type="text" id="externalId" ng-model="formData.externalId" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">{{'label.input.submittedon' | translate}}:</label>

<div class="col-sm-3">
<input id="submittedon" type="text" name="submittedon" datepicker-pop="dd MMMM yyyy"
ng-model="first.submitondate" is-open="opened1" min="'2000-01-01'" max="restrictDate" class="form-control"/>
</div>
</div>
<div ng-hide="editGroup.status.value == 'Pending'">
<div class="form-group">
<label class="control-label col-sm-2">{{'label.input.activationdate' | translate}}<span class="required">*</span></label>
Expand Down

0 comments on commit 34e2fc1

Please sign in to comment.