diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2022-09-27 09:31:08 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-09-29 20:03:14 +0000 |
commit | 570bf526d9488a1a88248f27c1a3beb7457796d3 (patch) | |
tree | b4b90edd3626280023bc851454ce6693a2584eb5 /server/sonar-web/src/main/js/api | |
parent | e5af59abec703dc1ba1049c7a0d33399a2bbd46f (diff) | |
download | sonarqube-570bf526d9488a1a88248f27c1a3beb7457796d3.tar.gz sonarqube-570bf526d9488a1a88248f27c1a3beb7457796d3.zip |
SONAR-17188 SONAR-17189 Generate a global analysis token when following the Azure DevOps Pipelines tutorial
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts b/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts index a50e62582ce..9a10d6e29e0 100644 --- a/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { cloneDeep } from 'lodash'; +import { cloneDeep, last } from 'lodash'; import { mockUserToken } from '../../helpers/mocks/token'; import { NewUserToken, TokenType, UserToken } from '../../types/token'; import { generateToken, getTokens, revokeToken } from '../user-tokens'; @@ -100,6 +100,10 @@ export default class UserTokensMock { return cloneDeep(this.tokens); }; + getLastToken = () => { + return last(this.getTokens()); + }; + reset = () => { this.tokens = cloneDeep(defaultTokens); }; |