File tree 2 files changed +0
-52
lines changed
2 files changed +0
-52
lines changed Original file line number Diff line number Diff line change 4
4
<button
5
5
type =" button"
6
6
local-class =" new-token-button"
7
- disabled ={{ this.newToken }}
8
7
data-test-new-token-button
9
8
{{ on " click" this.startNewToken }}
10
9
>
33
32
environment variable, but make sure that the token stays secret!
34
33
</p >
35
34
36
- {{ #if this.newToken }}
37
- <form local-class =" new-token-form" {{ on " submit" (prevent-default (perform this.saveTokenTask ))}} >
38
- <Input
39
- @type =" text"
40
- placeholder =" New token name"
41
- aria-label =" New token name"
42
- disabled ={{ this.newToken.isSaving }}
43
- @value ={{ this.newToken.name }}
44
- local-class =" input"
45
- data-test-focused-input
46
- {{ auto-focus }}
47
- />
48
-
49
- <div local-class =" actions" >
50
- <button
51
- type =" submit"
52
- local-class =" save-button"
53
- disabled ={{ or this.newToken.isSaving (not this.newToken.name )}}
54
- title ={{ unless this.newToken.name " You must specify a name" }}
55
- data-test-save-token-button
56
- >
57
- Create
58
- </button >
59
- {{ #if this.newToken.isSaving }}
60
- <LoadingSpinner local-class =" spinner" data-test-saving-spinner />
61
- {{ /if }}
62
- </div >
63
- </form >
64
- {{ /if }}
65
-
66
35
{{ #if this.sortedTokens }}
67
36
<ul role =" list" local-class =" token-list" >
68
37
{{ #each this.sortedTokens as |token |}}
168
137
<button
169
138
type =" button"
170
139
local-class =" empty-state-button"
171
- disabled ={{ this.newToken }}
172
140
data-test-empty-state-button
173
141
{{ on " click" this.startNewToken }}
174
142
>
Original file line number Diff line number Diff line change 1
1
import { action } from '@ember/object' ;
2
2
import { inject as service } from '@ember/service' ;
3
3
import Component from '@glimmer/component' ;
4
- import { tracked } from '@glimmer/tracking' ;
5
4
6
5
import { task } from 'ember-concurrency' ;
7
6
@@ -12,8 +11,6 @@ export default class ApiTokens extends Component {
12
11
@service notifications ;
13
12
@service router ;
14
13
15
- @tracked newToken ;
16
-
17
14
scopeDescription = scopeDescription ;
18
15
patternDescription = patternDescription ;
19
16
@@ -30,23 +27,6 @@ export default class ApiTokens extends Component {
30
27
this . router . transitionTo ( 'settings.tokens.new' ) ;
31
28
}
32
29
33
- saveTokenTask = task ( async ( ) => {
34
- let token = this . newToken ;
35
-
36
- try {
37
- await token . save ( ) ;
38
- this . args . tokens . unshift ( token ) ;
39
- this . newToken = undefined ;
40
- } catch ( error ) {
41
- let msg =
42
- error . errors && error . errors [ 0 ] && error . errors [ 0 ] . detail
43
- ? `An error occurred while saving this token, ${ error . errors [ 0 ] . detail } `
44
- : 'An unknown error occurred while saving this token' ;
45
-
46
- this . notifications . error ( msg ) ;
47
- }
48
- } ) ;
49
-
50
30
revokeTokenTask = task ( async token => {
51
31
try {
52
32
await token . destroyRecord ( ) ;
You can’t perform that action at this time.
0 commit comments