Skip to content

Commit

Permalink
Enabled editing of surveys for published engagements
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanpa-aot committed Nov 8, 2023
1 parent 12f6b4e commit 8d68919
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion met-api/src/met_api/services/survey_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def update(cls, data: SurveySchema):
is_template = survey.get('is_template', None)
cls.validate_template_surveys_edit_access(is_template, user_roles)

if engagement and engagement.get('status_id', None) != Status.Draft.value:
if engagement and engagement.get('status_id', None) not in [Status.Draft.value, Status.Published.value]:
raise ValueError('Engagement already published')

updated_survey = SurveyModel.update_survey(data)
Expand Down
4 changes: 2 additions & 2 deletions met-web/src/components/survey/building/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const SurveyFormBuilder = () => {
dispatch(
openNotification({
severity: 'warning',
text: 'Engagement already published. Saving is disabled.',
text: 'Engagement already published. Please be careful while editing the survey.',
}),
);
}
Expand Down Expand Up @@ -411,7 +411,7 @@ const SurveyFormBuilder = () => {
<Grid item xs={12}>
<Stack direction="row" spacing={2}>
<PrimaryButton

Check failure on line 413 in met-web/src/components/survey/building/index.tsx

View workflow job for this annotation

GitHub Actions / linting (16.x)

Replace `⏎························disabled={!formData}⏎························loading={isSaving}⏎························onClick={handleSaveForm}⏎····················` with `·disabled={!formData}·loading={isSaving}·onClick={handleSaveForm}`
disabled={!formData || hasPublishedEngagement}
disabled={!formData}
loading={isSaving}
onClick={handleSaveForm}
>
Expand Down

0 comments on commit 8d68919

Please sign in to comment.