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

fix: checks #49

Draft
wants to merge 79 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
9bf021e
feat(mobile): add test expo app
aliceinapple Jan 28, 2025
8170989
refactor(mobile): remove unnecessary files
aliceinapple Jan 28, 2025
2055ebe
chore(mobile): update dependencies
aliceinapple Jan 28, 2025
d1427b2
feat(mobile): add test sign-in screen
aliceinapple Jan 30, 2025
97d112d
chore(mobile): install dependencies
aliceinapple Jan 31, 2025
a99cad8
feat(mobile): add app screens
aliceinapple Jan 31, 2025
f5a942f
feat(common): update dependencies
aliceinapple Feb 4, 2025
21799d4
feat(mobile): add ui layout
aliceinapple Feb 5, 2025
6009f07
chore(mobile): update dependencies
aliceinapple Feb 5, 2025
8572490
chore(mobile): update project structure
aliceinapple Feb 6, 2025
adfa39b
feat(mobile): update project structure
aliceinapple Feb 7, 2025
df044c3
feat(mobile): update screens
aliceinapple Feb 7, 2025
47f9d11
chore(mobile): add mobile to workspaces
aliceinapple Feb 10, 2025
6619e4b
chore(mobile): run formatting
aliceinapple Feb 10, 2025
778db99
feat(common): add mobile to workspaces
aliceinapple Feb 12, 2025
dcd793b
refactor(mobile): structure
aliceinapple Feb 12, 2025
be0cc37
feat(mobile): update metro config
aliceinapple Feb 12, 2025
855a240
feat(mobile): update package.json
aliceinapple Feb 12, 2025
73fd658
feat(mobile): update metro.config.js
aliceinapple Feb 12, 2025
2b8c1b4
chore(common): change packages name
aliceinapple Feb 14, 2025
5e39377
chore(mobile): add exports
aliceinapple Feb 14, 2025
57adef0
chore(mobile): update tsconfig
aliceinapple Feb 14, 2025
0af3199
chore(mobile): update metro config
aliceinapple Feb 14, 2025
a4d8a51
chore(common): remove cache
aliceinapple Feb 14, 2025
722e1bd
chore(mobile): update tsconfig
aliceinapple Feb 14, 2025
4724964
chore(common): get updates
aliceinapple Feb 17, 2025
44ccb00
refactor(common): move ui-mobile to project root
aliceinapple Feb 19, 2025
4b8143b
fix(ui): theme types
aliceinapple Feb 18, 2025
e23506b
fix(ui): image component types
aliceinapple Feb 19, 2025
6cd906c
fix(ui): divider component types
aliceinapple Feb 19, 2025
a78bbda
fix(stores): select-input
aliceinapple Feb 19, 2025
87687d5
fix(ui): input component
aliceinapple Feb 19, 2025
11f32a1
fix(ui): layout
aliceinapple Feb 20, 2025
790fb79
fix(ui): modal
aliceinapple Feb 20, 2025
e93a42b
chore(common): run format
aliceinapple Feb 20, 2025
7c20e42
chore(common): update dependencies
aliceinapple Feb 20, 2025
1523d0e
fix(ui): sidebar component
aliceinapple Feb 20, 2025
d97a83d
fix(globals): client-cookie helper
aliceinapple Feb 20, 2025
23a196d
fix(ui): toast-notification hook
aliceinapple Feb 20, 2025
b0490ac
chore(common): run format
aliceinapple Feb 20, 2025
bfba11f
fix(common): run lint errors
aliceinapple Feb 21, 2025
b61397d
fix(stores): toast-notification types
aliceinapple Feb 24, 2025
adfccd4
fix(app): app-base-layout fragment types
aliceinapple Feb 24, 2025
c9a5c81
fix(app): app-invite-member-modal fragment types
aliceinapple Feb 24, 2025
fdef7f5
fix(app): app-member-card fragment types
aliceinapple Feb 24, 2025
8357677
fix(app): app-member-cards-grid fragment types
aliceinapple Feb 24, 2025
4ef7b41
fix(app): app-organizations-modal fragment types
aliceinapple Feb 24, 2025
ac70889
fix(app): app-root-layout fragment types
aliceinapple Feb 24, 2025
2db4914
fix(app): app-add-member-to-organization-modal fragment types
aliceinapple Feb 24, 2025
6a6a69a
chore(common): run format
aliceinapple Feb 24, 2025
f78d7d3
fix(ui): avatar lint errors
aliceinapple Feb 25, 2025
7798063
fix(ui): checkbox lint errors
aliceinapple Feb 25, 2025
e7e715f
fix(ui): dropdown lint errors
aliceinapple Feb 25, 2025
99c91c9
fix(ui): image lint errors
aliceinapple Feb 25, 2025
67ddd50
fix(ui): button lint errors
aliceinapple Mar 3, 2025
36b0d5d
fix(ui): icons lint errors
aliceinapple Mar 3, 2025
8b98721
fix(ui): input lint errors
aliceinapple Mar 3, 2025
d288c96
fix(ui): layout lint errors
aliceinapple Mar 3, 2025
b1d78f3
fix(ui): modal lint errors
aliceinapple Mar 3, 2025
9143b5c
fix(ui): preloader lint errors
aliceinapple Mar 3, 2025
8645341
fix(ui): sidebar lint errors
aliceinapple Mar 3, 2025
dfd0944
fix(ui): switch lint errors
aliceinapple Mar 3, 2025
1af7149
fix(ui): theme lint errors
aliceinapple Mar 3, 2025
7ed21df
fix(ui): toast-notification lint errors
aliceinapple Mar 3, 2025
963bde1
fix(ui): utils lint errors
aliceinapple Mar 3, 2025
7c07699
fix(stores): stores lint errors
aliceinapple Mar 3, 2025
5f210da
fix(common): ui-mobile and globals lint errors
aliceinapple Mar 3, 2025
d3ba6e5
fix(globals): mail lint errors
aliceinapple Mar 3, 2025
dccc822
fix(globals): helpers lint errors
aliceinapple Mar 3, 2025
fc5c61d
fix(ui): switch component
aliceinapple Mar 4, 2025
c521b1c
fix(common): types and lint errors
aliceinapple Mar 4, 2025
f8e0a3e
fix(globals): github-hooks
aliceinapple Mar 4, 2025
b361b65
fix(app): index-page
aliceinapple Mar 4, 2025
d64e0ee
fix(app): entrypoints
aliceinapple Mar 4, 2025
a70b6f8
fix(globals): mail lint errors
aliceinapple Mar 5, 2025
f5ab960
fix(globals): globals lint errors
aliceinapple Mar 5, 2025
39149c0
fix(mobile): mobile lint errors
aliceinapple Mar 5, 2025
0373548
fix(app): app-base-layout lint errors
aliceinapple Mar 5, 2025
97ea311
fix(app): app-invite-button lint errors
aliceinapple Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8,469 changes: 2,476 additions & 5,993 deletions .pnp.cjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// @ts-ignore:next-line
/* eslint-disable */

