Skip to content

Commit

Permalink
πŸ› Import questionnaire form - fix success toast message (#1385)
Browse files Browse the repository at this point in the history
The message displayed on successful import of a questionnaire did not
exist in the translation file. The message key now uses an existing
message to say:

  "Questionnaire _Name Used_ was successfully created."

<!--
## PR Title Prefix

Every **PR Title** should be prefixed with :text: to indicate its type.

- Breaking change: ⚠️ (`⚠️`)
- Non-breaking feature: ✨ (`✨`)
- Patch fix: πŸ› (`πŸ›`)
- Docs: πŸ“– (`πŸ“–`)
- Infra/Tests/Other: 🌱 (`🌱`)
- No release note: πŸ‘» (`πŸ‘»`)

For example, a pull request containing breaking changes might look like
`⚠️ My pull request contains breaking changes`.

Since GitHub supports emoji aliases (ie. `πŸ‘»`), there is no need to
include
the emoji directly in the PR title -- **please use the alias**. It used
to be
the case that projects using emojis for PR typing had to include the
emoji
directly because GitHub didn't render the alias. Given that `⚠️`
is
easy enough to read as text, easy to parse in release tooling, and
rendered in
GitHub well, we prefer to standardize on the alias.

For more information, please see the Konveyor
[Versioning
Doc](https://github.com/konveyor/release-tools/blob/main/VERSIONING.md).
-->

Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 authored Sep 21, 2023
1 parent 44a40e8 commit 1573d37
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ export const ImportQuestionnaireForm: React.FC<
trigger,
} = methods;

const onHandleSuccessfullQuestionnaireCreation = (
response: Questionnaire
) => {
const onHandleSuccessfulQuestionnaireCreation = (response: Questionnaire) => {
onSaved(response);
pushNotification({
title: t("toastr.success.questionnaireCreated"),
title: t("toastr.success.createWhat", {
type: t("terms.questionnaire"),
what: response.name,
}),
variant: "success",
});
onSaved();
Expand All @@ -75,7 +76,7 @@ export const ImportQuestionnaireForm: React.FC<
};

const { mutate: createQuestionnaire } = useCreateQuestionnaireMutation(
onHandleSuccessfullQuestionnaireCreation,
onHandleSuccessfulQuestionnaireCreation,
onHandleFailedQuestionnaireCreation
);

Expand Down

0 comments on commit 1573d37

Please sign in to comment.