diff --git a/atst/routes/portfolios/applications.py b/atst/routes/portfolios/applications.py index b5a20407..20603b3c 100644 --- a/atst/routes/portfolios/applications.py +++ b/atst/routes/portfolios/applications.py @@ -73,7 +73,7 @@ def edit_application(portfolio_id, application_id): portfolio=portfolio, application=application, form=form, - environments_obj=environments_obj + environments_obj=environments_obj, ) diff --git a/js/components/tables/application_environments.js b/js/components/tables/application_environments.js new file mode 100644 index 00000000..c91e63a2 --- /dev/null +++ b/js/components/tables/application_environments.js @@ -0,0 +1,34 @@ +import { set } from 'vue/dist/vue' + +export default { + name: 'environments-table', + + props: { + environments: Object, + }, + + data: function() { + return { + environmentsState: this.environments, + } + }, + + created: function() { + Object.keys(this.environments).forEach(environment => { + set(this.environmentsState[environment], 'isVisible', false) + }) + }, + + methods: { + toggle: function(e, environmentName) { + this.environmentsState = Object.assign(this.environmentsState, { + [environmentName]: Object.assign( + this.environmentsState[environmentName], + { + isVisible: !this.environmentsState[environmentName].isVisible, + } + ), + }) + }, + }, +} diff --git a/js/index.js b/js/index.js index 0a419224..dee29320 100644 --- a/js/index.js +++ b/js/index.js @@ -25,6 +25,7 @@ import Modal from './mixins/modal' import selector from './components/selector' import BudgetChart from './components/charts/budget_chart' import SpendTable from './components/tables/spend_table' +import EnvironmentsTable from './components/tables/application_environments' import TaskOrderList from './components/tables/task_order_list.js' import MembersList from './components/members_list' import LocalDatetime from './components/local_datetime' @@ -56,6 +57,7 @@ const app = new Vue({ selector, BudgetChart, SpendTable, + EnvironmentsTable, TaskOrderList, MembersList, LocalDatetime, diff --git a/templates/fragments/applications/environments.html b/templates/fragments/applications/environments.html index 8e07f618..3eec6645 100644 --- a/templates/fragments/applications/environments.html +++ b/templates/fragments/applications/environments.html @@ -13,44 +13,39 @@ -
{{ "portfolios.applications.environments.name" | translate }} | -{{ "portfolios.applications.environments.members" | translate }} | -{{ "portfolios.applications.environments.name" | translate }} | +{{ "portfolios.applications.environments.members" | translate }} | - - {% for environment in application.environments %} -||||
---|---|---|---|---|---|---|---|
- | {{ environment.name }} | - - - -Hide Members({{ environment.num_users }}){{ Icon('caret_up') }} | - - - -Show Members({{ environment.num_users }}){{ Icon('caret_down') }} | - - - -||||
-
- User Name here
-
- |
- Hide Members(){{ Icon('caret_up') }} | + + + +Show Members(){{ Icon('caret_down') }} | + + +|||||
+
+
+
+ |
+