Skip to content

Commit

Permalink
Merge pull request #3363 from 3scale/upgrade-babel-dependencies
Browse files Browse the repository at this point in the history
Bump the version of @babel/helper-create-regexp-features-plugin
  • Loading branch information
mayorova committed May 17, 2023
2 parents d4d6b23 + d3cda63 commit cd33004
Show file tree
Hide file tree
Showing 14 changed files with 1,314 additions and 2,383 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ interface Props {
setApiJsonSpec: (description: string) => void;
}

const emptyArray = [] as never[]

const ApiJsonSpecInput: FunctionComponent<Props> = ({
apiJsonSpec,
errors = [],
errors = emptyArray,
setApiJsonSpec
}) => {
const textAreaId = 'api_docs_service_body'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ interface Props {
setDescription: (description: string) => void;
}

const emptyArray = [] as never[]

const DescriptionInput: FunctionComponent<Props> = ({
description,
errors = [],
errors = emptyArray,
setDescription
}) => {

Expand Down
4 changes: 3 additions & 1 deletion app/javascript/src/ActiveDocs/components/NameInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ interface Props {
setName: (name: string) => void;
}

const NameInput: FunctionComponent<Props> = ({ errors = [], name, setName }) => {
const emptyArray = [] as never[]

const NameInput: FunctionComponent<Props> = ({ errors = emptyArray, name, setName }) => {
const validated = errors.length ? 'error' : 'default'

return (
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/src/ActiveDocs/components/SystemNameInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ interface Props {
systemName: string;
}

const SystemNameInput: FunctionComponent<Props> = ({ errors = [], isDisabled = false, setSystemName, systemName }) => {
const emptyArray = [] as never[]

const SystemNameInput: FunctionComponent<Props> = ({ errors = emptyArray, isDisabled = false, setSystemName, systemName }) => {
const validated = errors.length ? 'error' : 'default'

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ interface Props {
errors?: string[];
}

const emptyArray = [] as never[]

const PrivateEndpointInput: FunctionComponent<Props> = ({
privateEndpoint,
setPrivateEndpoint,
errors = []
errors = emptyArray
}) => (
<FormGroup
isRequired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ interface Props {
errors?: FlashMessage[];
}

const emptyArray = [] as never[]

const ChangePassword: FunctionComponent<Props> = ({
lostPasswordToken = null,
url = '',
errors = []
errors = emptyArray
}) => {
const {
isFormDisabled,
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/src/Common/components/TableModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ interface Props<T extends IRecord> {

const PER_PAGE_DEFAULT = 5

const emptyArray = [] as never[]

const TableModal = <T extends IRecord>({
title,
isOpen,
isLoading = false,
selectedItem,
pageItems = [],
pageItems = emptyArray,
itemsCount,
onSelect,
onClose,
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/src/Common/components/UserDefinedField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ interface Props {
validationErrors?: string[];
}

const emptyArray = [] as never[]

const UserDefinedField: FunctionComponent<Props> = ({
fieldDefinition,
value,
onChange,
validationErrors = []
validationErrors = emptyArray
}) => {
const { id, label, required, name, choices } = fieldDefinition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ interface Props {
errors?: FormErrors;
}

const emptyObject = {} as never

const EmailConfigurationForm: FunctionComponent<Props> = ({
url,
emailConfiguration,
isUpdate = false,
errors = {}
errors = emptyObject
}) => {
const FORM_ID = 'email-configuration-form'
const [email, setEmail] = useState<string>(emailConfiguration.email ?? '')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ interface Props {
error?: string;
}

const emptyArray = [] as never[]

const NewApplicationForm: React.FunctionComponent<Props> = ({
buyer: defaultBuyer,
buyers,
Expand All @@ -55,7 +57,7 @@ const NewApplicationForm: React.FunctionComponent<Props> = ({
products,
productsCount = 0,
productsPath,
definedFields = [],
definedFields = emptyArray,
validationErrors,
error
}) => {
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/src/Users/components/FeaturesFieldset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ interface Props {
onAdminSectionSelected: (section: AdminSection) => void;
}

const emptyArray = [] as never[]

const FeaturesFieldset: React.FunctionComponent<Props> = ({
features,
selectedSections = [],
selectedSections = emptyArray,
areServicesVisible = false,
onAdminSectionSelected
}) => {
Expand Down
22 changes: 13 additions & 9 deletions app/javascript/src/Users/components/PermissionsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,30 @@ import type { FunctionComponent } from 'react'
import type { AdminSection, Feature, Role } from 'Users/types'
import type { Api } from 'Types'

interface State {
role?: Role;
// eslint-disable-next-line @typescript-eslint/naming-convention -- Comes from rails like that
admin_sections?: AdminSection[];
// eslint-disable-next-line @typescript-eslint/naming-convention -- Comes from rails like that
member_permission_service_ids?: number[];
}

interface Props {
initialState?: {
role?: Role;
// eslint-disable-next-line @typescript-eslint/naming-convention -- Comes from rails like that
admin_sections?: AdminSection[];
// eslint-disable-next-line @typescript-eslint/naming-convention -- Comes from rails like that
member_permission_service_ids?: number[];
};
initialState?: State;
features: Feature[];
services: Api[];
}

const emptyObject = {} as never

/**
* Represents the user's permissions form, also known as Administrative. It handles the user's Role and their access to different Services.
* @param {InitialState} initialState - The values of the user's current settings.
* @param {State} initialState - The values of the user's current settings.
* @param {Feature[]} features - The set of features or sections the user can have access to.
* @param {Api[]} services - The list of services or APIs the user can have access to.
*/
const PermissionsForm: FunctionComponent<Props> = ({
initialState = {},
initialState = emptyObject,
features,
services
}) => {
Expand Down
8 changes: 5 additions & 3 deletions app/javascript/src/Users/components/ServicesFieldset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ interface Props {
onServiceSelected: (id: number) => void;
}

const emptyArray = [] as never[]

const ServicesFieldset: React.FunctionComponent<Props> = ({
services = [],
selectedSections = [],
selectedServicesIds = [],
services = emptyArray,
selectedSections = emptyArray,
selectedServicesIds = emptyArray,
onServiceSelected
}) => {
const servicesListClassName = 'ServiceAccessList'
Expand Down
Loading

0 comments on commit cd33004

Please sign in to comment.