ui/lib/pipeline/addon/components/pipeline-step-form/component.js

36 lines
742 B
JavaScript

import Component from '@ember/component';
import layout from './template';
import { set, get } from '@ember/object';
const stepOneChoice = [{
id: 'scm',
}];
const stepsChoices = [{
id: 'task',
name: 'run a script'
},{
id: 'build',
name: 'publish an image'
}
];
export default Component.extend({
layout,
selectedModel: function(){
return get(this, 'model')[get(this, 'type')]
}.property('model','type'),
stepsTypeChoices: null,
type: null,
model: null,
init(){
this._super(...arguments);
var stepMode = get(this, 'modalOpts.stepMode');
if(stepMode === 'scm'){
set(this, 'stepsTypeChoices', stepOneChoice);
}else{
set(this, 'stepsTypeChoices', stepsChoices);
}
}
});