Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f7c9d1ab
Commit
f7c9d1ab
authored
Oct 20, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused error argument
parent
3d7f860b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
ee/app/assets/javascripts/vue_shared/license_compliance/store/actions.js
...avascripts/vue_shared/license_compliance/store/actions.js
+8
-8
ee/spec/frontend/vue_shared/license_compliance/store/actions_spec.js
...ntend/vue_shared/license_compliance/store/actions_spec.js
+7
-9
No files found.
ee/app/assets/javascripts/vue_shared/license_compliance/store/actions.js
View file @
f7c9d1ab
...
...
@@ -31,8 +31,8 @@ export const receiveDeleteLicense = ({ commit, dispatch }, id) => {
dispatch
(
'
removePendingLicense
'
,
id
);
});
};
export
const
receiveDeleteLicenseError
=
({
commit
}
,
error
)
=>
{
commit
(
types
.
RECEIVE_DELETE_LICENSE_ERROR
,
error
);
export
const
receiveDeleteLicenseError
=
({
commit
})
=>
{
commit
(
types
.
RECEIVE_DELETE_LICENSE_ERROR
);
};
export
const
deleteLicense
=
({
dispatch
,
state
})
=>
{
const
licenseId
=
state
.
currentLicenseInModal
.
id
;
...
...
@@ -43,8 +43,8 @@ export const deleteLicense = ({ dispatch, state }) => {
.
then
(()
=>
{
dispatch
(
'
receiveDeleteLicense
'
,
licenseId
);
})
.
catch
((
error
)
=>
{
dispatch
(
'
receiveDeleteLicenseError
'
,
error
);
.
catch
(()
=>
{
dispatch
(
'
receiveDeleteLicenseError
'
);
dispatch
(
'
removePendingLicense
'
,
licenseId
);
});
};
...
...
@@ -110,8 +110,8 @@ export const receiveSetLicenseApproval = ({ commit, dispatch, state }, id) => {
dispatch
(
'
removePendingLicense
'
,
id
);
});
};
export
const
receiveSetLicenseApprovalError
=
({
commit
}
,
error
)
=>
{
commit
(
types
.
RECEIVE_SET_LICENSE_APPROVAL_ERROR
,
error
);
export
const
receiveSetLicenseApprovalError
=
({
commit
})
=>
{
commit
(
types
.
RECEIVE_SET_LICENSE_APPROVAL_ERROR
);
};
export
const
fetchLicenseCheckApprovalRule
=
({
dispatch
,
state
})
=>
{
...
...
@@ -188,8 +188,8 @@ export const setLicenseApproval = ({ dispatch, state }, payload) => {
.
then
(()
=>
{
dispatch
(
'
receiveSetLicenseApproval
'
,
id
);
})
.
catch
((
error
)
=>
{
dispatch
(
'
receiveSetLicenseApprovalError
'
,
error
);
.
catch
(()
=>
{
dispatch
(
'
receiveSetLicenseApprovalError
'
);
dispatch
(
'
removePendingLicense
'
,
id
);
});
};
...
...
ee/spec/frontend/vue_shared/license_compliance/store/actions_spec.js
View file @
f7c9d1ab
...
...
@@ -129,12 +129,11 @@ describe('License store actions', () => {
describe
(
'
receiveDeleteLicenseError
'
,
()
=>
{
it
(
'
commits RECEIVE_DELETE_LICENSE_ERROR
'
,
(
done
)
=>
{
const
error
=
new
Error
(
'
Test
'
);
testAction
(
actions
.
receiveDeleteLicenseError
,
error
,
null
,
state
,
[{
type
:
mutationTypes
.
RECEIVE_DELETE_LICENSE_ERROR
,
payload
:
error
}],
[{
type
:
mutationTypes
.
RECEIVE_DELETE_LICENSE_ERROR
}],
[],
)
.
then
(
done
)
...
...
@@ -171,7 +170,7 @@ describe('License store actions', () => {
return
actions
.
deleteLicense
(
store
).
then
(()
=>
{
expectDispatched
(
'
addPendingLicense
'
,
licenseId
);
expectDispatched
(
'
receiveDeleteLicenseError
'
,
expect
.
any
(
Error
)
);
expectDispatched
(
'
receiveDeleteLicenseError
'
);
expectDispatched
(
'
removePendingLicense
'
,
licenseId
);
});
});
...
...
@@ -205,12 +204,11 @@ describe('License store actions', () => {
describe
(
'
receiveSetLicenseApprovalError
'
,
()
=>
{
it
(
'
commits RECEIVE_SET_LICENSE_APPROVAL_ERROR
'
,
(
done
)
=>
{
const
error
=
new
Error
(
'
Test
'
);
testAction
(
actions
.
receiveSetLicenseApprovalError
,
error
,
null
,
state
,
[{
type
:
mutationTypes
.
RECEIVE_SET_LICENSE_APPROVAL_ERROR
,
payload
:
error
}],
[{
type
:
mutationTypes
.
RECEIVE_SET_LICENSE_APPROVAL_ERROR
}],
[],
)
.
then
(
done
)
...
...
@@ -254,7 +252,7 @@ describe('License store actions', () => {
return
actions
.
setLicenseApproval
(
store
,
{
license
:
newLicense
,
newStatus
}).
then
(()
=>
{
expectDispatched
(
'
addPendingLicense
'
,
undefined
);
expectDispatched
(
'
receiveSetLicenseApprovalError
'
,
expect
.
any
(
Error
)
);
expectDispatched
(
'
receiveSetLicenseApprovalError
'
);
expectDispatched
(
'
removePendingLicense
'
,
undefined
);
});
});
...
...
@@ -297,7 +295,7 @@ describe('License store actions', () => {
.
setLicenseApproval
(
store
,
{
license
:
approvedLicense
,
newStatus
})
.
then
(()
=>
{
expectDispatched
(
'
addPendingLicense
'
,
approvedLicense
.
id
);
expectDispatched
(
'
receiveSetLicenseApprovalError
'
,
expect
.
any
(
Error
)
);
expectDispatched
(
'
receiveSetLicenseApprovalError
'
);
expectDispatched
(
'
removePendingLicense
'
,
approvedLicense
.
id
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment