From 68292ece44a35c142bf116db50989c03bc33e522 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Thu, 25 Feb 2021 13:53:01 +0100 Subject: [PATCH] SONAR-12056 Indicate required fields for forms --- .../extensions/CreateApplicationForm.tsx | 7 +- .../CreateApplicationForm-test.tsx.snap | 10 +-- .../application-console/CreateBranchForm.tsx | 6 +- .../components/CustomRuleFormModal.tsx | 11 ++- .../CustomRuleFormModal-test.tsx.snap | 44 +++------ .../create/project/ManualProjectCreate.tsx | 3 + .../ManualProjectCreate-test.tsx.snap | 3 + .../apps/custom-measures/components/Form.tsx | 5 +- .../__snapshots__/Form-test.tsx.snap | 24 +---- .../apps/custom-metrics/components/Form.tsx | 10 ++- .../__snapshots__/Form-test.tsx.snap | 21 ++--- .../main/js/apps/groups/components/Form.tsx | 5 +- .../__snapshots__/Form-test.tsx.snap | 9 +- .../permission-templates/components/Form.tsx | 5 +- .../project/components/ApplyTemplate.tsx | 51 ++++++----- .../__snapshots__/ApplyTemplate-test.tsx.snap | 9 +- .../components/BaselineSettingDays.tsx | 23 +++-- .../BaselineSettingReferenceBranch.tsx | 5 +- .../BaselineSettingDays-test.tsx.snap | 3 + ...selineSettingReferenceBranch-test.tsx.snap | 27 +++--- .../components/RenameBranchModal.tsx | 5 +- .../RenameBranchModal-test.tsx.snap | 27 +++--- .../main/js/apps/projectKey/UpdateForm.tsx | 3 + .../__snapshots__/UpdateForm-test.tsx.snap | 3 + .../js/apps/projectLinks/CreationModal.tsx | 8 +- .../__snapshots__/CreationModal-test.tsx.snap | 15 ++-- .../BulkApplyTemplateModal.tsx | 13 ++- .../projectsManagement/CreateProjectForm.tsx | 7 +- .../BulkApplyTemplateModal-test.tsx.snap | 36 ++++---- .../CreateProjectForm-test.tsx.snap | 45 ++++------ .../components/CopyQualityGateForm.tsx | 5 +- .../components/CreateQualityGateForm.tsx | 5 +- .../components/RenameQualityGateForm.tsx | 5 +- .../CopyQualityGateForm-test.tsx.snap | 9 +- .../CreateQualityGateForm-test.tsx.snap | 9 +- .../RenameQualityGateForm-test.tsx.snap | 9 +- .../components/CopyProfileForm.tsx | 5 +- .../components/ExtendProfileForm.tsx | 5 +- .../components/RenameProfileForm.tsx | 5 +- .../ExtendProfileForm-test.tsx.snap | 9 +- .../details/ChangeParentForm.tsx | 6 +- .../ChangeParentForm-test.tsx.snap | 10 +-- .../home/CreateProfileForm.tsx | 7 +- .../home/RestoreProfileForm.tsx | 19 ++-- .../CreateProfileForm-test.tsx.snap | 30 +++---- .../RestoreProfileForm-test.tsx.snap | 9 +- .../js/apps/settings/components/EmailForm.tsx | 8 +- .../__snapshots__/EmailForm-test.tsx.snap | 60 +++++-------- .../AlmBindingDefinitionFormField.tsx | 3 +- ...lmBindingDefinitionFormField-test.tsx.snap | 24 +---- .../AlmSpecificForm.tsx | 3 +- .../PRDecorationBindingRenderer.tsx | 6 +- .../AlmSpecificForm-test.tsx.snap | 90 ++++--------------- .../PRDecorationBindingRenderer-test.tsx.snap | 66 +++++++------- .../js/apps/users/components/PasswordForm.tsx | 11 ++- .../js/apps/users/components/UserForm.tsx | 10 ++- .../__snapshots__/PasswordForm-test.tsx.snap | 21 ++--- .../__snapshots__/UserForm-test.tsx.snap | 30 +++---- .../webhooks/components/CreateWebhookForm.tsx | 8 +- .../js/components/common/ResetPassword.tsx | 10 ++- .../__snapshots__/ResetPassword-test.tsx.snap | 21 ++--- .../resources/org/sonar/l10n/core.properties | 2 + 62 files changed, 438 insertions(+), 525 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx b/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx index 756866c9909..b46fbcfba60 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/CreateApplicationForm.tsx @@ -22,6 +22,8 @@ import { ResetButtonLink, SubmitButton } from 'sonar-ui-common/components/contro import Radio from 'sonar-ui-common/components/controls/Radio'; import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal'; import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; +import MandatoryFieldMarker from 'sonar-ui-common/components/ui/MandatoryFieldMarker'; +import MandatoryFieldsExplanation from 'sonar-ui-common/components/ui/MandatoryFieldsExplanation'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { createApplication } from '../../../api/application'; import { ComponentQualifier, Visibility } from '../../../types/component'; @@ -107,9 +109,12 @@ export default class CreateApplicationForm extends React.PureComponent
+ +
+
@@ -38,12 +41,7 @@ exports[`should render correctly: form 1`] = ` htmlFor="view-edit-name" > name - - - * - +
) : ( <> +
(
(
{this.props.customRule ? ( @@ -194,7 +196,8 @@ export default class CustomRuleFormModal extends React.PureComponent (