diff --git a/app/components/header.hbs b/app/components/header.hbs index baaf5039264..5b0e4b7b786 100644 --- a/app/components/header.hbs +++ b/app/components/header.hbs @@ -50,7 +50,7 @@ Dashboard - Account Settings + Account Settings Owner Invites - - - - - -
- {{#if this.emailNotificationsError}} -
- An error occurred while saving your email preferences. -
- {{/if}} - {{#if this.emailNotificationsSuccess}} -
- Your email notification preferences have been updated! -
- {{/if}} -
- -
-
- {{else}} -

- To aid detection of unauthorized crate changes, we plan to email you each time a new version of a crate you own is - pushed. This feature is still work-in-progress, if you want to help out have a look at - #1895. -

- {{/if}} - - - \ No newline at end of file diff --git a/app/templates/settings/email-notifications.hbs b/app/templates/settings/email-notifications.hbs new file mode 100644 index 00000000000..99f97ee3529 --- /dev/null +++ b/app/templates/settings/email-notifications.hbs @@ -0,0 +1,52 @@ +{{page-title 'Settings'}} + + + + +
+

Email Notification Preferences

+ + {{#if this.hasEmailNotificationFeature}} +

+ To aid detection of unauthorized crate changes, we email you each time a new version of a crate you own is pushed. + By receiving and reading these emails, you help protect the Rust ecosystem. You may also choose to turn these + emails off for any of your crates listed below. +

+ +
+ + +
+ +
    + {{#each this.ownedCrates as |ownedCrate|}} +
  • + +
  • + {{/each}} +
+ +
+ {{#if this.emailNotificationsError}} +
+ An error occurred while saving your email preferences. +
+ {{/if}} + {{#if this.emailNotificationsSuccess}} +
+ Your email notification preferences have been updated! +
+ {{/if}} +
+ +
+
+ {{else}} +

+ To aid detection of unauthorized crate changes, we plan to email you each time a new version of a crate you own is + pushed. This feature is still work-in-progress, if you want to help out have a look at + #1895. +

+ {{/if}} +
+
\ No newline at end of file diff --git a/app/templates/settings/profile.hbs b/app/templates/settings/profile.hbs new file mode 100644 index 00000000000..bdbb1372483 --- /dev/null +++ b/app/templates/settings/profile.hbs @@ -0,0 +1,34 @@ +{{page-title 'Settings'}} + + + + +
+

Profile Information

+ +
+ + +
+
Name
+
{{ this.model.user.name }}
+
GitHub Account
+
{{ this.model.user.login }}
+
+
+ +

+ To update your name and GitHub account, change them in your GitHub profile, then sign out and login again to + crates.io. + You cannot change these settings directly on crates.io, but we accept whatever values come from GitHub. +

+
+ +
+

User Email

+ +
+
\ No newline at end of file diff --git a/app/templates/settings/tokens.hbs b/app/templates/settings/tokens.hbs new file mode 100644 index 00000000000..c02b0fce5bb --- /dev/null +++ b/app/templates/settings/tokens.hbs @@ -0,0 +1,7 @@ +{{page-title 'Settings'}} + + + + + + \ No newline at end of file diff --git a/tests/acceptance/api-token-test.js b/tests/acceptance/api-token-test.js index e501d6d3f88..decfedb117c 100644 --- a/tests/acceptance/api-token-test.js +++ b/tests/acceptance/api-token-test.js @@ -39,8 +39,8 @@ module('Acceptance | api-tokens', function (hooks) { test('/me is showing the list of active API tokens', async function (assert) { prepare(this); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/tokens'); + assert.equal(currentURL(), '/settings/tokens'); assert.dom('[data-test-api-token]').exists({ count: 2 }); let [row1, row2] = findAll('[data-test-api-token]'); @@ -66,8 +66,8 @@ module('Acceptance | api-tokens', function (hooks) { test('API tokens can be revoked', async function (assert) { prepare(this); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/tokens'); + assert.equal(currentURL(), '/settings/tokens'); assert.dom('[data-test-api-token]').exists({ count: 2 }); await click('[data-test-api-token="1"] [data-test-revoke-token-button]'); @@ -85,8 +85,8 @@ module('Acceptance | api-tokens', function (hooks) { return new Response(500, {}, {}); }); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/tokens'); + assert.equal(currentURL(), '/settings/tokens'); assert.dom('[data-test-api-token]').exists({ count: 2 }); await click('[data-test-api-token="1"] [data-test-revoke-token-button]'); @@ -99,8 +99,8 @@ module('Acceptance | api-tokens', function (hooks) { test('new API tokens can be created', async function (assert) { prepare(this); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/tokens'); + assert.equal(currentURL(), '/settings/tokens'); assert.dom('[data-test-api-token]').exists({ count: 2 }); assert.dom('[data-test-focused-input]').doesNotExist(); assert.dom('[data-test-save-token-button]').doesNotExist(); diff --git a/tests/acceptance/email-change-test.js b/tests/acceptance/email-change-test.js index 0a0aefb136c..c83f9088a45 100644 --- a/tests/acceptance/email-change-test.js +++ b/tests/acceptance/email-change-test.js @@ -13,8 +13,8 @@ module('Acceptance | Email Change', function (hooks) { this.authenticateAs(user); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/profile'); + assert.equal(currentURL(), '/settings/profile'); assert.dom('[data-test-email-input]').exists(); assert.dom('[data-test-email-input] [data-test-no-email]').doesNotExist(); assert.dom('[data-test-email-input] [data-test-email-address]').includesText('old@email.com'); @@ -54,8 +54,8 @@ module('Acceptance | Email Change', function (hooks) { this.authenticateAs(user); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/profile'); + assert.equal(currentURL(), '/settings/profile'); assert.dom('[data-test-email-input]').exists(); assert.dom('[data-test-email-input] [data-test-no-email]').exists(); assert.dom('[data-test-email-input] [data-test-email-address]').hasText(''); @@ -91,7 +91,7 @@ module('Acceptance | Email Change', function (hooks) { this.authenticateAs(user); - await visit('/me'); + await visit('/settings/profile'); await click('[data-test-email-input] [data-test-edit-button]'); await fillIn('[data-test-email-input] [data-test-input]', 'new@email.com'); assert.dom('[data-test-email-input] [data-test-invalid-email-warning]').doesNotExist(); @@ -115,7 +115,7 @@ module('Acceptance | Email Change', function (hooks) { this.server.put('/api/v1/users/:user_id', {}, 500); - await visit('/me'); + await visit('/settings/profile'); await click('[data-test-email-input] [data-test-edit-button]'); await fillIn('[data-test-email-input] [data-test-input]', 'new@email.com'); @@ -138,8 +138,8 @@ module('Acceptance | Email Change', function (hooks) { this.authenticateAs(user); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/profile'); + assert.equal(currentURL(), '/settings/profile'); assert.dom('[data-test-email-input]').exists(); assert.dom('[data-test-email-input] [data-test-email-address]').includesText('john@doe.com'); assert.dom('[data-test-email-input] [data-test-verified]').doesNotExist(); @@ -158,8 +158,8 @@ module('Acceptance | Email Change', function (hooks) { this.server.put('/api/v1/users/:user_id/resend', {}, 500); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/profile'); + assert.equal(currentURL(), '/settings/profile'); assert.dom('[data-test-email-input]').exists(); assert.dom('[data-test-email-input] [data-test-email-address]').includesText('john@doe.com'); assert.dom('[data-test-email-input] [data-test-verified]').doesNotExist(); diff --git a/tests/bugs/2329-test.js b/tests/bugs/2329-test.js index d3f10684254..28c8539f2aa 100644 --- a/tests/bugs/2329-test.js +++ b/tests/bugs/2329-test.js @@ -56,8 +56,8 @@ module('Bug #2329', function (hooks) { // 6. Use the menu to navigate to "Account Settings". await click('[data-test-user-menu]'); await click('[data-test-me-link]'); - await visit('/me'); - assert.equal(currentURL(), '/me'); + await visit('/settings/email-notifications'); + assert.equal(currentURL(), '/settings/email-notifications'); // 7. Observe that there are no crates listed under "Email Notification Preferences". // Observe that no request was sent to the /api/v1/me endpoint to obtain this data.