Skip to content

Commit

Permalink
Merge pull request #23 from fiterlatam/FBR-182
Browse files Browse the repository at this point in the history
FBR-182
  • Loading branch information
MageziArthur authored Jun 21, 2023
2 parents 8f2fe9c + 50db15a commit 3d9c94c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app/global-translations/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@
"label.anchor.manageagencies": "Manage Agencies",
"label.anchor.managesupervisions": "Manage Supervisions",
"label.anchor.manageportfolios": "Manage Portfolios",
"label.addnewportfolioormodifyportfolio": "Add new or modify portfolio",
"label.anchor.portfoliosplanning": "Portfolios Planning",
"label.portfolioplanning": "Portfolios Planning",
"label.anchor.manageportfoliosplanning": "Manage Portfolios Planning",
"#Inputs": "..",
"label.input.name": "Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
scope.responsibleUserOptions = [];
scope.statusOptions = [];
scope.portfolioCenterOptions = [];
scope.defaultMeetingPeriod = 0;
scope.tf = "HH:mm";
let portfolioId = routeParams.portfolioId
let portfolioCenterId = routeParams.portfolioCenterId;
Expand All @@ -15,6 +16,25 @@
scope.portfolioCenterOptions = data;
});

resourceFactory.configurationResourceByName.get({configName:'meeting-default-duration'}, function (data){
scope.defaultMeetingPeriod = data.value;
});

scope.startTimeChanged = function(){
// Perform any additional logic or actions here
if(scope.formData.meetingStartTime != null
&& scope.formData.meetingStartTime != undefined
&& scope.formData.meetingStartTime != ""){
console.log(scope.formData.meetingStartTime.getMinutes());

var meetingEndTime = new Date(scope.formData.meetingStartTime);
var hours = meetingEndTime.getHours();
var minutesToAdd = meetingEndTime.getMinutes() + scope.defaultMeetingPeriod;
var newTime = new Date(meetingEndTime.getFullYear(), meetingEndTime.getMonth(), meetingEndTime.getDate(), hours, minutesToAdd);
scope.formData.meetingEndTime = newTime;
}
}

resourceFactory.centerGroupTemplateResource.get({portfolioCenterId:portfolioCenterId}, function (data) {
scope.parentOfficesOptions = data.parentOfficesOptions;
scope.responsibleUserOptions = data.responsibleUserOptions;
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/services/ResourceFactoryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
get: {method: 'GET', params: {}},
update: {method: 'PUT', params: {}}
}),
configurationResourceByName: defineResource(apiVer + "/configurations/", {configName: '@configName'}, {
configurationResourceByName: defineResource(apiVer + "/configurations/name/:configName", {configName: '@configName'}, {
get: {method: 'GET', params: {configName:'configName'}}
}),
cacheResource: defineResource(apiVer + "/caches", {}, {
Expand Down
4 changes: 2 additions & 2 deletions app/views/organization/createcentergroup.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<label class="control-label col-sm-2">{{ 'label.input.meetingStartTime' | translate }}<span class="required">*</span></label>
<div class="col-sm-3">
<input id="meetingStartTime" type="time" placeholder="HH:MM:SS" name="meetingStartTime" ng-model="formData.meetingStartTime"
class="form-control" required late-Validate/>
class="form-control" ng-change="startTimeChanged()" required late-Validate/>
</div>
<div class="col-sm-3">
<form-validate valattributeform="createcentergroupform" valattribute="meetingStartTime"/>
Expand All @@ -105,7 +105,7 @@
<label class="control-label col-sm-2">{{ 'label.input.meetingEndTime' | translate }}<span class="required">*</span></label>
<div class="col-sm-3">
<input id="meetingEndTime" type="time" placeholder="HH:MM:SS" name="meetingEndTime" ng-model="formData.meetingEndTime"
class="form-control" required late-Validate/>
class="form-control" disabled late-Validate/>
</div>
<div class="col-sm-3">
<form-validate valattributeform="createcentergroupform" valattribute="meetingEndTime"/>
Expand Down

0 comments on commit 3d9c94c

Please sign in to comment.