Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sans-harness committed Jan 17, 2025
1 parent 54d7fb6 commit 0952383
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { PropsWithChildren } from 'react'
import { Route } from 'react-router-dom'

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

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

export const ProjectSettingsWrapper: React.FC<PropsWithChildren<unknown>> = ({ children }) => {
return (
<>
<RootViewWrapper asChild>
<Route
path="*"
element={
<div className="top-[55px] sticky z-40 bg-background-1">
<ProjectSettingsPage />
</div>
}
>
<Route path="*" element={children} />
</Route>
<Route path="*" element={children}></Route>
</RootViewWrapper>
</>
)
Expand Down
7 changes: 6 additions & 1 deletion apps/design-system/src/pages/view-preview/view-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ 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'
Expand All @@ -28,6 +30,8 @@ import { useTranslationsStore } from '@utils/viewUtils'

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

import { ProjectSettingsPage } 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'
Expand Down Expand Up @@ -167,7 +171,8 @@ export const viewPreviews: Record<string, ReactNode> = {
),
'labels-list-page': (
<ProjectSettingsWrapper>
<RepoLabelsList />
<ProjectSettingsPage />
<ProjectLabelsList />
</ProjectSettingsWrapper>
)
}
Expand Down
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}
/>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,43 @@ interface RepoLabelsListStore {
}
export const RepoLabelsListStore: RepoLabelsListStore = {
useLabelsStore: () => ({
spaceLabels: [],
spaceLabels: [
{
id: 31,
repo_id: 2,
scope: 0,
key: 'label-1',
description: 'sample label',
type: 'static',
color: ColorsEnum.INDIGO,
value_count: 0,
created: 1736962206814,
updated: 1736962206814,
created_by: 4,
updated_by: 4
},
{
id: 27,
repo_id: 2,
scope: 0,
key: 'label-2',
description: 'sample label 2',
type: 'static',
color: ColorsEnum.RED,
value_count: 2,
created: 1736884858874,
updated: 1736884858874,
created_by: 4,
updated_by: 4
}
],
repoLabels: [
{
id: 31,
repo_id: 2,
scope: 0,
key: 'ajshdas',
description: 'askjldhaw',
key: 'sample label',
description: 'description',
type: 'static',
color: ColorsEnum.INDIGO,
value_count: 0,
Expand All @@ -25,8 +54,8 @@ export const RepoLabelsListStore: RepoLabelsListStore = {
id: 27,
repo_id: 2,
scope: 0,
key: 'asd',
description: '',
key: 'sample label-2',
description: 'description',
type: 'static',
color: ColorsEnum.RED,
value_count: 2,
Expand All @@ -41,14 +70,36 @@ export const RepoLabelsListStore: RepoLabelsListStore = {
page: 1,
repo_ref: 'canary',
space_ref: 'P1org',
spaceValues: {},
spaceValues: {
'label-1': [
{
id: 4,
label_id: 27,
value: 'value1',
color: ColorsEnum.BROWN,
created: 1736884858877,
created_by: 4,
updated: 1736925926933,
updated_by: 4
},
{
id: 5,
label_id: 27,
value: 'value2',
color: ColorsEnum.VIOLET,
created: 1736884887529,
created_by: 4,
updated: 1736925926934,
updated_by: 4
}
]
},
repoValues: {
ajshdas: [],
asd: [
'sample label': [
{
id: 4,
label_id: 27,
value: 'afdvfd',
value: 'value1',
color: ColorsEnum.BROWN,
created: 1736884858877,
created_by: 4,
Expand All @@ -58,7 +109,7 @@ export const RepoLabelsListStore: RepoLabelsListStore = {
{
id: 5,
label_id: 27,
value: 'xc.m,vndaf',
value: 'value2',
color: ColorsEnum.VIOLET,
created: 1736884887529,
created_by: 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const ProjectLabelsListView: React.FC<ProjectLabelPageProps> = ({
className="max-w-96"
value={searchInput || ''}
handleChange={handleInputChange}
placeholder={t('views:repos.search')}
placeholder={t('views:repos.search', 'Search')}
/>
</ListActions.Left>
<ListActions.Right>
Expand Down

0 comments on commit 0952383

Please sign in to comment.