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 {
> div[class*='popover-arrow'] {
display: none;

View File

@ -17,6 +17,7 @@
/* eslint-disable */
// This is an auto-generated file
export declare const button: string
export declare const buttonIcon: string
export declare const listContainer: string
export declare const main: 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 { useStrings } from 'framework/strings'
import { CDECustomDropdown } from '../CDECustomDropdown/CDECustomDropdown'
import css from './CDEIDESelect.module.scss'
export const CDEIDESelect = ({
onChange,
@ -61,7 +62,7 @@ export const CDEIDESelect = ({
}
label={
<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>
</Layout.Horizontal>
}

View File

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

View File

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

View File

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

View File

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

View File

@ -89,6 +89,27 @@ paths:
maximum: 100
minimum: 1
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:
'200':
content:
@ -967,6 +988,13 @@ components:
- agent_gitspace_state_report_error
- agent_gitspace_state_report_stopped
- agent_gitspace_state_report_unknown
- gitspace_action_auto_stop
type: string
EnumGitspaceFilterState:
enum:
- error
- running
- stopped
type: string
EnumGitspaceInstanceStateType:
enum:
@ -978,6 +1006,17 @@ components:
- starting
- stopping
type: string
EnumGitspaceOwner:
enum:
- all
- self
type: string
EnumGitspaceSort:
enum:
- created
- last_activated
- last_used
type: string
EnumGitspaceStateType:
enum:
- running
@ -1034,9 +1073,6 @@ components:
type: string
nullable: true
type: array
template_identifier:
nullable: true
type: string
type: object
OpenapiCreateGitspaceRequest:
properties:
@ -1162,6 +1198,8 @@ components:
properties:
branch:
type: string
branch_url:
type: string
code_repo_is_private:
type: boolean
code_repo_ref:
@ -1324,9 +1362,6 @@ components:
type: string
space_path:
type: string
template_identifier:
nullable: true
type: string
updated:
type: integer
type: object