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

Feat/users page #42

Merged
merged 103 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
41aa006
fix(base-layout): add horizontal paddings
kirill-ivanovvv Jul 26, 2024
9f6c9b8
feat(layout): add breakpoints; add styles to grids with that blabla
kirill-ivanovvv Jul 26, 2024
bd5fd31
refactor: organizations and members namings
kirill-ivanovvv Jul 26, 2024
27d9057
draft(member-card): layout in process
kirill-ivanovvv Jul 26, 2024
beec3ab
feat(member-cards-grid): get member; filter unique
kirill-ivanovvv Jul 26, 2024
8290a96
refactor(org-card): package rename
kirill-ivanovvv Jul 26, 2024
6197475
refactor(org-cards-grid): raname component; rename functions components
kirill-ivanovvv Jul 26, 2024
4252c05
refactor(members-page): move all login and data functions to fragment…
kirill-ivanovvv Jul 26, 2024
1048116
feat(queries): add getViewerAllOrganizationsAllMembers query
kirill-ivanovvv Jul 26, 2024
4b5928f
feat(cookie-helper): throw error if token not exist
kirill-ivanovvv Jul 26, 2024
3302d78
refactor(checkbox): remove logic from component
kirill-ivanovvv Jul 26, 2024
c2f1096
feat(ui/progress): create component
kirill-ivanovvv Jul 26, 2024
a1b9c2e
feat(theme/spaces): add params
kirill-ivanovvv Jul 26, 2024
248c5b8
yarn
kirill-ivanovvv Jul 26, 2024
6bcedf5
refactor: delete unused
kirill-ivanovvv Jul 27, 2024
af889b8
feat(icons): add timer icon color prop
kirill-ivanovvv Jul 27, 2024
d685a44
refactor: delete unused tags
kirill-ivanovvv Jul 27, 2024
a5634a4
refactor: delete unused
kirill-ivanovvv Jul 27, 2024
6be3c54
draft: member card layout WIP
kirill-ivanovvv Jul 27, 2024
c1bcf30
yarn
kirill-ivanovvv Jul 27, 2024
5bb4f21
fix(checkbox): change checked prop to defaultChecked, because client …
kirill-ivanovvv Jul 27, 2024
c33b74a
feat(member-cards-hook): write organizations data to state; link orga…
kirill-ivanovvv Jul 27, 2024
871c3a5
refactor(locales): added entries
kirill-ivanovvv Jul 27, 2024
8490258
refactor(base-layout): change paddings
kirill-ivanovvv Jul 27, 2024
c17023f
refactor(member-card): separate to sub-components mostly
kirill-ivanovvv Jul 27, 2024
16e60db
feat(member-cards-grid): provide organizaitons data to childst (needs…
kirill-ivanovvv Jul 27, 2024
e78d594
refactor(organizatoins-modal): rewrite component fully; rest hooks ne…
kirill-ivanovvv Jul 27, 2024
9dd1084
feat(get-viewer-all-organizations-all-members): add login and email f…
kirill-ivanovvv Jul 27, 2024
844a22b
feat(layout): add borderRadius prop to flex containers (row, column)
kirill-ivanovvv Jul 27, 2024
a09be05
feat(colors): add gray100 color
kirill-ivanovvv Jul 27, 2024
9f7b49b
feat(spaces): add super puper padding prop
kirill-ivanovvv Jul 27, 2024
8c57921
yarn
kirill-ivanovvv Jul 27, 2024
72028a8
refactor(env): change default organization name
kirill-ivanovvv Jul 28, 2024
5737987
refactor(invite-member-modal): interfaces
kirill-ivanovvv Jul 28, 2024
35a0efc
refactor(invite-member-modal): change env name; remove comment
kirill-ivanovvv Jul 28, 2024
af02804
feat(member-card): add progressbar percentage helper
kirill-ivanovvv Jul 28, 2024
95d81c6
refactor(member-card): interfaces mostly
kirill-ivanovvv Jul 28, 2024
3c951ca
refactor(member-cards): interfaces mostly
kirill-ivanovvv Jul 28, 2024
cd77916
refactor(org-cards-grid): interfaces mostly
kirill-ivanovvv Jul 28, 2024
22cf924
refactor(org-modal): interfaces mostly
kirill-ivanovvv Jul 28, 2024
e7a5978
feat(org-modal): add remove hook
kirill-ivanovvv Jul 28, 2024
5335a4e
fix(users-modal): change prop type to rest client; been incorrect
kirill-ivanovvv Jul 28, 2024
faf8893
refactor(org-page): change org-cards-grid component name
kirill-ivanovvv Jul 28, 2024
4513132
feat(globals/constants): add onbording condition names
kirill-ivanovvv Jul 28, 2024
5c324b3
graphqlcodegen
kirill-ivanovvv Jul 28, 2024
6bbdffb
refactor(query): rename all all query
kirill-ivanovvv Jul 28, 2024
9397d1f
refactor(env): change var name
kirill-ivanovvv Jul 28, 2024
8602eea
refactor(mail): separate constants; interfaces
kirill-ivanovvv Jul 28, 2024
0e8cf59
refactor(stores/select-input): remove unused deps
kirill-ivanovvv Jul 28, 2024
7182752
refactor(checkbox): remove unused
kirill-ivanovvv Jul 28, 2024
167e442
refactor(timer-icon): remove unused
kirill-ivanovvv Jul 28, 2024
32151ad
refactor(layout): grid-auto-rows interface
kirill-ivanovvv Jul 28, 2024
d2ee068
refactor(progress): interface
kirill-ivanovvv Jul 28, 2024
2ee73c8
feat(text): ass style prop
kirill-ivanovvv Jul 28, 2024
1982bcb
feat(colors): add black 40% opacity
kirill-ivanovvv Jul 28, 2024
d1c8ed7
yarn
kirill-ivanovvv Jul 28, 2024
feb4b61
draft(member-cards-grid): check gh-avatar
kirill-ivanovvv Jul 29, 2024
51aca7d
draft(member-cards-grid): get telegram group members
kirill-ivanovvv Jul 29, 2024
886dfd8
draft(member-cards-grid): get ongording data hook
kirill-ivanovvv Jul 29, 2024
a9eeb4b
yarn
kirill-ivanovvv Jul 29, 2024
451547e
fix: remove secret
kirill-ivanovvv Jul 29, 2024
81848c4
draft: third-party-data feature
kirill-ivanovvv Jul 30, 2024
55c7566
draft: get-discord-members WIP
kirill-ivanovvv Jul 30, 2024
bdd262f
refactor(env): change default org name
kirill-ivanovvv Jul 30, 2024
a34fb5f
feat(member-cards-grid): check is member in default organization
kirill-ivanovvv Jul 30, 2024
288ba06
feat(member-cards-grid): add members in default org array
kirill-ivanovvv Jul 30, 2024
a0664d8
refactor(member-cards-grid): separate onbording conditoin constants
kirill-ivanovvv Jul 30, 2024
4619285
refactor(progrss): absolute to text container on progress
kirill-ivanovvv Jul 30, 2024
dab349c
refactor(env): change org name for tests
kirill-ivanovvv Jul 30, 2024
807eed7
feat(member-cards-grid): check github 2fa
kirill-ivanovvv Jul 30, 2024
7dec170
feat(member-cards-grid): get users without 2fa
kirill-ivanovvv Jul 30, 2024
93956a5
fix(member-cards-grid): default 2fa to true
kirill-ivanovvv Jul 30, 2024
416b5b8
feat(queries): add gh2fa query
kirill-ivanovvv Jul 30, 2024
bc739a9
draft(discord-endpoint): api draft
kirill-ivanovvv Jul 30, 2024
7f49551
feat(env): add variables in env
kirill-ivanovvv Jul 30, 2024
3bad67c
feat(entrypoint): add discord packages
kirill-ivanovvv Jul 30, 2024
afbf228
refactor(globals): refactor
kirill-ivanovvv Jul 30, 2024
43ac940
yarn
kirill-ivanovvv Jul 30, 2024
0102dd6
refactor(onbording-condition-element): separate fragment
kirill-ivanovvv Jul 31, 2024
7a20dc7
draft(member-cards): WIP
kirill-ivanovvv Jul 31, 2024
5ce8946
yarn
kirill-ivanovvv Jul 31, 2024
1541557
refactor: remove unused
kirill-ivanovvv Jul 31, 2024
79f649b
refactor: interfaces mostly
kirill-ivanovvv Jul 31, 2024
4ed8699
refactor: change octokit interfaces
kirill-ivanovvv Aug 1, 2024
5e43ffe
refactor(member-cards): remove unused; separate consts
kirill-ivanovvv Aug 1, 2024
4fbc62c
refactor(octokit-graphql-client): change function-interface
kirill-ivanovvv Aug 1, 2024
42f1c76
refactor(octokit-rest): interfaces
kirill-ivanovvv Aug 1, 2024
a9b99b8
refactor(octokit-graphql): interfaces
kirill-ivanovvv Aug 1, 2024
54bc486
refactor(gh-api): move get token func to third party
kirill-ivanovvv Aug 1, 2024
a4a2603
refactor: ts
kirill-ivanovvv Aug 1, 2024
0165c21
fix: redirect if token not exist
kirill-ivanovvv Aug 1, 2024
331ca6a
feat(invite-member-modal): provide a toast to erro notify
kirill-ivanovvv Aug 1, 2024
d1d67a6
refactor(member-card): rename helpers to getters; interfaces
kirill-ivanovvv Aug 1, 2024
a367398
refactor(member-cards-grid): refactoring; devided into pieces; interf…
kirill-ivanovvv Aug 1, 2024
0c3ca71
refactor(onbording-condition-element): change forOfLoop to switch; in…
kirill-ivanovvv Aug 1, 2024
a2e4730
fix(organiations-modal); change getqueryinterfacename
kirill-ivanovvv Aug 1, 2024
8a8d699
feat(globals/constants): move condition constants from some component
kirill-ivanovvv Aug 1, 2024
9d49262
feat(globals/data): export onbording condition data type
kirill-ivanovvv Aug 1, 2024
ff7eb93
yarn
kirill-ivanovvv Aug 1, 2024
5acf777
refactor(globals): rename third-party to github-hooks
kirill-ivanovvv Aug 3, 2024
58c1c4a
refactor(member-card): interface fixes
kirill-ivanovvv Aug 3, 2024
36855a7
refactor(globals/constants): change ru comments to eng
kirill-ivanovvv Aug 3, 2024
7f1be29
yarn
kirill-ivanovvv Aug 3, 2024
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
6,589 changes: 3,377 additions & 3,212 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
packageExtensions:
'@emotion/utils@*':
dependencies:
'@emotion/sheet': '*'
'@atls-ui-parts/layout@*':
dependencies:
'@emotion/react': '*'
'@graphql-codegen/plugin-helpers@*':
dependencies:
'@graphql-tools/apollo-engine-loader': '8.0.1'
Expand Down
2 changes: 1 addition & 1 deletion app/api/github-auth-cookie/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
},
"main": "src/index.ts",
"dependencies": {
"@globals/data": "workspace:*"
"@globals/github-hooks": "workspace:*"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cookies } from 'next/headers'
// @ts-ignore:next-line
import { redirect } from 'next/navigation'

