diff --git a/packages/admin-portal/src/components/pages/apps-management/__tests__/__snapshots__/apps-management.test.tsx.snap b/packages/admin-portal/src/components/pages/apps-management/__tests__/__snapshots__/apps-management.test.tsx.snap index 5c9bcc705f..c610ceed6d 100644 --- a/packages/admin-portal/src/components/pages/apps-management/__tests__/__snapshots__/apps-management.test.tsx.snap +++ b/packages/admin-portal/src/components/pages/apps-management/__tests__/__snapshots__/apps-management.test.tsx.snap @@ -226,7 +226,7 @@ exports[`admin-apps AdminApprovals should match a snapshot 1`] = ` validate={null} >
{ return { @@ -111,3 +117,15 @@ describe('handleFetchData', () => { expect(dispatch).toBeCalledWith(devsManagementRequestData(params)) }) }) + +describe('onClickStatusButton', () => { + it('should run correctly', () => { + const setDeveloper = jest.fn() + const setIsSetStatusModalOpen = jest.fn() + const developerData = {} + const fn = onClickStatusButton(setDeveloper, setIsSetStatusModalOpen, developerData) + fn() + expect(setDeveloper).toBeCalledWith({ ...developerData }) + expect(setIsSetStatusModalOpen).toBeCalledWith(true) + }) +}) diff --git a/packages/admin-portal/src/components/pages/devs-management/devs-management.tsx b/packages/admin-portal/src/components/pages/devs-management/devs-management.tsx index 1c98f9ebe5..705a6719c5 100644 --- a/packages/admin-portal/src/components/pages/devs-management/devs-management.tsx +++ b/packages/admin-portal/src/components/pages/devs-management/devs-management.tsx @@ -1,4 +1,4 @@ -import * as React from 'react' +import React from 'react' import { History } from 'history' import { useDispatch, useSelector } from 'react-redux' import { Link } from 'react-router-dom' @@ -82,6 +82,15 @@ export const onSearchHandler = (history: History) => ( } } +export const onClickStatusButton = ( + setDeveloper: React.Dispatch, + setIsSetStatusModalOpen: React.Dispatch, + developerData, +) => () => { + setDeveloper({ ...developerData }) + setIsSetStatusModalOpen(true) +} + export const DevsManagement: React.FC = () => { const dispatch = useDispatch() const history = useHistory() @@ -92,7 +101,7 @@ export const DevsManagement: React.FC = () => { const onPageChange = React.useCallback(onPageChangeHandler(history, filterValues), [history, filterValues]) const onSearch = React.useCallback(onSearchHandler(history), [history]) const [isSetStatusModalOpen, setIsSetStatusModalOpen] = React.useState(false) - const [developer, setDeveloper] = React.useState({} as DeveloperModel) + const [developer, setDeveloper] = React.useState({} as DeveloperModel) const devsManagementState = useSelector(selectDevsManagement) const { loading, data } = devsManagementState @@ -105,6 +114,7 @@ export const DevsManagement: React.FC = () => { fetchData({ page: pageNumber, queryString: qs.stringify(filterValues as { name: string; company: string }) }) } } + const pageNo = pageNumber - 1 const pageNoTimesRevsions = pageNo * REVISIONS_PER_PAGE const HeaderCell = ({ row: { index } }) =>
{pageNoTimesRevsions + index + 1}
@@ -136,10 +146,7 @@ export const DevsManagement: React.FC = () => { diff --git a/packages/admin-portal/src/tests/badges/badge-branches.svg b/packages/admin-portal/src/tests/badges/badge-branches.svg index 844f4973c1..50de188911 100644 --- a/packages/admin-portal/src/tests/badges/badge-branches.svg +++ b/packages/admin-portal/src/tests/badges/badge-branches.svg @@ -1 +1 @@ -Coverage:branches: 73.57%Coverage:branches73.57% +Coverage:branches: 73.73%Coverage:branches73.73% \ No newline at end of file diff --git a/packages/admin-portal/src/tests/badges/badge-functions.svg b/packages/admin-portal/src/tests/badges/badge-functions.svg index 070dcdd06c..80a64d5eb3 100644 --- a/packages/admin-portal/src/tests/badges/badge-functions.svg +++ b/packages/admin-portal/src/tests/badges/badge-functions.svg @@ -1 +1 @@ -Coverage:functions: 83.72%Coverage:functions83.72% +Coverage:functions: 83.85%Coverage:functions83.85% \ No newline at end of file diff --git a/packages/admin-portal/src/tests/badges/badge-lines.svg b/packages/admin-portal/src/tests/badges/badge-lines.svg index efe2e6285d..d88678ebe6 100644 --- a/packages/admin-portal/src/tests/badges/badge-lines.svg +++ b/packages/admin-portal/src/tests/badges/badge-lines.svg @@ -1 +1 @@ -Coverage:lines: 88.58%Coverage:lines88.58% +Coverage:lines: 89.01%Coverage:lines89.01% \ No newline at end of file diff --git a/packages/admin-portal/src/tests/badges/badge-statements.svg b/packages/admin-portal/src/tests/badges/badge-statements.svg index f4b37863ca..bcd2fd3498 100644 --- a/packages/admin-portal/src/tests/badges/badge-statements.svg +++ b/packages/admin-portal/src/tests/badges/badge-statements.svg @@ -1 +1 @@ -Coverage:statements: 88.11%Coverage:statements88.11% +Coverage:statements: 88.51%Coverage:statements88.51% \ No newline at end of file diff --git a/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/general-information-section.test.tsx.snap b/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/general-information-section.test.tsx.snap index 4af7006a12..723ffeceae 100644 --- a/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/general-information-section.test.tsx.snap +++ b/packages/developer-portal/src/components/pages/edit-app/__tests__/__snapshots__/general-information-section.test.tsx.snap @@ -87,7 +87,7 @@ exports[`GeneralInformationSection should match a snapshot when isListed equal t validate={[Function]} >
Coverage:branches: 68.5%Coverage:branches68.5% +Coverage:branches: 68.5%Coverage:branches68.5% \ No newline at end of file diff --git a/packages/developer-portal/src/tests/badges/badge-functions.svg b/packages/developer-portal/src/tests/badges/badge-functions.svg index c3e2333d83..24abdd06a1 100644 --- a/packages/developer-portal/src/tests/badges/badge-functions.svg +++ b/packages/developer-portal/src/tests/badges/badge-functions.svg @@ -1 +1 @@ -Coverage:functions: 80.81%Coverage:functions80.81% +Coverage:functions: 80.81%Coverage:functions80.81% \ No newline at end of file diff --git a/packages/developer-portal/src/tests/badges/badge-lines.svg b/packages/developer-portal/src/tests/badges/badge-lines.svg index ad14152d55..b937fc2bbc 100644 --- a/packages/developer-portal/src/tests/badges/badge-lines.svg +++ b/packages/developer-portal/src/tests/badges/badge-lines.svg @@ -1 +1 @@ -Coverage:lines: 89.88%Coverage:lines89.88% +Coverage:lines: 89.88%Coverage:lines89.88% \ No newline at end of file diff --git a/packages/developer-portal/src/tests/badges/badge-statements.svg b/packages/developer-portal/src/tests/badges/badge-statements.svg index fd13e55bf7..cbbc103189 100644 --- a/packages/developer-portal/src/tests/badges/badge-statements.svg +++ b/packages/developer-portal/src/tests/badges/badge-statements.svg @@ -1 +1 @@ -Coverage:statements: 89%Coverage:statements89% +Coverage:statements: 89%Coverage:statements89% \ No newline at end of file diff --git a/packages/elements/src/components/Input/index.tsx b/packages/elements/src/components/Input/index.tsx index 790e1e9b2f..3ace2b1d0e 100644 --- a/packages/elements/src/components/Input/index.tsx +++ b/packages/elements/src/components/Input/index.tsx @@ -2,6 +2,7 @@ import * as React from 'react' import { Field, FieldProps } from 'formik' import { checkError } from '../../utils/form' import { fieldValidateRequire } from '../../utils/validators' +import { cx } from 'linaria' export interface InputProps { type: 'text' | 'password' | 'email' | 'tel' | 'hidden' | 'time' @@ -40,7 +41,7 @@ export const Input = ({ const inputClassName = hasError ? 'input is-danger' : 'input is-primary' const defaultValue = '' return ( -
+
{type !== 'hidden' && !rightIcon && labelText && (