Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Submit button IDs is submit #1342

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import {
NumberInput,
} from "@patternfly/react-core";

import {
DEFAULT_SELECT_MAX_HEIGHT,
PROPOSED_ACTION_LIST,
EFFORT_ESTIMATE_LIST,
} from "@app/Constants";
import { PROPOSED_ACTION_LIST, EFFORT_ESTIMATE_LIST } from "@app/Constants";
import { number } from "yup";
import {
Application,
Expand Down Expand Up @@ -242,7 +238,7 @@ export const ReviewForm: React.FC<IReviewFormProps> = ({
<ActionGroup>
<Button
type="submit"
id="review-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@
searchInputAriaLabel="tags-select-toggle"
selections={
value
.map((formTag) =>
tags?.find((tagRef) => tagRef.name === formTag.name)
.map(
(formTag) =>
tags?.find((tagRef) => tagRef.name === formTag.name)

Check warning on line 467 in client/src/app/pages/applications/components/application-form/application-form.tsx

View check run for this annotation

Codecov / codecov/patch

client/src/app/pages/applications/components/application-form/application-form.tsx#L467

Added line #L467 was not covered by tests
)
.map((matchingTag) =>
matchingTag ? matchingTag.name : undefined
Expand Down Expand Up @@ -563,10 +564,11 @@
toggleAriaLabel="contributors dropdown toggle"
aria-label={name}
value={value
.map((formContributor) =>
stakeholders?.find(
(stakeholder) => stakeholder.name === formContributor
)
.map(
(formContributor) =>
stakeholders?.find(
(stakeholder) => stakeholder.name === formContributor

Check warning on line 570 in client/src/app/pages/applications/components/application-form/application-form.tsx

View check run for this annotation

Codecov / codecov/patch

client/src/app/pages/applications/components/application-form/application-form.tsx#L569-L570

Added lines #L569 - L570 were not covered by tests
)
)
.map((matchingStakeholder) =>
matchingStakeholder
Expand Down Expand Up @@ -705,7 +707,7 @@
<ActionGroup>
<Button
type="submit"
id="application-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export const ApplicationIdentityForm: React.FC<
);

const onSubmit = (formValues: FormValues) => {
let updatePromises: Array<Promise<Application>> = [];
const updatePromises: Array<Promise<Application>> = [];
applications.forEach((application) => {
let updatedIdentities: Ref[] = [];
const updatedIdentities: Ref[] = [];
if (application.identities && identities) {
const matchingSourceCredential = identities.find(
(identity) => identity.name === formValues.sourceCredentials
Expand Down Expand Up @@ -249,7 +249,7 @@ export const ApplicationIdentityForm: React.FC<
<ActionGroup>
<Button
type="submit"
id="identity-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React from "react";
import { useTranslation } from "react-i18next";
import { AxiosError, AxiosResponse } from "axios";
import { object, string } from "yup";
Expand Down Expand Up @@ -202,7 +202,7 @@ export const BusinessServiceForm: React.FC<BusinessServiceFormProps> = ({
<ActionGroup>
<Button
type="submit"
id="business-service-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const JobFunctionForm: React.FC<JobFunctionFormProps> = ({
<ActionGroup>
<Button
type="submit"
id="job-function-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ export const StakeholderGroupForm: React.FC<StakeholderGroupFormProps> = ({

const onSubmit = (formValues: FormValues) => {
const matchingStakeholderRefs: Ref[] = stakeholders
.filter((stakeholder) =>
formValues?.stakeholderNames?.includes(stakeholder.name)
.filter(
(stakeholder) =>
formValues?.stakeholderNames?.includes(stakeholder.name)
)
.map((stakeholder) => {
return {
Expand Down Expand Up @@ -239,7 +240,7 @@ export const StakeholderGroupForm: React.FC<StakeholderGroupFormProps> = ({
<ActionGroup>
<Button
type="submit"
id="stakeholder-group-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ export const StakeholderForm: React.FC<StakeholderFormProps> = ({

const onSubmit = (formValues: FormValues) => {
const matchingStakeholderGroupRefs: Ref[] = stakeholderGroups
.filter((stakeholderGroup) =>
formValues?.stakeholderGroupNames?.includes(stakeholderGroup.name)
.filter(
(stakeholderGroup) =>
formValues?.stakeholderGroupNames?.includes(stakeholderGroup.name)
)
.map((stakeholderGroup) => {
return {
Expand Down Expand Up @@ -270,7 +271,7 @@ export const StakeholderForm: React.FC<StakeholderFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="stakeholder-form-submit"
id="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const TagCategoryForm: React.FC<TagCategoryFormProps> = ({
<ActionGroup>
<Button
type="submit"
id="tag-type-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const TagForm: React.FC<TagFormProps> = ({ tag, onClose }) => {
<ActionGroup>
<Button
type="submit"
id="tag-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/external/jira/tracker-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const TrackerForm: React.FC<TrackerFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="identity-form-submit"
id="submit"
variant={ButtonVariant.primary}
isDisabled={
!isValid || isSubmitting || isValidating || isLoading || !isDirty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ export const IdentityForm: React.FC<IdentityFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="identity-form-submit"
id="submit"
variant={ButtonVariant.primary}
isDisabled={
!isValid || isSubmitting || isValidating || isLoading || !isDirty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const CustomTargetForm: React.FC<CustomTargetFormProps> = ({
customRulesFiles: getInitialCustomRulesFilesData(),
rulesKind: !target
? "manual"
: !!target?.ruleset?.rules?.length
: target?.ruleset?.rules?.length
? "manual"
: "repository",
associatedCredentials: target?.ruleset?.identity?.name,
Expand Down Expand Up @@ -274,7 +274,7 @@ export const CustomTargetForm: React.FC<CustomTargetFormProps> = ({
description: formValues?.description?.trim() || "",
...(formValues.imageID && { image: { id: formValues.imageID } }),
custom: true,
labels: !!labels.length ? labels : [{ name: "custom", label: "custom" }],
labels: labels.length ? labels : [{ name: "custom", label: "custom" }],
ruleset: {
id: target && target.custom ? target.ruleset.id : undefined,
name: formValues.name.trim(),
Expand Down Expand Up @@ -615,7 +615,7 @@ export const CustomTargetForm: React.FC<CustomTargetFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="identity-form-submit"
id="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const ExportForm: React.FC<ExportFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="identity-form-submit"
id="submit"
variant={ButtonVariant.primary}
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export const ManageApplicationsForm: React.FC<ManageApplicationsFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="wave-form-submit"
id="submit"
variant="primary"
isDisabled={!isNewerSelection()}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ import {
DatePicker,
Level,
LevelItem,
Weekday,
} from "@patternfly/react-core";

import { useFetchStakeholders } from "@app/queries/stakeholders";
import { useFetchStakeholderGroups } from "@app/queries/stakeholdergoups";
import {
useFetchMigrationWaves,
useCreateMigrationWaveMutation,
useUpdateMigrationWaveMutation,
} from "@app/queries/migration-waves";
Expand Down Expand Up @@ -155,7 +153,7 @@ export const WaveForm: React.FC<WaveFormProps> = ({
"min-char-check",
"Name is invalid. The name must be between 3 and 120 characters ",
(value) => {
if (!!value) {
if (value) {
const schema = yup
.string()
.min(3, t("validation.minLength", { length: 3 }))
Expand Down Expand Up @@ -428,7 +426,7 @@ export const WaveForm: React.FC<WaveFormProps> = ({
<Button
type="submit"
aria-label="submit"
id="migration-wave-form-submit"
id="submit"
variant="primary"
isDisabled={!isValid || isSubmitting || isValidating || !isDirty}
>
Expand Down
3 changes: 1 addition & 2 deletions client/src/app/pages/proxies/proxy-form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useMemo } from "react";
import {
ActionGroup,
Alert,
Button,
ButtonVariant,
Form,
Expand Down Expand Up @@ -388,7 +387,7 @@ export const ProxyForm: React.FC<ProxyFormProps> = ({
<ActionGroup>
<Button
type="submit"
id="proxy-form-submit"
id="submit"
aria-label="submit"
variant={ButtonVariant.primary}
isDisabled={
Expand Down
Loading