Skip to content

Feat/get organizations data #162

Feat/get organizations data

Feat/get organizations data #162

GitHub Actions / Lint failed Jul 15, 2024

Errors 27, Warnings 7

Found 27 errors and 7 warnings

Annotations

Check failure on line 6 in globals/helpers/src/client-cookie.helper.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(prefer-const): 'resultCookitObj' is never reassigned. Use 'const' instead.

'resultCookitObj' is never reassigned. Use 'const' instead.
Raw output
  3 |
  4 | export const getAllCookieClient = (document: DocumentType): CookieObjType => {
> 5 |   let resultCookitObj = {}
    |       ^
  6 |
  7 |   const cookieString = document.cookie
  8 |   const cookieRecordArray = cookieString.split(';')

Check failure on line 10 in ui/divider/src/divider.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'DividerProps' is defined but never used.

'DividerProps' is defined but never used.
Raw output
   7 | import { ThemeType }              from '@ui/theme'
   8 |
>  9 | import { DividerProps }           from './divider.interfaces.js'
     |          ^
  10 |
  11 | export const Divider: FC<any> = (props) => {
  12 |   const { backgroundColor } = props

Check warning on line 29 in ui/error-message/src/error-message.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(null): Unused eslint-disable directive (no problems were reported from 'react-hooks/exhaustive-deps').

Unused eslint-disable directive (no problems were reported from 'react-hooks/exhaustive-deps').
Raw output
  26 |       errorMessageDispatch({
  27 |         type: 'set',
> 28 |         //     eslint-disable-next-line react-hooks/exhaustive-deps
     |         ^
  29 |         errorMessage: checkUrlErrorHook(),
  30 |       })
  31 |     }

Check failure on line 33 in ui/error-message/src/error-message.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(react-hooks/exhaustive-deps): React Hook useEffect has a missing dependency: 'errorMessageDispatch'. Either include it or remove the dependency array. If 'errorMessageDispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.

React Hook useEffect has a missing dependency: 'errorMessageDispatch'. Either include it or remove the dependency array. If 'errorMessageDispatch' changes too often, find the parent component that defines it and wrap that definition in useCallback.
Raw output
  30 |       })
  31 |     }
