Commit b5064077 authored by Fernando's avatar Fernando

Maintainer feedback changes

* Import license check constant into action and action spec
* Use booleab prop
parent a22bc313
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
<div class="mr-widget-body media"> <div class="mr-widget-body media">
<div class="space-children"> <div class="space-children">
<status-icon status="warning" /> <status-icon status="warning" />
<gl-button category="primary" variant="success" disabled="disabled" size="small"> <gl-button category="primary" variant="success" disabled size="small">
{{ s__('mrWidget|Merge') }} {{ s__('mrWidget|Merge') }}
</gl-button> </gl-button>
</div> </div>
......
...@@ -2,6 +2,7 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -2,6 +2,7 @@ import axios from '~/lib/utils/axios_utils';
import pollUntilComplete from '~/lib/utils/poll_until_complete'; import pollUntilComplete from '~/lib/utils/poll_until_complete';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { LICENSE_APPROVAL_STATUS } from '../constants'; import { LICENSE_APPROVAL_STATUS } from '../constants';
import { LICENSE_CHECK_NAME } from 'ee/approvals/constants';
import { convertToOldReportFormat } from './utils'; import { convertToOldReportFormat } from './utils';
export const setAPISettings = ({ commit }, data) => { export const setAPISettings = ({ commit }, data) => {
...@@ -118,7 +119,7 @@ export const fetchLicenseCheckApprovalRule = ({ dispatch, state }) => { ...@@ -118,7 +119,7 @@ export const fetchLicenseCheckApprovalRule = ({ dispatch, state }) => {
.get(state.approvalsApiPath) .get(state.approvalsApiPath)
.then(({ data }) => { .then(({ data }) => {
const hasLicenseCheckApprovalRule = data.approval_rules_left.some(rule => { const hasLicenseCheckApprovalRule = data.approval_rules_left.some(rule => {
return rule.name === 'License-Check'; return rule.name === LICENSE_CHECK_NAME;
}); });
dispatch('receiveLicenseCheckApprovalRuleSuccess', { hasLicenseCheckApprovalRule }); dispatch('receiveLicenseCheckApprovalRuleSuccess', { hasLicenseCheckApprovalRule });
......
...@@ -3,6 +3,7 @@ import * as actions from 'ee/vue_shared/license_compliance/store/actions'; ...@@ -3,6 +3,7 @@ import * as actions from 'ee/vue_shared/license_compliance/store/actions';
import * as mutationTypes from 'ee/vue_shared/license_compliance/store/mutation_types'; import * as mutationTypes from 'ee/vue_shared/license_compliance/store/mutation_types';
import createState from 'ee/vue_shared/license_compliance/store/state'; import createState from 'ee/vue_shared/license_compliance/store/state';
import { LICENSE_APPROVAL_STATUS } from 'ee/vue_shared/license_compliance/constants'; import { LICENSE_APPROVAL_STATUS } from 'ee/vue_shared/license_compliance/constants';
import { LICENSE_CHECK_NAME } from 'ee/approvals/constants';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import { approvedLicense, blacklistedLicense } from '../mock_data'; import { approvedLicense, blacklistedLicense } from '../mock_data';
...@@ -485,7 +486,7 @@ describe('License store actions', () => { ...@@ -485,7 +486,7 @@ describe('License store actions', () => {
describe('fetchLicenseCheckApprovalRule ', () => { describe('fetchLicenseCheckApprovalRule ', () => {
it('dispatches request/receive with detected approval rule', done => { it('dispatches request/receive with detected approval rule', done => {
const APPROVAL_RULE_RESPONSE = { const APPROVAL_RULE_RESPONSE = {
approval_rules_left: [{ name: 'License-Check' }], approval_rules_left: [{ name: LICENSE_CHECK_NAME }],
}; };
axiosMock.onGet(approvalsApiPath).replyOnce(200, APPROVAL_RULE_RESPONSE); axiosMock.onGet(approvalsApiPath).replyOnce(200, APPROVAL_RULE_RESPONSE);
......
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