-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7570 from h-kataria/conditions_de-explorization
Conditions de explorization
- Loading branch information
Showing
30 changed files
with
395 additions
and
656 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class ApplicationHelper::Button::Condition < ApplicationHelper::Button::ReadOnly | ||
def role_allows_feature? | ||
@view_context.x_active_tree == :condition_tree && role_allows?(:feature => self[:child_id]) | ||
role_allows?(:feature => self[:child_id]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +0,0 @@ | ||
class TreeBuilderCondition < TreeBuilder | ||
private | ||
|
||
def tree_init_options | ||
{:full_ids => true} | ||
end | ||
|
||
# level 0 - root | ||
def root_options | ||
{ | ||
:text => t = _("All Conditions"), | ||
:tooltip => t | ||
} | ||
end | ||
|
||
# not using decorators for now because there are some inconsistencies | ||
def self.folder_icon(klassname) | ||
klassname.safe_constantize.try(:decorate).try(:fonticon) | ||
end | ||
|
||
# level 1 - host / vm | ||
def x_get_tree_roots | ||
text_i18n = {:Host => _("Host Conditions"), | ||
:Vm => _("VM and Instance Conditions"), | ||
:ContainerReplicator => _("Replicator Conditions"), | ||
:ContainerGroup => _("Pod Conditions"), | ||
:ContainerNode => _("Container Node Conditions"), | ||
:ContainerImage => _("Container Image Conditions"), | ||
:ContainerProject => _("Container Project Conditions"), | ||
:ExtManagementSystem => _("Provider Conditions"), | ||
:PhysicalServer => _("Physical Infrastructure Conditions")} | ||
|
||
objects = ConditionController::UI_FOLDERS.collect do |model| | ||
text = text_i18n[model.name.to_sym] | ||
icon = self.class.folder_icon(model.to_s) | ||
|
||
{ | ||
:id => model.name.camelize(:lower), | ||
:icon => icon, | ||
:text => text, | ||
:tip => text | ||
} | ||
end | ||
count_only_or_objects(false, objects) | ||
end | ||
|
||
# level 2 - conditions | ||
def x_get_tree_custom_kids(parent, count_only) | ||
towhat = parent[:id].camelize | ||
return super unless ConditionController::UI_FOLDERS.collect(&:name).include?(towhat) | ||
|
||
objects = Condition.where(:towhat => towhat) | ||
count_only_or_objects(count_only, objects, :description) | ||
end | ||
end | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.