Commit 1d9ab992 authored by Kamil Trzciński's avatar Kamil Trzciński Committed by Clement Ho

Make deploy board be visible by default

parent b1fb6dec
......@@ -64,7 +64,7 @@ export default class EnvironmentsStore {
if (filtered.size === 1 && filtered.rollout_status_path) {
filtered = Object.assign({}, filtered, {
hasDeployBoard: true,
isDeployBoardVisible: false,
isDeployBoardVisible: true,
deployBoardData: {},
});
}
......
......@@ -28,6 +28,7 @@ class MockDeploymentService < DeploymentService
private
def rollout_status_instances
JSON.parse(Rails.root.join('spec', 'fixtures', 'rollout_status_instances.json'))
data = File.read(Rails.root.join('spec', 'fixtures', 'rollout_status_instances.json'))
JSON.parse(data)
end
end
......@@ -12,6 +12,7 @@ class MockMonitoringService < MonitoringService
end
def metrics(environment)
JSON.parse(Rails.root.join('spec', 'fixtures', 'metrics.json'))
data = File.read(Rails.root.join('spec', 'fixtures', 'metrics.json'))
JSON.parse(data)
end
end
......@@ -74,7 +74,7 @@ class ProjectPolicy < BasePolicy
can! :read_deployment
can! :read_merge_request
if License.current&.add_on?('GitLab_DeployBoard')
if License.current&.add_on?('GitLab_DeployBoard') || Rails.env.development?
can! :read_deploy_board
end
end
......
---
title: Make deployboard to be visible by default
merge_request:
author:
......@@ -83,9 +83,10 @@ describe('Environment', () => {
it('should render a table with environments', (done) => {
setTimeout(() => {
expect(component.$el.querySelectorAll('table')).toBeDefined();
expect(
component.$el.querySelectorAll('table tbody tr').length,
).toEqual(1);
component.$el.querySelector('.environment-name').textContent.trim(),
).toEqual(environment.name);
done();
}, 0);
});
......
......@@ -31,7 +31,7 @@ describe('Store', () => {
updated_at: '2017-01-31T10:53:46.894Z',
rollout_status_path: '/path',
hasDeployBoard: true,
isDeployBoardVisible: false,
isDeployBoardVisible: true,
deployBoardData: {},
};
......@@ -66,7 +66,7 @@ describe('Store', () => {
store.storeEnvironments([environment]);
expect(store.state.environments[0].hasDeployBoard).toEqual(true);
expect(store.state.environments[0].isDeployBoardVisible).toEqual(false);
expect(store.state.environments[0].isDeployBoardVisible).toEqual(true);
expect(store.state.environments[0].deployBoardData).toEqual({});
});
......
......@@ -47,9 +47,10 @@ describe('Environments Folder View', () => {
it('should render a table with environments', (done) => {
setTimeout(() => {
expect(component.$el.querySelectorAll('table')).toBeDefined();
expect(
component.$el.querySelectorAll('table tbody tr').length,
).toEqual(2);
component.$el.querySelector('.environment-name').textContent.trim(),
).toEqual(environmentsList[0].name);
done();
}, 0);
});
......
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