Skip to content

Commit

Permalink
Merge branch 'event-type' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
caleballdrin committed Jul 25, 2023
2 parents 94efd8e + 67b2ef3 commit c4c167e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/scripts/controllers/eventDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,18 @@ angular
validationErrorsHint = eventInformationPageHint;
}

if (
$scope.conference.cruEvent &&
$scope.conference.ministry &&
$scope.eventTypes().length !== 0 &&
!$scope.conference.eventType
) {
validationErrors.push(
'Please enter which Event Type is applicable for this event.*',
);
validationErrorsHint = eventInformationPageHint;
}

if ($scope.conference.cruEvent && !$scope.conference.type) {
validationErrors.push('Please enter Ministry Purpose.*');
validationErrorsHint = eventInformationPageHint;
Expand Down Expand Up @@ -655,6 +667,13 @@ angular
return currentMinistry ? currentMinistry.activities : [];
};

$scope.getEventTypes = () => {
const currentMinistry =
$scope.ministries &&
$scope.ministries.find((m) => m.id === $scope.conference.ministry);
return currentMinistry ? currentMinistry.eventTypes : [];
};

$scope.$watch(
'conference.ministry',
function (newVal, oldVal) {
Expand Down
13 changes: 13 additions & 0 deletions app/views/eventDetails/eventInformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,19 @@ <h2 class="page-title border" translate>Event Information</h2>
<option></option>
</select>
</div>
<div
class="col-sm-5"
ng-if="conference.cruEvent && getEventTypes().length != 0"
>
<label translate>Event Type</label>
<select
class="form-control"
ng-model="conference.eventType"
ng-options="eventType.id as eventType.name for eventType in getEventType(conference.eventType) | orderBy:'name':false:sortNamesWithNA"
>
<option></option>
</select>
</div>
</div>
<div
class="form-group"
Expand Down

0 comments on commit c4c167e

Please sign in to comment.