import { getGithubAuthToken } from '@globals/data'
import { getGithubAuthToken } from '@globals/github-hooks'

import { COOKIE_EXPIRES_WEEK } from './github-auth-cookie-handle.constants.js'
import { RU_MESSAGES } from './github-auth-cookie-handle.messages.js'
Expand Down
6 changes: 3 additions & 3 deletions app/entrypoints/renderer/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"add-member-to-organization-modal_input.placeholder": "Team member",
"organization-card_member.one": "member",
"organization-card_member.many": "members",
"confirm-deleting-organization.warning": "Вы уверены, что хотите исключить пользователя из данной организации?",
"confirm-deleting-organization.yes": "Да",
"confirm-deleting-organization.no": "Нет",
"remove-organization-request.text": "Вы уверены, что хотите исключить пользователя из данной организации?",
"yes": "Да",
"no": "Нет",
"logo-title": "Team management system",
"notifications-modal.title": "Уведомления",
"notifications-modal.mark-all-read": "Отметить все, как прочитанное",
Expand Down
13 changes: 11 additions & 2 deletions app/entrypoints/renderer/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,24 @@ export default {
compiler: {
styledComponents: true,
},
webpack: (webpackConfig, { webpack }) => {
webpack: (webpackConfig, { webpack, isServer }) => {
// в названии пакета есть ".js", поэтому меняю регекс
webpackConfig.plugins.push(
new webpack.NormalModuleReplacementPlugin(new RegExp(/\.js$/), function (
new webpack.NormalModuleReplacementPlugin(new RegExp(/^(\.{1,2}\/)+\S*\.js$/), function (
/** @type {{ request: string }} */
resource
) {
resource.request = resource.request.replace('.js', '')
})
)

// discord.js not resolve zLib-sync without it
// https://github.com/discordjs/discord.js/issues/9592
webpackConfig.module.rules.push({
test: /\.node$/,
loader: 'node-loader',
})

return webpackConfig
},
output: 'standalone',
Expand Down
5 changes: 3 additions & 2 deletions app/entrypoints/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
"@app/index-page": "workspace:*",
"@app/loading": "workspace:*",
"@app/logout-api": "workspace:*",
"@app/members-page": "workspace:*",
"@app/organizations-page": "workspace:*",
"@app/registration-page": "workspace:*",
"@app/root-layout": "workspace:*",
"@app/send-invite-mail-api": "workspace:*",
"@app/users-page": "workspace:*",
"@emotion/react": "11.11.4",
"@stores/toast-notification": "workspace:*",
"@types/node": "20.12.12",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@ui/theme": "workspace:*",
"next": "14.1.0",
"next": "14.2.5",
"node-loader": "2.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "5.2.2"
Expand Down
5 changes: 4 additions & 1 deletion app/entrypoints/renderer/src/.env
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
NEXT_PUBLIC_GH_CLIENT_ID="Ov23li9kGqtVre5AFIeA"
NEXT_PUBLIC_GH_CLIENT_SECRET="234d7e0689b3f86506133b082896aa95c6fdf341"
NEXT_PUBLIC_TOKEN_COOKIE_NAME='token'
NEXT_PUBLIC_INVITE_GITHUB_ORG_NAME='effectivnayarabota1-test-organization'
NEXT_PUBLIC_GITHUB_ORG_NAME='ssagg-test'
NEXT_PUBLIC_INVITE_FIGMA_URL='http://localhost:3000/figma'
NEXT_PUBLIC_INVITE_DISCORD_URL='http://localhost:3000/discord'
NEXT_PUBLIC_INVITE_TELEGRAM='http://localhost:3000/telegram'
SMTP_AUTH_HOST='smtp.ethereal.email'
SMTP_AUTH_PORT=587
SMTP_AUTH_USER='gonzalo20@ethereal.email'
SMTP_AUTH_PASS='d4P4DrQy9QtWuvCe8F'
NEXT_PUBLIC_DISCORD_API_TOKEN="MTI2NzQ5OTAyODg0NTgyNjEzMA.GcZinV.ZJfw4zfY9jTbjFNNMaYdcOxjfKLGuS2ZvmRMeI"
NEXT_PUBLIC_DISCORD_GUILD_ID="1267841184915521570"
WS_NO_BUFFER_UTIL=true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@app/members-page'
1 change: 0 additions & 1 deletion app/entrypoints/renderer/src/app/(dashboard)/users/page.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/entrypoints/renderer/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export const middleware = (request: NextRequest) => {
}

export const config = {
matcher: ['/organizations', '/users'],
matcher: ['/organizations', '/members'],
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { OrganizationTeamType } from '@globals/data'
import type { OrganizationMemberType } from '@globals/data'
import type { OrganizationMemberDataType } from '@globals/data'

import { useTheme } from '@emotion/react'

Expand Down Expand Up @@ -36,7 +36,7 @@ export const AddMemberToOrganizationModal: FC<AddMemberToOrganizationModalProps>
const theme = useTheme() as ThemeType

const [inviteButtonState, setInviteButtonState] = useState<InviteButtonStateType>('disabled')
const [selectedUsers, setSelectedUsers] = useState<Array<OrganizationMemberType>>([])
const [selectedUsers, setSelectedUsers] = useState<Array<OrganizationMemberDataType>>([])
const [selectedTeams, setSelectedTeams] = useState<Array<OrganizationTeamType>>([])
const [teamsData, setTeamsData] = useState<Array<OrganizationTeamType>>([])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { Dispatch } from 'react'
import { SetStateAction } from 'react'

export type GithubUserSearchType = {
setSelectedUsersParentHook: Dispatch<SetStateAction<never[]>>
setSelectedUsersParentHook: Dispatch<SetStateAction<any>>
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { SEARCH_USER } from '@globals/data'
import { SearchUserQuery } from '@globals/data'
import { octokitGraphqlClient } from '@globals/data'
import { getTokenCookie } from '@globals/helpers'
import { SEARCH_USER } from '@globals/data'
import { SearchUserQuery } from '@globals/data'
import { requestOctokitGraphqlData } from '@globals/data'

import { SEARCH_USERS_LIMIT } from '../github-users-search.constants.js'
import { SEARCH_USERS_LIMIT } from '../github-users-search.constants.js'

export const getSearchedUsers = async ({ searchQuery, toast }) => {
const token = getTokenCookie(document)
const client = octokitGraphqlClient(token)

try {
const response = (await client(SEARCH_USER, {
const response = (await requestOctokitGraphqlData(document, SEARCH_USER, {
searchLimit: SEARCH_USERS_LIMIT,
searchQuery,
})) as SearchUserQuery
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { GET_ORGANIZATION_TEAMS } from '@globals/data'
import { GetOrganizationTeamsQuery } from '@globals/data'
import { OrganizationTeamType } from '@globals/data'
import { octokitGraphqlClient } from '@globals/data'
import { getTokenCookie } from '@globals/helpers'
import { requestOctokitGraphqlData } from '@globals/data'

import { ORGANIZATION_TEAMS_LIMIT } from '../add-member-to-organization-modal.constants.js'
import { GetOrganizationTeamsType } from './get-organization-teams.interface.js'
Expand All @@ -13,13 +11,10 @@ export const getOrganizatoinTeamsHook: GetOrganizationTeamsType = async ({
toast,
}) => {
try {
const token = getTokenCookie(document)
const client = octokitGraphqlClient(token)

const response = (await client(GET_ORGANIZATION_TEAMS, {
const response = await requestOctokitGraphqlData(document, GET_ORGANIZATION_TEAMS, {
organizationId,
organizationTeamsLimit: ORGANIZATION_TEAMS_LIMIT,
})) as GetOrganizationTeamsQuery
})

if (response && response.node && 'teams' in response.node) {
const {
Expand All @@ -28,7 +23,7 @@ export const getOrganizatoinTeamsHook: GetOrganizationTeamsType = async ({
},
} = response

setTeamsData(teamsData as OrganizationTeamType)
setTeamsData(teamsData as Array<OrganizationTeamType>)
}
} catch (e: any) {
// eslint-disable-next-line no-console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export type GetOrganizationTeamsType = ({
toast,
}: {
organizationId: string
setTeamsData: (teamsData: OrganizationTeamType) => void
setTeamsData: (teamsData: Array<OrganizationTeamType>) => void
toast: ToastType
}) => void
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { InviteButtonClickType } from './invite-button-click.interface.js'
import type { InviteButtonClickType } from './invite-button-click.interface.js'

import { inviteMemberToOrganizationQuery } from '@globals/data'
import { createOctokitRestClient } from '@globals/data'
import { getTokenCookie } from '@globals/helpers'
import { inviteMemberToOrganizationGetQuery } from '@globals/data'
import { requestOctokitRestData } from '@globals/data'

export const inviteButtonClickHook: InviteButtonClickType = async ({
organizationLogin,
Expand All @@ -11,20 +10,17 @@ export const inviteButtonClickHook: InviteButtonClickType = async ({
selectedUsers,
setInviteButtonState,
}) => {
const token = getTokenCookie(document)

try {
const restClient = createOctokitRestClient(token)
for await (const selectedUser of selectedUsers) {
const { githubUserId } = selectedUser
const { id: githubUserId } = selectedUser

const query = inviteMemberToOrganizationQuery({
const query = inviteMemberToOrganizationGetQuery({
organizationLogin,
githubUserId,
teamIds: selectedTeams,
}) as [any]
})

await restClient(...query)
await requestOctokitRestData(document, query)
}

setInviteButtonState('successed')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { OrganizationTeamType } from '@globals/data'
import type { OrganizationMemberType } from '@globals/data'
import type { ToastType } from '@stores/toast-notification'
import type { OrganizationMemberDataType } from '@globals/data'
import type { ToastType } from '@stores/toast-notification'

export type InviteButtonClickType = ({
organizationLogin,
Expand All @@ -10,8 +9,8 @@ export type InviteButtonClickType = ({
setInviteButtonState,
}: {
organizationLogin: string
selectedTeams: Array<OrganizationTeamType>
selectedTeams: string
toast: ToastType
selectedUsers: Array<OrganizationMemberType>
selectedUsers: Array<OrganizationMemberDataType>
setInviteButtonState: (state: string) => void
}) => void
31 changes: 0 additions & 31 deletions app/fragments/app-animated-card/package.json

This file was deleted.

89 changes: 0 additions & 89 deletions app/fragments/app-animated-card/src/animated-card.component.tsx

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion app/fragments/app-animated-card/src/index.ts

This file was deleted.

1 change: 1 addition & 0 deletions app/fragments/app-base-layout/src/base-layout.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const BaseLayoutClient: FC<PropsWithChildren<BaseLayoutProps>> = ({
maxWidth={theme.spaces.extraSuperLarge}
margin={theme.spaces.horizontalAutoMargin}
gap={theme.spaces.large}
padding={theme.spaces.t0h24b128}
justifyContent='flex-start'
alignItems='flex-start'
>
Expand Down
Loading