Skip to content

Commit

Permalink
feat: pr-compare/create design improvements (#578)
Browse files Browse the repository at this point in the history
* refactor: refactoring pull-request-compare-page

fix: minor changes

fix: minor changes

fix: minor changes

fix: minor changes

fix: minor changes

fix: minor changes

* fix: minor changes

* fix: minor changes

---------

Co-authored-by: Andrew Golovanov <[email protected]>
  • Loading branch information
iatopilskii and andrewgolovanov authored Dec 26, 2024
1 parent afe9135 commit d5c3f06
Show file tree
Hide file tree
Showing 40 changed files with 768 additions and 604 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FC, useCallback } from 'react'

import { PullRequestCompare, SandboxPullRequestCompareProps } from '@harnessio/ui/views'
import { PullRequestComparePage, PullRequestComparePageProps } from '@harnessio/ui/views'

import { noop, useTranslationsStore } from '../../utils.ts'
import { repoBranchListStore } from './repo-branch-store.ts'
import { repoCommitStore } from './repo-commit-store.ts'

const PullRequestCompareWrapper: FC<Partial<SandboxPullRequestCompareProps>> = props => {
const PullRequestCompareWrapper: FC<Partial<PullRequestComparePageProps>> = props => {
const useRepoBranchListStore = useCallback(
() => ({
...repoBranchListStore,
Expand All @@ -23,7 +23,7 @@ const PullRequestCompareWrapper: FC<Partial<SandboxPullRequestCompareProps>> = p
)

return (
<PullRequestCompare
<PullRequestComparePage
onFormSubmit={noop}
onFormDraftSubmit={noop}
onFormCancel={noop}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
BranchSelectorTab,
CommitSelectorListItem,
CompareFormFields,
PullRequestCompare
PullRequestComparePage
} from '@harnessio/ui/views'

import { useAppContext } from '../../framework/context/AppContext'
Expand Down Expand Up @@ -365,7 +365,7 @@ export const CreatePullRequest = () => {
if (isFetchingBranches) return <SkeletonList />

return (
<PullRequestCompare
<PullRequestComparePage
currentUser={currentUser?.display_name}
setSearchCommitQuery={setQuery}
searchCommitQuery={query}
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const buttonVariants = cva(
icon: 'size-8',
sm_icon: 'size-7',
xs_split: 'h-auto p-0 text-xs font-medium',
md_split: 'h-8 text-14 font-medium',
lg_split: 'text-md h-10 p-0 font-medium'
},
borderRadius: {
Expand Down
6 changes: 5 additions & 1 deletion packages/ui/src/components/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import CloudCosts from '../icons/cloud-costs-icon.svg'
import Code from '../icons/code.svg'
import Cog6 from '../icons/cog-6.svg'
import Comments from '../icons/comments.svg'
import Compare from '../icons/compare.svg'
import Connectors from '../icons/connectors-icon.svg'
import CreateWorkspace from '../icons/create-workspace.svg'
import DashboardsGradient from '../icons/dashboards-gradient.svg'
Expand Down Expand Up @@ -109,6 +110,7 @@ import Merged from '../icons/merged.svg'
import Minus from '../icons/minus-icon.svg'
import Ellipsis from '../icons/more-dots-icon.svg'
import Navigation from '../icons/navigation-icon.svg'
import NoDataPR from '../icons/no-data-pr.svg'
import NodeLogo from '../icons/node-logo.svg'
import Notification from '../icons/notification-icon.svg'
import OpenPR from '../icons/open-pr.svg'
Expand Down Expand Up @@ -214,6 +216,7 @@ const IconNameMap = {
'no-search-magnifying-glass': NoSearchMagnifyingGlass,
'no-data-members': NoDataMembers,
'no-data-error': NoDataError,
'no-data-pr': NoDataPR,
changes: Changes,
checks: Checks,
'vertical-ellipsis': VerticalEllipsis,
Expand Down Expand Up @@ -345,7 +348,8 @@ const IconNameMap = {
list: List,
checklist: Checklist,
italicize: Italicize,
'no-data-commits': NoDataCommits
'no-data-commits': NoDataCommits,
compare: Compare
// fork: Fork
} satisfies Record<string, React.FunctionComponent<React.SVGProps<SVGSVGElement>>>

Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/no-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface NoDataProps {
| 'no-repository'
| 'no-data-error'
| 'no-data-commits'
| 'no-data-pr'
iconSize?: number
description: string[]
primaryButton?: {
Expand Down
15 changes: 15 additions & 0 deletions packages/ui/src/icons/compare.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions packages/ui/src/icons/no-data-pr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions packages/ui/src/icons/page-state.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/ui/src/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export * from './types/link-types'
export * as SandboxLayout from './layouts/SandboxLayout'
export * from './layouts/SandboxRoot'
export * from './layouts/Floating1ColumnLayout'
export * from './layouts/PullRequestCompareLayout'
export * from './layouts/PullRequestLayout'

// Account
Expand Down
Loading

0 comments on commit d5c3f06

Please sign in to comment.