> 32 |   }, [])
     |      ^
  33 |
  34 |   useEffect(() => {
  35 |     setHide(false)

Check failure on line 4 in ui/scroll/src/scroll.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'maxHeight' is defined but never used.

'maxHeight' is defined but never used.
Raw output
  1 | import React                 from 'react'
  2 | import { PropsWithChildren } from 'react'
> 3 | import { maxHeight }         from 'styled-system'
    |          ^
  4 |
  5 | import { ScrollProps }       from './scroll.interface.js'
  6 | import { ScrollContainer }   from './scroll.styles.js'

Check failure on line 9 in ui/scroll/src/scroll.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-shadow): 'maxHeight' is already declared in the upper scope on line 3 column 10.

'maxHeight' is already declared in the upper scope on line 3 column 10.
Raw output
   6 | import { ScrollContainer }   from './scroll.styles.js'
   7 |
>  8 | const Scroll: React.FC<PropsWithChildren<ScrollProps>> = ({ children, height, maxHeight }) => (
     |                                                                               ^
   9 |   <ScrollContainer height={height} maxHeight={maxHeight}>
  10 |     {children}
  11 |   </ScrollContainer>

Check failure on line 24 in app/fragments/app-add-member-to-organization-modal/src/add-member-to-organization-modal.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'SelectedUsersType' is defined but never used.

'SelectedUsersType' is defined but never used.
Raw output
  21 |
  22 | import { AddMemberToOrganizationModalProps } from './add-member-to-organization-modal.interfaces.js'
> 23 | import { SelectedUsersType }                 from './add-member-to-organization-modal.interfaces.js'
     |          ^
  24 | import { HandlerSwitchType }                 from './add-member-to-organization-modal.interfaces.js'
  25 | import { TeamSwitch }                        from './team-switch/index.js'
  26 | import { getOrganizatoinTeamsHook }          from './get-organization-teams.hook.js'

Check failure on line 61 in app/fragments/app-add-member-to-organization-modal/src/add-member-to-organization-modal.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(consistent-return): Expected to return a value at the end of arrow function.

Expected to return a value at the end of arrow function.
Raw output
  58 |   useEffect(() => setButtonActiveHook({ selectedUsers, setButtonActive }), [selectedUsers])
  59 |
> 60 |   useEffect(() => {
     |                ^
  61 |     if (open && !teamsData.length) {
  62 |       return getOrganizatoinTeamsHook({
  63 |         open,

Check failure on line 71 in app/fragments/app-add-member-to-organization-modal/src/add-member-to-organization-modal.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(react-hooks/exhaustive-deps): React Hook useEffect has missing dependencies: 'errorMessageDispatch', 'organizationId', and 'teamsData'. Either include them or remove the dependency array.

React Hook useEffect has missing dependencies: 'errorMessageDispatch', 'organizationId', and 'teamsData'. Either include them or remove the dependency array.
Raw output
  68 |       })
  69 |     }
> 70 |   }, [open])
     |      ^
  71 |
  72 |   const inviteButtonClickHandler = () =>
  73 |     inviteButtonClickHook({

Check failure on line 15 in app/fragments/app-add-member-to-organization-modal/src/get-organization-teams.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(arrow-body-style): Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.
Raw output
  12 |   const token = getTokenCookie(document)
  13 |
> 14 |   const getOrganizatoinTeamsPromise = () => {
     |                                             ^
  15 |     return new Promise(async (resolve, reject) => {
  16 |       const client = octokitGraphqlClient(token)
  17 |

Check failure on line 16 in app/fragments/app-add-member-to-organization-modal/src/get-organization-teams.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-async-promise-executor): Promise executor functions should not be async.

Promise executor functions should not be async.
Raw output
  13 |
  14 |   const getOrganizatoinTeamsPromise = () => {
> 15 |     return new Promise(async (resolve, reject) => {
     |                        ^
  16 |       const client = octokitGraphqlClient(token)
  17 |
  18 |       try {

Check warning on line 33 in app/fragments/app-add-member-to-organization-modal/src/get-organization-teams.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  30 |         resolve(teamsData)
  31 |       } catch (e) {
> 32 |         console.error(e)
     |         ^
  33 |         errorMessageDispatch({
  34 |           type: 'set',
  35 |           errorMessage: { text: e.message, code: e.status || 0 },

Check failure on line 18 in app/fragments/app-add-member-to-organization-modal/src/invite-button-click.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-await-in-loop): Unexpected `await` inside a loop.

Unexpected `await` inside a loop.
Raw output
  15 |       const { githubUserId } = selectedUser
  16 |
> 17 |       await inviteMemberToOrgaization({
     |       ^
  18 |         token,
  19 |         organizationLogin,
  20 |         githubUserId,

Check warning on line 30 in app/fragments/app-add-member-to-organization-modal/src/invite-button-click.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  27 |     onBackdropClick()
  28 |   } catch (e: any) {
> 29 |     console.error(e)
     |     ^
  30 |     errorMessageDispatch({
  31 |       type: 'set',
  32 |       errorMessage: { text: e.message, code: e.status || 0 },

Check failure on line 27 in app/fragments/app-organization-card/src/organization-card.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'organizationId' is assigned a value but never used.

'organizationId' is assigned a value but never used.
Raw output
  24 | export const OrganizationCard: FC<OrganizationCardProps> = memo(({ organizationData }) => {
  25 |   const {
> 26 |     id: organizationId,
     |         ^
  27 |     name: organizationTitle,
  28 |     description: organizationDescription,
  29 |     membersWithRole: { totalCount: membersCount },

Check failure on line 14 in app/fragments/app-organization-card-grid/src/get-organizations-data.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(arrow-body-style): Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.
Raw output
  11 |   const token = getTokenCookie(document)
  12 |
> 13 |   const getOrganizationsDataPromise = () => {
     |                                             ^
  14 |     return new Promise(async (resolve, reject) => {
  15 |       try {
  16 |         const client = octokitGraphqlClient(token)

Check failure on line 15 in app/fragments/app-organization-card-grid/src/get-organizations-data.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-async-promise-executor): Promise executor functions should not be async.

Promise executor functions should not be async.
Raw output
  12 |
  13 |   const getOrganizationsDataPromise = () => {
> 14 |     return new Promise(async (resolve, reject) => {
     |                        ^
  15 |       try {
  16 |         const client = octokitGraphqlClient(token)
  17 |         const response = (await client(GET_VIEWER_ORGANIZATIONS, {

Check warning on line 31 in app/fragments/app-organization-card-grid/src/get-organizations-data.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  28 |         resolve(nodes)
  29 |       } catch (e: any) {
> 30 |         console.error(e)
     |         ^
  31 |         errorMessageDispatch({
  32 |           type: 'set',
  33 |           errorMessage: { text: e.message, code: e.status || 0 },

Check failure on line 20 in app/fragments/app-organization-card-grid/src/organization-card-grid.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(@typescript-eslint/no-unused-vars): 'OrganizationCardGridProps' is defined but never used.

'OrganizationCardGridProps' is defined but never used.
Raw output
  17 | import { ThemeType }                   from '@ui/theme'
  18 |
> 19 | import { OrganizationCardGridProps }   from './organization-card-grid.interfaces.js'
     |          ^
  20 | import { getOrganizationsData }        from './get-organizations-data.hook.js'
  21 |
  22 | export const OrganizationCardGrid: FC<PropsWithChildren> = memo(({ children }) => {

Check failure on line 29 in app/fragments/app-organization-card-grid/src/organization-card-grid.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(consistent-return): Expected to return a value at the end of arrow function.

Expected to return a value at the end of arrow function.
Raw output
  26 |   const errorMessageDispatch = useContext(ErrorMessageDispatchContext) as VoindFunction
  27 |
> 28 |   useEffect(() => {
     |                ^
  29 |     if (!organizationsData.length) {
  30 |       return getOrganizationsData({
  31 |         setOrganizationsData,

Check failure on line 36 in app/fragments/app-organization-card-grid/src/organization-card-grid.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(react-hooks/exhaustive-deps): React Hook useEffect has missing dependencies: 'errorMessageDispatch' and 'organizationsData.length'. Either include them or remove the dependency array.

React Hook useEffect has missing dependencies: 'errorMessageDispatch' and 'organizationsData.length'. Either include them or remove the dependency array.
Raw output
  33 |       })
  34 |     }
> 35 |   }, [])
     |      ^
  36 |
  37 |   return (
  38 |     <GridAutoRows rowHeight='auto' columns={theme.spaces.s2} maxColumnWidth={theme.spaces.hardcore}>

Check failure on line 10 in app/fragments/app-root-layout/src/root-layout.client.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(arrow-body-style): Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.
Raw output
   7 | import { ThemeProvider }        from '@ui/theme'
   8 |
>  9 | export const RootLayoutClient = ({ children, messages }) => {
     |                                                             ^
  10 |   return (
  11 |     <html>
  12 |       <body>

Check failure on line 16 in app/fragments/app-users-modal/src/get-organization-members.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-async-promise-executor): Promise executor functions should not be async.

Promise executor functions should not be async.
Raw output
  13 |
  14 |   const getOrganizationPromise = () =>
> 15 |     new Promise(async (resolve, reject) => {
     |                 ^
  16 |       const client = octokitGraphqlClient(token)
  17 |
  18 |       try {

Check warning on line 33 in app/fragments/app-users-modal/src/get-organization-members.hook.ts

See this annotation in the file changed.

@github-actions github-actions / Lint

(no-console): Unexpected console statement.

Unexpected console statement.
Raw output
  30 |         resolve(membersData)
  31 |       } catch (e: any) {
> 32 |         console.error(e)
     |         ^
  33 |         errorMessageDispatch({
  34 |           type: 'set',
  35 |           errorMessage: { text: e.message, code: e.status || 0 },

Check failure on line 63 in app/fragments/app-users-modal/src/users-modal.component.tsx

See this annotation in the file changed.

@github-actions github-actions / Lint

(react-hooks/exhaustive-deps): React Hook useEffect has missing dependencies: 'errorMessageDispatch', 'initMembersCount', 'membersData', and 'organizationId'. Either include them or remove the dependency array.

React Hook useEffect has missing dependencies: 'errorMessageDispatch', 'initMembersCount', 'membersData', and 'organizationId'. Either include them or remove the dependency array.
Raw output
  60 |       })
  61 |     }
> 62 |   }, [open])
     |      ^
  63 |
  64 |   const handlerRemoveMemberClick = (removeMemberLogin: string) =>
  65 |     removeMemberHook({ organizationLogin, membersData, setMembersData, removeMemberLogin })