Skip to content

Commit

Permalink
Converts released story type select to react component
Browse files Browse the repository at this point in the history
  • Loading branch information
Murilo Varela committed Jul 19, 2017
1 parent f47b592 commit ef03efd
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions app/assets/javascripts/views/story_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,24 +735,6 @@ module.exports = FormView.extend({
return [I18n.t('story.state.' + option), option];
},

makeStoryTypeSelect: function(div) {
var storyTypeOptions = _.map(["feature", "chore", "bug", "release"], function(option) {
return [I18n.t('story.type.' + option), option]
});

$(div).append(this.makeFormControl({
name: "story_type",
label: true,
disabled: true,
control: this.select("story_type", storyTypeOptions, {
attrs: {
class: ['story_type'],
disabled: this.isReadonly()
}
})
}));
},

makeTitle: function() {
return function(div) {
$(div).append(this.label("title", I18n.t('activerecord.attributes.story.title')));
Expand All @@ -773,7 +755,8 @@ module.exports = FormView.extend({
if(this.model.get('editing')) {
this.$el.append(
this.makeFormControl(function(div) {
this.makeStoryTypeSelect(div);
const $storyType = $('<div class="form-group" data-story-type></div>');
$(div).append($storyType);
}));
}

Expand Down

0 comments on commit ef03efd

Please sign in to comment.