Skip to content

Commit b593940

Browse files
committed
Restored Public Survey option
1 parent 6b132a5 commit b593940

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

web/src/app/components/shared/general-access-control/general-access-control.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ const generalAccessLabels = Map<
4343
label: $localize`:@@app.labels.unlisted:Unlisted`,
4444
},
4545
],
46+
[
47+
SurveyGeneralAccess.PUBLIC,
48+
{
49+
description: $localize`:@@app.texts.generalAccess.public:Anyone can find and collect data for this survey`,
50+
icon: 'public',
51+
label: $localize`:@@app.labels.public:Public`,
52+
},
53+
],
4654
]);
4755

4856
@Component({
@@ -76,7 +84,9 @@ export class GeneralAccessControlComponent {
7684
}
7785

7886
get generalAccessKeys(): SurveyGeneralAccess[] {
79-
return Array.from(this.generalAccessLabels.keys());
87+
return Array.from(this.generalAccessLabels.keys()).filter(
88+
key => key !== SurveyGeneralAccess.PUBLIC || this.authService.isAdmin()
89+
);
8090
}
8191

8292
changeGeneralAccess(generalAccess: SurveyGeneralAccess) {

web/src/locale/messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
"app.labels.restricted": "Restricted",
109109
"app.texts.generalAccess.unlisted": "Everyone with the survey QR code or link can collect data for this survey",
110110
"app.labels.unlisted": "Unlisted",
111+
"app.texts.generalAccess.public": "Anyone can find and collect data for this survey",
112+
"app.labels.public": "Public",
111113
"app.labels.signOut": "Sign out",
112114
"app.labels.manageSurvey": "Manage survey",
113115
"app.labels.publishChanges": "Publish changes",
@@ -141,7 +143,6 @@
141143
"app.labels.createSurvey": "Create survey",
142144
"app.labels.createSurveyDescription": "Define jobs and sites for data collectors",
143145
"app.labels.all": "All",
144-
"app.labels.public": "Public",
145146
"app.labels.ifTheAnswerTo": "If the answer to",
146147
"app.taskEditor.condition.selectQuestion": "Select question",
147148
"app.controls.errors.requiredQuestion": "A question must be selected as a condition",

0 commit comments

Comments
 (0)