Commit 32c727cb authored by Filipa Lacerda's avatar Filipa Lacerda

Fix typo

parent 98a0f72d
......@@ -24,7 +24,7 @@ $(() => {
};
});
};
gl.EnvironmentsListApp = new Vue({
el: '#environments-list-view',
......@@ -49,7 +49,7 @@ $(() => {
return filterEnvironments(this.state.environments, 'stopped').length;
},
counAvailable () {
countAvailable () {
return filterEnvironments(this.state.environments, 'available').length;
}
},
......@@ -86,10 +86,10 @@ $(() => {
*/
getQueryParameter(param) {
return window.location.search.substring(1).split('&').reduce((acc, param) => {
acc[param.split('=')[0]] = param.split('=')[1];
const paramSplited = param.split('=');
acc[paramSplited[0]] = paramSplited[1];
return acc;
}, {})[param];
}
});
});
......@@ -41,7 +41,7 @@
* @param {Array} environments List of environments.
* @returns {Array} Tree structured array with the received environments.
*/
storeEnvironments(environments) {
storeEnvironments(environments = []) {
const environmentsTree = environments.reduce((acc, environment) => {
const data = Object.assign({}, environment);
......
......@@ -12,7 +12,7 @@
= link_to project_environments_path(@project) do
Available
%span.badge.js-available-environments-count
{{counAvailable}}
{{countAvailable}}
%li{class: ('active' if @scope == 'stopped')}
= link_to project_environments_path(@project, scope: :stopped) do
......@@ -41,7 +41,7 @@
= link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do
New environment
.table-holder{ "v-if" => "!loading && state.environments" }
.table-holder{ "v-if" => "!loading && state.environments.length" }
%table.table.ci-table.environments
%thead
%th Environment
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment