Skip to content

Commit

Permalink
fixing-breaking-change-to-associated-reg-types and main into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Aug 14, 2023
2 parents d20420b + bf53b92 commit 23c85b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
10 changes: 10 additions & 0 deletions app/scripts/controllers/eventDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,16 @@ angular
});
});
const payload = angular.copy($scope.conference);
// Remove unwanted properties from sending to API.
payload.registrantTypes = payload.registrantTypes.map((regType) => {
regType.allowedRegistrantTypeSet =
regType.allowedRegistrantTypeSet.map((set) => {
delete set.name;
delete set.selected;
return set;
});
return regType;
});
$http({
method: 'PUT',
url: 'conferences/' + conference.id,
Expand Down
3 changes: 0 additions & 3 deletions app/scripts/directives/blockEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,9 @@ angular.module('confRegistrationWebApp').directive('blockEditor', function () {
$scope.typeToProfile.addressQuestion = 'ADDRESS';
$scope.typeToProfile.genderQuestion = 'GENDER';
$scope.typeToProfile.yearInSchoolQuestion = 'YEAR_IN_SCHOOL';
$scope.typeToProfile.opportunitiesQuestion = 'OPPORTUNITIES';
$scope.typeToProfile.birthDateQuestion = 'BIRTH_DATE';
$scope.typeToProfile.campusQuestion = 'CAMPUS';
$scope.typeToProfile.dormitoryQuestion = 'DORMITORY';
$scope.typeToProfile.graduationDateQuestion = 'GRADUATION_DATE';
$scope.typeToProfile.ethnicityQuestion = 'ETHNICITY';

$scope.profileCheck = !_.isNull($scope.block.profileType);
$scope.profileOption = _.has($scope.typeToProfile, $scope.block.type);
Expand Down
11 changes: 0 additions & 11 deletions test/spec/directives/blockEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,4 @@ describe('Directive: blockEditor', function () {

expect(scope.pType).toBe('Sex');
});

it('returns whether a question type exists or not using eventHasQuestionType()', function () {
const block = _.find(testData.conference.registrationPages[1].blocks, {
id: '9b83eebd-b064-4edf-92d0-7982a330272a',
});
scope.block = block;

expect(scope.eventHasQuestionType('genderQuestion')).toBe(true);

expect(scope.eventHasQuestionType('ethnicityQuestion')).toBe(false);
});
});

0 comments on commit 23c85b0

Please sign in to comment.