Skip to content

Commit

Permalink
Change gender to sex
Browse files Browse the repository at this point in the history
commit 69d61815854e66be9551f0fd5b85f58f7b90e3b1
Author: Caleb Alldrin <[email protected]>
Date:   Fri Jul 28 12:21:01 2023 -0700

    Add tests

commit f23be08
Author: Caleb Alldrin <[email protected]>
Date:   Thu Jul 27 10:24:06 2023 -0700

    Fix code syntax of profile error message

commit 7595b03
Author: Caleb Alldrin <[email protected]>
Date:   Thu Jul 27 10:24:06 2023 -0700

    Fix code syntax of profile error message

commit 29980ac
Author: Caleb Alldrin <[email protected]>
Date:   Wed Jul 26 12:56:24 2023 -0700

    Make multiple profile question error say Sex instead of Gender
  • Loading branch information
caleballdrin committed Jul 28, 2023
1 parent fdd9b72 commit 3a17f97
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
15 changes: 10 additions & 5 deletions app/scripts/directives/blockEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,23 @@ angular.module('confRegistrationWebApp').directive('blockEditor', function () {
});
});
if (profileCount > 1) {
const pType =
$scope.block.profileType == 'GENDER'
? 'Sex'
: $scope.block.profileType.charAt(0).toUpperCase() +
$scope.block.profileType
.split('_')
.join(' ')
.slice(1)
.toLowerCase();
modalMessage.error(
'Only one ' +
$scope.block.profileType.charAt(0).toUpperCase() +
$scope.block.profileType.slice(1).toLowerCase() +
' profile block can be used per form.',
'Only one ' + pType + ' profile block can be used per form.',
);
$scope.block.profileType = null;
$scope.profileCheck = false;
}
}
};

$scope.registrationTypeName = function (id) {
if (!id) {
return;
Expand Down
15 changes: 14 additions & 1 deletion test/spec/testData.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ angular.module('confRegistrationWebApp').service('testData', function () {
required: false,
position: 6,
content: '',
profileType: null,
profileType: 'GENDER',
registrantTypes: [],
rules: [],
},
Expand Down Expand Up @@ -302,6 +302,19 @@ angular.module('confRegistrationWebApp').service('testData', function () {
},
],
},
{
id: '9b83eebd-b064-4edf-92d0-7982a330272b',
pageId: '7b4c19df-7377-4d37-90fb-5b262bb66d1a',
title: 'Sex',
exportFieldTitle: null,
type: 'genderQuestion',
required: false,
position: 9,
content: '',
profileType: null,
registrantTypes: [],
rules: [],
},
{
adminOnly: 'false',
content: {
Expand Down

0 comments on commit 3a17f97

Please sign in to comment.