Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
4bf6e14129
commit
5a8e0350c7
|
@ -101,6 +101,10 @@ export default {
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
createFlash({ message: error });
|
createFlash({ message: error });
|
||||||
|
} finally {
|
||||||
|
if (this.jobTokenScopeEnabled) {
|
||||||
|
this.getProjects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async addProject() {
|
async addProject() {
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
module Mutations
|
module Mutations
|
||||||
module Issues
|
module Issues
|
||||||
class SetConfidential < Base
|
class SetConfidential < Base
|
||||||
|
include Mutations::SpamProtection
|
||||||
|
|
||||||
graphql_name 'IssueSetConfidential'
|
graphql_name 'IssueSetConfidential'
|
||||||
|
|
||||||
argument :confidential,
|
argument :confidential,
|
||||||
|
@ -19,6 +21,7 @@ module Mutations
|
||||||
|
|
||||||
::Issues::UpdateService.new(project: project, current_user: current_user, params: { confidential: confidential }, spam_params: spam_params)
|
::Issues::UpdateService.new(project: project, current_user: current_user, params: { confidential: confidential }, spam_params: spam_params)
|
||||||
.execute(issue)
|
.execute(issue)
|
||||||
|
check_spam_action_response!(issue)
|
||||||
|
|
||||||
{
|
{
|
||||||
issue: issue,
|
issue: issue,
|
||||||
|
|
|
@ -29,11 +29,11 @@ For examples of how you can use a project access token to authenticate with the
|
||||||
1. Navigate to the project you would like to create an access token for.
|
1. Navigate to the project you would like to create an access token for.
|
||||||
1. In the **Settings** menu choose **Access Tokens**.
|
1. In the **Settings** menu choose **Access Tokens**.
|
||||||
1. Choose a name and optional expiry date for the token.
|
1. Choose a name and optional expiry date for the token.
|
||||||
1. Choose the access level the token should have in the project.
|
1. Choose a role for the token.
|
||||||
1. Choose the [desired scopes](#limiting-scopes-of-a-project-access-token).
|
1. Choose the [desired scopes](#limiting-scopes-of-a-project-access-token).
|
||||||
1. Click the **Create project access token** button.
|
1. Click the **Create project access token** button.
|
||||||
1. Save the project access token somewhere safe. Once you leave or refresh
|
1. Save the project access token somewhere safe. Once you leave or refresh
|
||||||
the page, you won't be able to access it again.
|
the page, you don't have access to it again.
|
||||||
|
|
||||||
## Project bot users
|
## Project bot users
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ describe('TokenAccess component', () => {
|
||||||
expect(findTokenSection().exists()).toBe(false);
|
expect(findTokenSection().exists()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('switching the toggle calls the mutation', async () => {
|
it('switching the toggle calls the mutation and fetches the projects again', async () => {
|
||||||
createComponent([
|
createComponent([
|
||||||
[getCIJobTokenScopeQuery, disabledJobTokenScopeHandler],
|
[getCIJobTokenScopeQuery, disabledJobTokenScopeHandler],
|
||||||
[updateCIJobTokenScopeMutation, updateJobTokenScopeHandler],
|
[updateCIJobTokenScopeMutation, updateJobTokenScopeHandler],
|
||||||
|
@ -117,11 +117,16 @@ describe('TokenAccess component', () => {
|
||||||
|
|
||||||
await waitForPromises();
|
await waitForPromises();
|
||||||
|
|
||||||
|
expect(getProjectsWithScope).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
findToggle().vm.$emit('change', true);
|
findToggle().vm.$emit('change', true);
|
||||||
|
|
||||||
|
await waitForPromises();
|
||||||
|
|
||||||
expect(updateJobTokenScopeHandler).toHaveBeenCalledWith({
|
expect(updateJobTokenScopeHandler).toHaveBeenCalledWith({
|
||||||
input: { fullPath: projectPath, jobTokenScopeEnabled: true },
|
input: { fullPath: projectPath, jobTokenScopeEnabled: true },
|
||||||
});
|
});
|
||||||
|
expect(getProjectsWithScope).toHaveBeenCalledTimes(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue