Skip to content

Commit

Permalink
Merge branch 'main' into design-review-fixes-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
yasell committed Jan 21, 2025
2 parents b9fe9e5 + fe77bbf commit 95eca42
Show file tree
Hide file tree
Showing 231 changed files with 20,865 additions and 18,968 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
- uses: pnpm/action-setup@v4
- run: pnpm deps
- run: pnpm build
- run: pnpm lint

Prettier:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { FC, PropsWithChildren } from 'react'
import { Route } from 'react-router-dom'

import { ProjectSettingsPage } from '@harnessio/ui/views'

import RootViewWrapper from './root-view-wrapper'

const Layout = () => {
return (
<div className="bg-background-1 sticky top-[55px] z-40">
<ProjectSettingsPage />
</div>
)
}

export const ProjectSettingsWrapper: FC<PropsWithChildren<unknown>> = ({ children }) => {
return (
<>
<RootViewWrapper asChild>
<Route
path="*"
element={
<>
<Layout />
{children}
</>
}
/>
</RootViewWrapper>
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { FC, PropsWithChildren, useCallback } from 'react'
import { Route } from 'react-router-dom'

import { pullRequestStore } from '@subjects/views/pull-request-conversation/pull-request-store'
import { useTranslationsStore } from '@utils/viewUtils'

import { PullRequestLayout } from '@harnessio/ui/views'

import RootViewWrapper from './root-view-wrapper'

const PullRequestLayoutWrapper: FC<PropsWithChildren<unknown>> = ({ children }) => {
const usePullRequestStore = useCallback(
() => ({
...pullRequestStore
}),
[]
)
return (
<RootViewWrapper asChild>
<Route
path="*"
element={
<PullRequestLayout
useTranslationStore={useTranslationsStore}
usePullRequestStore={usePullRequestStore}
spaceId={''}
repoId={''}
updateTitle={() => {
return Promise.resolve()
}}
/>
}
>
<Route path="*" element={children} />
</Route>
</RootViewWrapper>
)
}

export default PullRequestLayoutWrapper
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { FC, PropsWithChildren } from 'react'
import { Route, Routes } from 'react-router-dom'

import { useTranslationsStore } from '@utils/viewUtils'

import { SandboxLayout, SettingsSidebar } from '@harnessio/ui/views'
import { RepoSettingsLayout } from '@harnessio/ui/views'

export const RepoSettingsViewWrapper: FC<PropsWithChildren> = ({ children }) => {
const { t } = useTranslationsStore()

return (
<SandboxLayout.Main fullWidth>
<SandboxLayout.Columns columnWidths="auto 1fr">
<SandboxLayout.Column>
<SettingsSidebar t={t} />
</SandboxLayout.Column>
<SandboxLayout.Column>{children}</SandboxLayout.Column>
</SandboxLayout.Columns>
</SandboxLayout.Main>
<Routes>
<Route path="*" element={<RepoSettingsLayout useTranslationStore={useTranslationsStore} />}>
<Route path="*" element={children} />
</Route>
</Routes>
)
}
66 changes: 66 additions & 0 deletions apps/design-system/src/pages/view-preview/view-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,34 @@ import { Navigate, Route, Routes } from 'react-router-dom'

import { RepoSettingsViewWrapper } from '@/pages/view-preview/repo-settings-view-wrapper'
import ExecutionListWrapper from '@subjects/views/execution-list/execution-list'
import { ProjectLabelsList } from '@subjects/views/labels/project-labels-list'
import { RepoLabelsList } from '@subjects/views/labels/repo-labels-list'
import PipelineListWrapper from '@subjects/views/pipeline-list/pipeline-list'
import PullRequestCompareWrapper from '@subjects/views/pull-request-compare/pull-request-compare'
import PullRequestChanges from '@subjects/views/pull-request-conversation/pull-request-changes'
import PullRequestCommits from '@subjects/views/pull-request-conversation/pull-request-commits'
import PullRequestConversation from '@subjects/views/pull-request-conversation/pull-request-conversation'
import PullRequestListWrapper from '@subjects/views/pull-request-list/pull-request-list'
import { RepoCommitsView } from '@subjects/views/repo-commits'
import { RepoCreateRule } from '@subjects/views/repo-create-rule'
import { RepoFilesEditView } from '@subjects/views/repo-files/repo-files-edit-view'
import { RepoFilesJsonView } from '@subjects/views/repo-files/repo-files-json-view'
import { RepoFilesList } from '@subjects/views/repo-files/repo-files-list'
import { RepoFilesMarkdownView } from '@subjects/views/repo-files/repo-files-markdown-view'
import { RepoGeneralSettings } from '@subjects/views/repo-general-settings/repo-general-settings'
import RepoListWrapper from '@subjects/views/repo-list/repo-list'
import RepoSummaryViewWrapper from '@subjects/views/repo-summary/repo-summary'
import { RepoWebhooksCreate } from '@subjects/views/repo-webhooks-create/repo-webhooks-list'
import { RepoWebhooksList } from '@subjects/views/repo-webhooks-list/repo-webhooks-list'
import { SpaceSettingsMembers } from '@subjects/views/space-settings-members/space-settings-members'
import { useTranslationsStore } from '@utils/viewUtils'

import { NotFoundPage } from '@harnessio/ui/views'

import { CommitDetailsDiffViewWrapper } from './commit-details-diff-view-wrapper'
import CommitDetailsViewWrapper from './commit-details-view-wrapper'
import { ProjectSettingsWrapper } from './project-settings-wrapper'
import PullRequestLayoutWrapper from './pull-request-layout-wrapper'
import { RepoFilesViewWrapper } from './repo-files-view-wrapper'
import RepoViewWrapper from './repo-view-wrapper'
import RootViewWrapper from './root-view-wrapper'
Expand All @@ -47,6 +60,21 @@ export const viewPreviews: Record<string, ReactNode> = {
<PullRequestCompareWrapper />
</RepoViewWrapper>
),
'pull-request-conversation': (
<PullRequestLayoutWrapper>
<PullRequestConversation />
</PullRequestLayoutWrapper>
),
'pull-request-commits': (
<PullRequestLayoutWrapper>
<PullRequestCommits />
</PullRequestLayoutWrapper>
),
'pull-request-changes': (
<PullRequestLayoutWrapper>
<PullRequestChanges />
</PullRequestLayoutWrapper>
),
'repo-files-list': (
<RepoViewWrapper>
<RepoFilesViewWrapper>
Expand Down Expand Up @@ -110,6 +138,44 @@ export const viewPreviews: Record<string, ReactNode> = {
<RepoWebhooksCreate />
</RepoSettingsViewWrapper>
</RepoViewWrapper>
),
'general-settings': (
<RepoViewWrapper>
<RepoSettingsViewWrapper>
<RepoGeneralSettings />
</RepoSettingsViewWrapper>
</RepoViewWrapper>
),
'create-rule': (
<RepoViewWrapper>
<RepoSettingsViewWrapper>
<RepoCreateRule />
</RepoSettingsViewWrapper>
</RepoViewWrapper>
),
'rule-not-found': (
<RepoViewWrapper>
<RepoSettingsViewWrapper>
<NotFoundPage useTranslationStore={useTranslationsStore} pageTypeText="rules" />
</RepoSettingsViewWrapper>
</RepoViewWrapper>
),
'repo-labels-list': (
<RepoViewWrapper>
<RepoSettingsViewWrapper>
<RepoLabelsList />
</RepoSettingsViewWrapper>
</RepoViewWrapper>
),
'space-settings-labels': (
<ProjectSettingsWrapper>
<ProjectLabelsList />
</ProjectSettingsWrapper>
),
'space-settings-members': (
<ProjectSettingsWrapper>
<SpaceSettingsMembers />
</ProjectSettingsWrapper>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { noop } from '@utils/viewUtils'
import { noop } from '@utils/viewUtils.ts'

import { BranchSelectorTab } from '@harnessio/ui/views'
import { BranchSelectorTab, IBranchSelectorStore } from '@harnessio/ui/views'

export const repoBranchListStore = {
selectedBranchTag: { name: 'main', sha: '1d0e5a9461b340ebb3d7e092a2d35ff6d0d5c952', default: true },
Expand Down Expand Up @@ -47,4 +47,4 @@ export const repoBranchListStore = {
setDefaultBranch: noop,
setPage: noop,
setPaginationFromHeaders: noop
}
} as IBranchSelectorStore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { useState } from 'react'

import { noop, useTranslationsStore } from '@utils/viewUtils'

import { DeleteAlertDialog } from '@harnessio/ui/components'
import { CreateLabelDialog, ProjectLabelsListView } from '@harnessio/ui/views'

import { RepoLabelsListStore } from './repo-labels-store'

export const ProjectLabelsList = () => {
const [openCreateLabelDialog, setOpenCreateLabelDialog] = useState(false)
const [openAlertDeleteDialog, setOpenAlertDeleteDialog] = useState(false)

return (
<>
<ProjectLabelsListView
useLabelsStore={RepoLabelsListStore.useLabelsStore}
useTranslationStore={useTranslationsStore}
handleDeleteLabel={() => setOpenAlertDeleteDialog(true)}
handleEditLabel={() => setOpenCreateLabelDialog(true)}
openCreateLabelDialog={() => setOpenCreateLabelDialog(true)}
searchQuery={null}
setSearchQuery={noop}
isLoadingSpaceLabels={false}
/>
<CreateLabelDialog
open={openCreateLabelDialog}
onClose={() => setOpenCreateLabelDialog(false)}
onSubmit={noop}
useTranslationStore={useTranslationsStore}
isCreatingLabel={false}
error={''}
useLabelsStore={RepoLabelsListStore.useLabelsStore}
/>
<DeleteAlertDialog
open={openAlertDeleteDialog}
onClose={() => setOpenAlertDeleteDialog(false)}
identifier={''}
type="label"
deleteFn={noop}
isLoading={false}
useTranslationStore={useTranslationsStore}
/>
</>
)
}
46 changes: 46 additions & 0 deletions apps/design-system/src/subjects/views/labels/repo-labels-list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { useState } from 'react'

import { noop, useTranslationsStore } from '@utils/viewUtils'

import { DeleteAlertDialog } from '@harnessio/ui/components'
import { CreateLabelDialog, RepoLabelsListView } from '@harnessio/ui/views'

import { RepoLabelsListStore } from './repo-labels-store'

export const RepoLabelsList = () => {
const [openCreateLabelDialog, setOpenCreateLabelDialog] = useState(false)
const [openAlertDeleteDialog, setOpenAlertDeleteDialog] = useState(false)

return (
<>
<RepoLabelsListView
useLabelsStore={RepoLabelsListStore.useLabelsStore}
useTranslationStore={useTranslationsStore}
handleDeleteLabel={() => setOpenAlertDeleteDialog(true)}
handleEditLabel={() => setOpenCreateLabelDialog(true)}
openCreateLabelDialog={() => setOpenCreateLabelDialog(true)}
searchQuery={null}
setSearchQuery={noop}
isLoadingSpaceLabels={false}
/>
<CreateLabelDialog
open={openCreateLabelDialog}
onClose={() => setOpenCreateLabelDialog(false)}
onSubmit={noop}
useTranslationStore={useTranslationsStore}
isCreatingLabel={false}
error={''}
useLabelsStore={RepoLabelsListStore.useLabelsStore}
/>
<DeleteAlertDialog
open={openAlertDeleteDialog}
onClose={() => setOpenAlertDeleteDialog(false)}
identifier={''}
type="label"
deleteFn={noop}
isLoading={false}
useTranslationStore={useTranslationsStore}
/>
</>
)
}
Loading

0 comments on commit 95eca42

Please sign in to comment.