fix: [CDE-442]: Branch url changes and minor UI fixes for create gitspace (#2937)

* Newly updated swagger file
* Pushed the newly generated index.tsx file for interface
* Removed the manually added parameter
* Styling fix using css
* Branch url and UI Fixes
pull/3586/head
Neel Khamar 2024-11-06 11:57:08 +00:00 committed by Harness
parent 1275064dd0
commit 72b0431b25
8 changed files with 66 additions and 17 deletions

View File

@ -44,6 +44,10 @@
} }
} }
.buttonIcon {
margin-right: var(--spacing-medium);
}
.popover { .popover {
> div[class*='popover-arrow'] { > div[class*='popover-arrow'] {
display: none; display: none;

View File

@ -17,6 +17,7 @@
/* eslint-disable */ /* eslint-disable */
// This is an auto-generated file // This is an auto-generated file
export declare const button: string export declare const button: string
export declare const buttonIcon: string
export declare const listContainer: string export declare const listContainer: string
export declare const main: string export declare const main: string
export declare const popover: string export declare const popover: string

View File

@ -23,6 +23,7 @@ import vsCodeWebIcon from 'cde-gitness/assests/vsCodeWeb.svg?url'
import vscodeIcon from 'cde-gitness/assests/VSCode.svg?url' import vscodeIcon from 'cde-gitness/assests/VSCode.svg?url'
import { useStrings } from 'framework/strings' import { useStrings } from 'framework/strings'
import { CDECustomDropdown } from '../CDECustomDropdown/CDECustomDropdown' import { CDECustomDropdown } from '../CDECustomDropdown/CDECustomDropdown'
import css from './CDEIDESelect.module.scss'
export const CDEIDESelect = ({ export const CDEIDESelect = ({
onChange, onChange,
@ -61,7 +62,7 @@ export const CDEIDESelect = ({
} }
label={ label={
<Layout.Horizontal width="100%" flex={{ alignItems: 'center', justifyContent: 'space-between' }}> <Layout.Horizontal width="100%" flex={{ alignItems: 'center', justifyContent: 'space-between' }}>
<img height={16} width={16} src={img} /> <img height={16} width={16} src={img} className={css.buttonIcon} />
<Text>{label}</Text> <Text>{label}</Text>
</Layout.Horizontal> </Layout.Horizontal>
} }

View File

@ -216,9 +216,7 @@ export const CDESSHSelect = () => {
</Layout.Vertical> </Layout.Vertical>
</Layout.Horizontal> </Layout.Horizontal>
} }
label={ label={<Text icon={loading ? 'loading' : undefined}>{values?.ssh_token_identifier || 'Select SSH Key'}</Text>}
<Text icon={loading ? 'loading' : undefined}>{values?.ssh_token_identifier || '-- Select SSH Key --'}</Text>
}
formikName="ssh_token_identifier" formikName="ssh_token_identifier"
menu={ menu={
<Menu> <Menu>

View File

@ -35,7 +35,7 @@ export const DetailsCard = ({
loading?: boolean loading?: boolean
}) => { }) => {
const { getString } = useStrings() const { getString } = useStrings()
const { branch, state, name, code_repo_url, code_repo_type, instance, resource } = data || {} const { branch, state, name, branch_url, code_repo_type, instance, resource } = data || {}
const color = getStatusColor(state) const color = getStatusColor(state)
const customProps = const customProps =
state === GitspaceStatus.STARTING state === GitspaceStatus.STARTING
@ -80,7 +80,7 @@ export const DetailsCard = ({
margin={{ left: 'small' }} margin={{ left: 'small' }}
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
font={{ align: 'left', size: 'normal' }} font={{ align: 'left', size: 'normal' }}
onClick={() => window.open(code_repo_url, '_blank')}> onClick={() => window.open(branch_url, '_blank')}>
{name} {name}
</Text> </Text>
</Layout.Horizontal> </Layout.Horizontal>
@ -93,7 +93,7 @@ export const DetailsCard = ({
color={Color.PRIMARY_7} color={Color.PRIMARY_7}
icon="git-branch" icon="git-branch"
style={{ cursor: 'pointer' }} style={{ cursor: 'pointer' }}
onClick={() => window.open(code_repo_url, '_blank')}> onClick={() => window.open(branch_url, '_blank')}>
{branch} {branch}
</Text> </Text>
</Layout.Vertical> </Layout.Vertical>

View File

@ -163,7 +163,7 @@ export const OwnerAndCreatedAt: Renderer<CellProps<TypesGitspaceConfig>> = ({ ro
export const RenderRepository: Renderer<CellProps<TypesGitspaceConfig>> = ({ row }) => { export const RenderRepository: Renderer<CellProps<TypesGitspaceConfig>> = ({ row }) => {
const details = row.original const details = row.original
const { name, branch, code_repo_url, code_repo_type, instance } = details || {} const { name, branch, branch_url, code_repo_type, instance } = details || {}
const { has_git_changes } = instance || {} const { has_git_changes } = instance || {}
const { getString } = useStrings() const { getString } = useStrings()
@ -176,7 +176,7 @@ export const RenderRepository: Renderer<CellProps<TypesGitspaceConfig>> = ({ row
onClick={e => { onClick={e => {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
window.open(code_repo_url, '_blank') window.open(branch_url, '_blank')
}}> }}>
<Layout.Horizontal <Layout.Horizontal
className={css.repositoryCell} className={css.repositoryCell}

View File

@ -48,6 +48,9 @@ export type EnumGitspaceEventType =
| 'agent_gitspace_state_report_error' | 'agent_gitspace_state_report_error'
| 'agent_gitspace_state_report_stopped' | 'agent_gitspace_state_report_stopped'
| 'agent_gitspace_state_report_unknown' | 'agent_gitspace_state_report_unknown'
| 'gitspace_action_auto_stop'
export type EnumGitspaceFilterState = 'error' | 'running' | 'stopped'
export type EnumGitspaceInstanceStateType = export type EnumGitspaceInstanceStateType =
| 'running' | 'running'
@ -58,6 +61,10 @@ export type EnumGitspaceInstanceStateType =
| 'starting' | 'starting'
| 'stopping' | 'stopping'
export type EnumGitspaceOwner = 'all' | 'self'
export type EnumGitspaceSort = 'created' | 'last_activated' | 'last_used'
export type EnumGitspaceStateType = 'running' | 'stopped' | 'error' | 'uninitialized' | 'starting' | 'stopping' export type EnumGitspaceStateType = 'running' | 'stopped' | 'error' | 'uninitialized' | 'starting' | 'stopping'
export type EnumIDEType = 'vs_code' | 'vs_code_web' export type EnumIDEType = 'vs_code' | 'vs_code_web'
@ -78,7 +85,6 @@ export interface InfraproviderResourceInput {
name?: string name?: string
network?: string | null network?: string | null
region?: string[] | null region?: string[] | null
template_identifier?: string | null
} }
export interface OpenapiCreateGitspaceRequest { export interface OpenapiCreateGitspaceRequest {
@ -156,6 +162,7 @@ export interface TypesBranchResponse {
export interface TypesGitspaceConfig { export interface TypesGitspaceConfig {
branch?: string branch?: string
branch_url?: string
code_repo_is_private?: boolean code_repo_is_private?: boolean
code_repo_ref?: string | null code_repo_ref?: string | null
code_repo_type?: EnumGitspaceCodeRepoType code_repo_type?: EnumGitspaceCodeRepoType
@ -234,7 +241,6 @@ export interface TypesInfraProviderResource {
network?: string | null network?: string | null
region?: string region?: string
space_path?: string space_path?: string
template_identifier?: string | null
updated?: number updated?: number
} }
@ -357,6 +363,10 @@ export interface ListGitspacesQueryParams {
* The maximum number of results to return. * The maximum number of results to return.
*/ */
limit?: number limit?: number
gitspace_owner?: EnumGitspaceOwner
gitspace_states?: EnumGitspaceFilterState[]
sort?: EnumGitspaceSort
order?: 'asc' | 'desc'
} }
export interface ListGitspacesPathParams { export interface ListGitspacesPathParams {

View File

@ -89,6 +89,27 @@ paths:
maximum: 100 maximum: 100
minimum: 1 minimum: 1
type: integer type: integer
- in: query
name: gitspace_owner
schema:
$ref: '#/components/schemas/EnumGitspaceOwner'
- in: query
name: gitspace_states
schema:
items:
$ref: '#/components/schemas/EnumGitspaceFilterState'
type: array
- in: query
name: sort
schema:
$ref: '#/components/schemas/EnumGitspaceSort'
- in: query
name: order
schema:
enum:
- asc
- desc
type: string
responses: responses:
'200': '200':
content: content:
@ -967,6 +988,13 @@ components:
- agent_gitspace_state_report_error - agent_gitspace_state_report_error
- agent_gitspace_state_report_stopped - agent_gitspace_state_report_stopped
- agent_gitspace_state_report_unknown - agent_gitspace_state_report_unknown
- gitspace_action_auto_stop
type: string
EnumGitspaceFilterState:
enum:
- error
- running
- stopped
type: string type: string
EnumGitspaceInstanceStateType: EnumGitspaceInstanceStateType:
enum: enum:
@ -978,6 +1006,17 @@ components:
- starting - starting
- stopping - stopping
type: string type: string
EnumGitspaceOwner:
enum:
- all
- self
type: string
EnumGitspaceSort:
enum:
- created
- last_activated
- last_used
type: string
EnumGitspaceStateType: EnumGitspaceStateType:
enum: enum:
- running - running
@ -1034,9 +1073,6 @@ components:
type: string type: string
nullable: true nullable: true
type: array type: array
template_identifier:
nullable: true
type: string
type: object type: object
OpenapiCreateGitspaceRequest: OpenapiCreateGitspaceRequest:
properties: properties:
@ -1162,6 +1198,8 @@ components:
properties: properties:
branch: branch:
type: string type: string
branch_url:
type: string
code_repo_is_private: code_repo_is_private:
type: boolean type: boolean
code_repo_ref: code_repo_ref:
@ -1324,9 +1362,6 @@ components:
type: string type: string
space_path: space_path:
type: string type: string
template_identifier:
nullable: true
type: string
updated: updated:
type: integer type: integer
type: object type: object