Skip to content

Commit fbff37e

Browse files
authored
Merge pull request #2295 from alexissellier/display-imported-command-in-ui
fix: Use config key instead of rawConfig
2 parents 6636c72 + 44f5267 commit fbff37e

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

ui/src/components/views/Commands/Commands/CommandsList/CommandsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CommandsList extends React.PureComponent<Props, State> {
3535
};
3636

3737
renderCommands = () => {
38-
return Object.entries(this.props.devSpaceConfig.rawConfig.commands).map(([key, cmd]) => {
38+
return Object.entries(this.props.commandsList).map(([key, cmd]) => {
3939
return <PortletSimple key={key}>
4040
{{
4141
top: {

ui/src/contexts/withDevSpaceConfig/withDevSpaceConfig.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ interface Config {
4141
version: string;
4242

4343
images: { [key: string]: ImageConfig };
44+
commands: { [key: string]: Command };
4445
}
4546

4647
interface RawConfig {

ui/src/pages/commands/commands.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ class Commands extends React.PureComponent<Props, State> {
8383
render() {
8484
return (
8585
<PageLayout className={styles['commands-component']} heading={<CommandsLinkTabSelector />}>
86-
{!this.props.devSpaceConfig.rawConfig ||
87-
!this.props.devSpaceConfig.rawConfig.commands ||
88-
Object.entries(this.props.devSpaceConfig.rawConfig.commands).length === 0 ? (
86+
{!this.props.devSpaceConfig.config ||
87+
!this.props.devSpaceConfig.config.commands ||
88+
Object.entries(this.props.devSpaceConfig.config.commands).length === 0 ? (
8989
<div className={styles['no-config']}>
9090
<div>
9191
No commands available. Take a look at&nbsp;
@@ -100,7 +100,7 @@ class Commands extends React.PureComponent<Props, State> {
100100
{this.renderTerminals()}
101101
<div className={styles['info-part']}>
102102
<CommandsList
103-
commandsList={this.props.devSpaceConfig.rawConfig.commands}
103+
commandsList={this.props.devSpaceConfig.config.commands}
104104
running={this.state.terminals.map((terminal) => terminal.url)}
105105
selected={this.state.selected}
106106
onSelect={this.onSelectCommand}

0 commit comments

Comments
 (0)