Skip to content
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

[MNOE-146] Display teams admin panel #583

Merged
merged 13 commits into from
Dec 4, 2017

Conversation

hedudelgado
Copy link
Contributor

No description provided.

@hedudelgado
Copy link
Contributor Author

@ouranos


protected

def fetch_all_teams(organization_id)
Copy link
Contributor

@x4d3 x4d3 Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between fetch_all_teams and fetch_teams ? keep fetch_teams only.

@@ -19,7 +19,7 @@ def timestamp
end

def parent_organization
@parent_organization ||= current_user.organizations.to_a.find { |o| o.id.to_s == params[:organization_id].to_s }
@parent_organization ||= MnoEnterprise::Organization.includes(:orga_relations).find(params[:organization_id]).first
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace by find_one(params[:organization_id], :orga_relations)

Copy link
Contributor

@x4d3 x4d3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes needed.

#==================================================================
# GET /mnoe/jpi/v1/admin/organizations/1/teams
def index
authorize! :read, parent_organization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need authorize there? It's in the admin endpoint

def fetch_teams(organization_id)
MnoEnterprise::Team
.apply_query_params(params)
.includes(RELATIONSHIPS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use select here as part of the perf improvements?

@@ -0,0 +1,20 @@
@all_apps ||= MnoEnterprise::App.all.to_a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really to load all apps for each team here?
Couldn't we load and include team -> app_instances -> app
Especially if it's just to display the logo

@@ -19,7 +19,7 @@ def timestamp
end

def parent_organization
@parent_organization ||= current_user.organizations.to_a.find { |o| o.id.to_s == params[:organization_id].to_s }
@parent_organization ||= MnoEnterprise::Organization.find_one(params[:organization_id], :orga_relations)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this helper was not used before and is just a bad copy paste from the regular jpi controller.
How about removing it and inline the code in the controller that uses it?

@x4d3 x4d3 force-pushed the MNOE-146-display-teams-admin-panel branch from ae9675e to baec6de Compare November 29, 2017 17:58
Copy link
Contributor

@ouranos ouranos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

See my question about the xxx_id

@@ -9,6 +9,7 @@ module MnoEnterprise::Concerns::Models::AppInstance
included do
property :created_at, type: :time
property :updated_at, type: :time
property :app_id, type: :string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were getting rid of this in #560

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are, but little by little.

@ouranos ouranos merged commit 7182acc into maestrano:4.0 Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants