-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace provision Tagging tree by component #5550
Changes from all commits
f7abada
4ec58a9
5b16984
1ad1df0
6aaf393
92b98fe
b60de71
8f3109d
a410aac
c9528dc
bf430f2
1bd910a
2ce52a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,12 @@ import promiseMiddleware from 'redux-promise-middleware'; | |
export const taggingMiddleware = store => next => action => { | ||
const { type, meta, tagCategory, tag } = action; | ||
if (meta && meta.url) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. switch (type) {
case 'UI-COMPONENTS_TAGGING_TOGGLE_TAG_VALUE_CHANGE':
$.post(meta.url, meta.params(meta.type, store.getState(), tag));
break;
case 'UI-COMPONENTS_TAGGING_DELETE_ASSIGNED_TAG':
$.post(meta.url, meta.onDelete(meta.type, params, tag.tagValue.id));
break;
} and move that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The point is, there should be only 1 place dealing with this logic, not 2, or 3. (maybe onDelete should not take computed params, and do it by itself, from state, that way maybe you can also unify the args) |
||
const params = {id: store.getState().tagging.appState.affectedItems[0], cat: tag.tagCategory.id, val: tag.tagValue.id, check: 1, tree_typ: 'tags' }; | ||
let params = meta.params(meta.type, store.getState(), tag); | ||
if (type === 'UI-COMPONENTS_TAGGING_TOGGLE_TAG_VALUE_CHANGE') { | ||
$.post(meta.url, params) | ||
$.post({url: meta.url, data: JSON.stringify(params), contentType: "application/json"}) | ||
} else if (type === 'UI-COMPONENTS_TAGGING_DELETE_ASSIGNED_TAG') { | ||
$.post(meta.url, {...params, check: 0}) | ||
params = meta.onDelete(meta.type, params, tag.tagValue.id); | ||
$.post({url: meta.url, data: JSON.stringify(params), contentType: "application/json"}) | ||
} | ||
} | ||
let result = next(action) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
- return if field_hash.blank? | ||
- field_id = dialog.to_s + "__" + field.to_s | ||
- disabled ||= false | ||
|
||
- unless [:hide, :ignore].include?(field_hash[:display]) | ||
:javascript | ||
// Create from/to date JS vars to limit calendar starting from | ||
|
@@ -290,26 +289,13 @@ | |
= field_hash[:notes] | ||
- elsif [:tag_ids, :vm_tags].include?(field) | ||
-# tree control for tags fields | ||
.col-md-8 | ||
#all_tags_treebox.treeview-pf-hover.treeview-pf-select{:style => "color:#000; overflow: hidden;"} | ||
- if @edit && @edit[:req_id] | ||
- check = @edit[:req_id] | ||
- elsif @miq_request | ||
- check = @miq_request.id | ||
- else | ||
- check = 'new' | ||
= render(:partial => "layouts/tree", | ||
:locals => {:tree_id => "all_tags_treebox", | ||
:tree_name => "all_tags_tree", | ||
:bs_tree => @all_tags_tree, | ||
:oncheck => "miqOnCheckProvTags", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also remove the (If it was used |
||
:check_url => "/miq_request/prov_field_changed/#{check}", | ||
:checkboxes => true}) | ||
.col-md-10 | ||
= react('TaggingWrapperConnected', | ||
:tags => @tags, | ||
:options => { :type => 'provision', :hideHeaders => true, :hideButtons => true, :url => url_for_only_path(:action => 'prov_field_changed')}) | ||
- unless field_hash[:notes_display] == :hide || field_hash[:notes].blank? | ||
-# Display notes if available | ||
= field_hash[:notes] | ||
.note | ||
= _("* Only a single value can be assigned from these Tag Categories") | ||
- elsif [:attached_ds, :iso_image_id, :placement_availability_zone, | ||
:placement_cluster_name, :placement_dc_name, :placement_ds_name, | ||
:placement_ems_name, :placement_host_name, :placement_rp_name, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wf? If it is undocumented behavior, please look it up and document it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stands for workflow, used a lot in automate code (309 occurences)