// @ts-expect-error:next-line
import { cookies } from 'next/headers'
// @ts-ignore:next-line
// @ts-expect-error:next-line
import { redirect } from 'next/navigation'

import { getGithubAuthToken } from '@globals/github-hooks'
Expand All @@ -21,11 +23,10 @@ export async function githubAuthCookieHandle(request: Request) {
const TOKEN = await getGithubAuthToken(CODE)

const TOKEN_COOKIE_NAME = process.env.NEXT_PUBLIC_TOKEN_COOKIE_NAME
cookies().set(TOKEN_COOKIE_NAME as string, TOKEN, {
cookies().set(TOKEN_COOKIE_NAME!, TOKEN, {
expires: Date.now() + COOKIE_EXPIRES_WEEK,
})
} catch (e: any) {
// eslint-disable-next-line no-console
console.error(e)
REGISTRATION_URL.searchParams.set('errorMessage', RU_MESSAGES.tokenError)
return redirect(REGISTRATION_URL.href)
Expand Down
6 changes: 4 additions & 2 deletions app/api/logout/src/logout.api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// @ts-ignore:next-line
/* eslint-disable */

// @ts-expect-error:next-line
import { cookies } from 'next/headers'
// @ts-ignore:next-line
// @ts-expect-error:next-line
import { redirect } from 'next/navigation'

export const logoutHandle = (request: Request) => {
Expand Down
9 changes: 6 additions & 3 deletions app/api/send-invite-mail/src/send-invite-mail.api.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { sendInviteMail } from '@globals/mail'
import type { InviteMailData } from './send-invite-mail.interfaces.js'

export const sendInviteMailHandle = async (request: Request) => {
const json = await request.json()
import { sendInviteMail } from '@globals/mail'

export const sendInviteMailHandle = async (request: Request): Promise<Response> => {
const json: InviteMailData = await request.json()
try {
const mailInfo = await sendInviteMail(json)
const data = JSON.stringify(mailInfo)
return Response.json(data)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
return new Response(`Send mail error: ${e.message}`, {
status: e.status || e.responseCode || 400,
Expand Down
4 changes: 4 additions & 0 deletions app/api/send-invite-mail/src/send-invite-mail.interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface InviteMailData {
emails: Array<string>
selectedInvites: Array<string>
}
16 changes: 8 additions & 8 deletions app/entrypoints/renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{

Check failure on line 1 in app/entrypoints/renderer/package.json

View workflow job for this annotation

GitHub Actions / Release

Error release workspace @app/renderer-entrypoint

Exit code 1
Raw output
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

  ▲ Next.js 14.2.24
  - Environments: .env
  - Experiments (use with caution):
    · externalDir
    · esmExternals
    · outputFileTracingRoot

   Creating an optimized production build ...
 ✓ Compiled successfully
   Checking validity of types ...

 ⚠ Linting is disabled.
Failed to compile.

../../../../.yarn/__virtual__/@app-member-cards-grid-virtual-207583b7cc/1/app/fragments/app-member-cards-grid/src/hooks/helpers/get-unique-items.helper.ts:6:8
Type error: Type 'IterableIterator<any>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.

  4 |   const filterKey = 'id'
  5 |   const uniqueDataArray = [
> 6 |     ...new Map(allDataArray.map((allDataItem) => [allDataItem[filterKey], allDataItem])).values(),
    |        ^
  7 |   ]
  8 |   return uniqueDataArray
  9 | }
Next.js build worker exited with code: 1 and signal: null
cp: cannot stat './src/.next/standalone': No such file or directory
"name": "@app/renderer-entrypoint",
"version": "0.0.1",
"license": "BSD-3-Clause",
Expand All @@ -10,8 +10,8 @@
"start": "node dist/src/index.cjs"
},
"dependencies": {
"graphql": "16.8.2",
"react-intl": "6.6.8"
"graphql": "16.10.0",
"react-intl": "6.8.9"
},
"devDependencies": {
"@app/base-layout": "workspace:*",
Expand All @@ -24,14 +24,14 @@
"@app/registration-page": "workspace:*",
"@app/root-layout": "workspace:*",
"@app/send-invite-mail-api": "workspace:*",
"@emotion/react": "11.11.4",
"@emotion/react": "11.14.0",
"@stores/toast-notification": "workspace:*",
"@types/node": "20.12.12",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/node": "20.17.19",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"@ui/theme": "workspace:*",
"next": "14.2.5",
"node-loader": "2.0.0",
"next": "14.2.24",
"node-loader": "2.1.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "5.2.2"
Expand Down
12 changes: 7 additions & 5 deletions app/entrypoints/renderer/src/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* eslint-disable */

import React from 'react'
import { Suspense } from 'react'
import { FC } from 'react'
import { PropsWithChildren } from 'react'
import { Suspense } from 'react'
import React from 'react'

import { BaseLayout } from '@app/base-layout'
import { Loading } from '@app/loading'
import { BaseLayout } from '@app/base-layout'
import { Loading } from '@app/loading'

const Layout = ({ children }) => (
const Layout: FC<PropsWithChildren> = ({ children }) => (
<Suspense fallback={<Loading />}>
{/* @ts-expect-error Async Server Component */}
<BaseLayout children={children} />
Expand Down
8 changes: 4 additions & 4 deletions app/entrypoints/renderer/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// @ts-ignore:next-line
// @ts-expect-error:next-line
import type { NextRequest } from 'next/server'

// @ts-ignore:next-line
// @ts-expect-error:next-line
import { NextResponse } from 'next/server'

export const middleware = (request: NextRequest) => {
const TOKEN_COOKIE_NAME = process.env.NEXT_PUBLIC_TOKEN_COOKIE_NAME as string
export const middleware = (request: NextRequest): NextResponse => {
const TOKEN_COOKIE_NAME = process.env.NEXT_PUBLIC_TOKEN_COOKIE_NAME || ''
if (!request.cookies.has(TOKEN_COOKIE_NAME)) {
return NextResponse.redirect(new URL('/registration', request.url))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"@ui/theme": "workspace:*"
},
"devDependencies": {
"@emotion/react": "11.11.4",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@emotion/react": "11.14.0",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-intl": "6.6.8"
"react-intl": "6.8.9"
},
"peerDependencies": {
"@stores/select-input": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import type { OrganizationTeamType } from '@globals/data'
import type { OrganizationMemberDataType } from '@globals/data'
import type { InviteButtonStateType } from '@app/invite-button'
import type { OrganizationTeamType } from '@globals/data'
import type { OrganizationMemberDataType } from '@globals/data'
import type { ThemeType } from '@ui/theme'
import type { FC } from 'react'

import { useTheme } from '@emotion/react'
import type { AddMemberToOrganizationModalProps } from './add-member-to-organization-modal.interfaces.js'

import React from 'react'
import { FC } from 'react'
import { FormattedMessage } from 'react-intl'
import { memo } from 'react'
import { useState } from 'react'
import { FormattedMessage } from 'react-intl'
import { memo } from 'react'
import { useState } from 'react'
import React from 'react'

import { InviteButtonStateType } from '@app/invite-button'
import { InviteButton } from '@app/invite-button'
import { SelectInputProvider } from '@stores/select-input'
import { Row } from '@ui/layout'
import { Column } from '@ui/layout'
import { Modal } from '@ui/modal'
import { Text } from '@ui/text'
import { ThemeType } from '@ui/theme'
import { useToast } from '@stores/toast-notification'
import { InviteButton } from '@app/invite-button'
import { SelectInputProvider } from '@stores/select-input'
import { Row } from '@ui/layout'
import { Column } from '@ui/layout'
import { Modal } from '@ui/modal'
import { Text } from '@ui/text'
import { useTheme } from '@emotion/react'
import { useToast } from '@stores/toast-notification'

import { AddMemberToOrganizationHook } from './add-member-to-organization-modal.hook.js'
import { AddMemberToOrganizationModalProps } from './add-member-to-organization-modal.interfaces.js'
import { GithubUsersSearch } from './github-users-search/index.js'
import { TeamSwitch } from './team-switch/index.js'
import { AddMemberToOrganizationHook } from './add-member-to-organization-modal.hook.js'
import { GithubUsersSearch } from './github-users-search/index.js'
import { TeamSwitch } from './team-switch/index.js'

export const AddMemberToOrganizationModal: FC<AddMemberToOrganizationModalProps> = memo(({
open,
Expand Down Expand Up @@ -73,7 +73,12 @@ export const AddMemberToOrganizationModal: FC<AddMemberToOrganizationModalProps>
<FormattedMessage id='add-member-to-organization-modal.teams' />
</Text>
{teamsData.map(({ databaseId: teamId, name: teamName }) => (
<TeamSwitch teamName={teamName} onChange={(e) => switchHandler(e, teamId)} />
<TeamSwitch
teamName={teamName}
onChange={(e) => {
switchHandler(e, teamId)
}}
/>
))}
</Row>
<Row justifyContent='end'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { useEffect } from 'react'
import type { ChangeEvent } from 'react'

import { inviteButtonClickHook } from './hooks/index.js'
import { getOrganizatoinTeamsHook } from './hooks/index.js'
import { setButtonActiveHook } from './hooks/index.js'
import type { AddMemberToOrganizationHookProps } from './add-member-to-organization-modal.interfaces.js'

import { useEffect } from 'react'

import { inviteButtonClickHook } from './hooks/index.js'
import { getOrganizatoinTeamsHook } from './hooks/index.js'
import { setButtonActiveHook } from './hooks/index.js'

export const AddMemberToOrganizationHook = ({
open,
Expand All @@ -16,7 +20,7 @@ export const AddMemberToOrganizationHook = ({
setInviteButtonState,
selectedTeams,
setSelectedTeams,
}) => {
}: AddMemberToOrganizationHookProps) => {
useEffect(() => {
if (open && !teamsData.length) {
getOrganizatoinTeamsHook({
Expand All @@ -27,27 +31,27 @@ export const AddMemberToOrganizationHook = ({
}
}, [open, toast, organizationId, teamsData, setTeamsData])

useEffect(
() => setButtonActiveHook({ inviteButtonState, selectedUsers, setInviteButtonState }),
[selectedUsers, inviteButtonState, setInviteButtonState]
)
useEffect(() => {
setButtonActiveHook({ inviteButtonState, selectedUsers, setInviteButtonState })
}, [selectedUsers, inviteButtonState, setInviteButtonState])

const switchHandler = (e, teamId) => {
const switchHandler = (e: ChangeEvent<HTMLInputElement>, teamId: number | null | undefined) => {
if (selectedTeams.includes(teamId as never)) {
setSelectedTeams(selectedTeams.filter((c) => c !== (teamId as never)))
} else {
setSelectedTeams(selectedTeams.concat([teamId as never]))
}
}

const inviteButtonClickHandler = () =>
const inviteButtonClickHandler = () => {
inviteButtonClickHook({
organizationLogin,
selectedTeams,
toast,
selectedUsers,
setInviteButtonState,
})
}

return {
switchHandler,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import type { OrganizationDataType } from '@globals/data'
import type { InviteButtonStateType } from '@app/invite-button'
import type { OrganizationDataType } from '@globals/data'
import type { OrganizationMemberDataType } from '@globals/data'
import type { OrganizationTeamType } from '@globals/data'
import type { ToastType } from '@stores/toast-notification'
import type { Dispatch } from 'react'
import type { SetStateAction } from 'react'

import { AddMemberToOrganizationHook } from './add-member-to-organization-modal.hook.js'

export interface AddMemberToOrganizationModalProps {
open: boolean
Expand All @@ -16,3 +24,17 @@ export type UseButtonActiveHookType = (
checkedSwitches: CheckedSwitchesType,
setButtonActive: Function
) => void

export interface AddMemberToOrganizationHookProps {
open: boolean
toast: ToastType
organizationId: string
organizationLogin: string
teamsData: Array<OrganizationTeamType>
setTeamsData: (teamsData: Array<OrganizationTeamType>) => void
selectedUsers: Array<OrganizationMemberDataType>
inviteButtonState: InviteButtonStateType
setInviteButtonState: Dispatch<SetStateAction<InviteButtonStateType>>
selectedTeams: Array<OrganizationTeamType>
setSelectedTeams: (selectedTeams: Array<OrganizationTeamType>) => void
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import React from 'react'
import { FC } from 'react'
import { useState } from 'react'
import { useEffect } from 'react'
import { useIntl } from 'react-intl'
import type { FC } from 'react'

import { SelectInput } from '@ui/input'
import { useSelectInput } from '@stores/select-input'
import { useToast } from '@stores/toast-notification'
import type { GithubUserSearchType } from './github-users-search.interface.js'

import { GithubUserSearchType } from './github-users-search.interface.js'
import { getSearchedUsers } from './hooks/index.js'
import { inputChangeHook } from './hooks/index.js'
import { useState } from 'react'
import { useEffect } from 'react'
import { useIntl } from 'react-intl'
import React from 'react'

import { SelectInput } from '@ui/input'
import { useSelectInput } from '@stores/select-input'
import { useToast } from '@stores/toast-notification'

import { getSearchedUsers } from './hooks/index.js'
import { inputChangeHook } from './hooks/index.js'

export const GithubUsersSearch: FC<GithubUserSearchType> = ({ setSelectedUsersParentHook }) => {
const { formatMessage } = useIntl()
const toast = useToast
const toast = useToast()

const [isClientTyping, setClientTyping] = useState<boolean>(false)
const [activeSearchTimeoutId, setActiveSearchTimeoutId] = useState<number>(0)
Expand All @@ -33,7 +35,6 @@ export const GithubUsersSearch: FC<GithubUserSearchType> = ({ setSelectedUsersPa
activeSearchTimeoutId,
setActiveSearchTimeoutId,
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [inputValue])

useEffect(() => {
Expand All @@ -47,7 +48,6 @@ export const GithubUsersSearch: FC<GithubUserSearchType> = ({ setSelectedUsersPa
} else if (!inputValue.length) {
cleanSuggestedItems()
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isClientTyping])

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Dispatch } from 'react'
import { SetStateAction } from 'react'
import type { Dispatch } from 'react'
import type { SetStateAction } from 'react'

export type GithubUserSearchType = {
setSelectedUsersParentHook: Dispatch<SetStateAction<any>>
Expand Down
Loading
Loading