Skip to content

Commit

Permalink
fix: Filter terminating project
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Aug 11, 2020
1 parent 639706f commit 0db5966
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 9 additions & 7 deletions src/components/Forms/AppDeploy/BasicInfo/Placement/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ export default class Placment extends Component {

@computed
get namespaces() {
return this.projectStore.list.data.map(item => ({
label: item.name,
value: item.name,
opRuntime: item.opRuntime,
disabled: item.isFedManaged,
isFedManaged: item.isFedManaged,
}))
return this.projectStore.list.data
.filter(item => item.status !== 'Terminating')
.map(item => ({
label: item.name,
value: item.name,
opRuntime: item.opRuntime,
disabled: item.isFedManaged,
isFedManaged: item.isFedManaged,
}))
}

async init() {
Expand Down
14 changes: 8 additions & 6 deletions src/components/Inputs/ProjectSelect/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ export default class ProjectSelect extends Component {
const { defaultValue } = this.props
const { data } = this.projectStore.list

const result = data.map(item => ({
label: item.name,
value: item.name,
disabled: item.isFedManaged,
isFedManaged: item.isFedManaged,
}))
const result = data
.filter(item => item.status !== 'Terminating')
.map(item => ({
label: item.name,
value: item.name,
disabled: item.isFedManaged,
isFedManaged: item.isFedManaged,
}))

if (defaultValue && !data.find(item => item.name === defaultValue)) {
result.unshift({
Expand Down

0 comments on commit 0db5966

Please sign in to comment.