Skip to content

Commit 6171b05

Browse files
committed
Settings::ApiTokens: Move <form> out of the token list
1 parent 389a183 commit 6171b05

File tree

2 files changed

+36
-31
lines changed

2 files changed

+36
-31
lines changed

app/components/settings/api-tokens.hbs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,38 @@
2323
token when prompted.
2424
</p>
2525

26-
<div local-class="token-list">
27-
{{#if this.newToken}}
28-
<form local-class="row create-token" {{on "submit" (prevent-default (perform this.saveTokenTask))}}>
29-
<div local-class="name">
30-
<Input
31-
@type="text"
32-
placeholder="New token name"
33-
aria-label="New token name"
34-
disabled={{this.newToken.isSaving}}
35-
@value={{this.newToken.name}}
36-
data-test-focused-input
37-
{{auto-focus}}
38-
/>
39-
</div>
26+
{{#if this.newToken}}
27+
<form local-class="new-token-form" {{on "submit" (prevent-default (perform this.saveTokenTask))}}>
28+
<div local-class="name">
29+
<Input
30+
@type="text"
31+
placeholder="New token name"
32+
aria-label="New token name"
33+
disabled={{this.newToken.isSaving}}
34+
@value={{this.newToken.name}}
35+
data-test-focused-input
36+
{{auto-focus}}
37+
/>
38+
</div>
4039

41-
<div local-class="actions">
42-
<button
43-
type="submit"
44-
local-class="save-button"
45-
disabled={{or this.newToken.isSaving (not this.newToken.name)}}
46-
title={{unless this.newToken.name "You must specify a name"}}
47-
data-test-save-token-button
48-
>
49-
Create
50-
</button>
51-
{{#if this.newToken.isSaving}}
52-
<LoadingSpinner local-class="spinner" data-test-saving-spinner />
53-
{{/if}}
54-
</div>
55-
</form>
56-
{{/if}}
40+
<div local-class="actions">
41+
<button
42+
type="submit"
43+
local-class="save-button"
44+
disabled={{or this.newToken.isSaving (not this.newToken.name)}}
45+
title={{unless this.newToken.name "You must specify a name"}}
46+
data-test-save-token-button
47+
>
48+
Create
49+
</button>
50+
{{#if this.newToken.isSaving}}
51+
<LoadingSpinner local-class="spinner" data-test-saving-spinner />
52+
{{/if}}
53+
</div>
54+
</form>
55+
{{/if}}
5756

57+
<div local-class="token-list">
5858
{{#each this.sortedTokens as |token|}}
5959
<div local-class="row" data-test-api-token={{token.id}}>
6060
<div local-class="name" data-test-name>

app/components/settings/api-tokens.module.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@
3030
&:last-child { border-bottom-width: 1px; }
3131
}
3232

33-
.create-token {
33+
.new-token-form {
34+
padding: 10px 20px;
35+
display: flex;
36+
align-items: center;
37+
border: 1px solid #d5d3cb;
3438
background-color: var(--main-bg-dark);
39+
margin-bottom: 24px;
3540

3641
.name {
3742
padding-right: 20px;

0 commit comments

Comments
 (0)