Skip to content

Commit

Permalink
fix: fixed linting, bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Apr 23, 2024
1 parent fd2abc3 commit f2dee72
Show file tree
Hide file tree
Showing 12 changed files with 2,841 additions and 361 deletions.
4 changes: 3 additions & 1 deletion app/controllers/web/my-account/create-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ async function createAlias(ctx, next) {
return ctx.throw(Boom.notFound(ctx.translateError('INVALID_USER')));

if (member.group === 'user')
return ctx.throw(Boom.notFound(ctx.translateError('UBUNTU_PERMISSIONS')));
return ctx.throw(
Boom.notFound(ctx.translateError('UBUNTU_PERMISSIONS'))
);
}

try {
Expand Down
10 changes: 8 additions & 2 deletions app/controllers/web/my-account/validate-alias.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const slug = require('speakingurl');
const splitLines = require('split-lines');
const striptags = require('striptags');
const { boolean } = require('boolean');
const { isEmail } = require('validator');

// eslint-disable-next-line complexity
function validateAlias(ctx, next) {
Expand Down Expand Up @@ -117,8 +118,13 @@ function validateAlias(ctx, next) {
if (member.group === 'user' && body.has_imap)
return ctx.throw(Boom.notFound(ctx.translateError('UBUNTU_PERMISSIONS')));

if (_.isArray(body.recipients) && body.recipients.some(r => isEmail(r) && r.endsWith('@ubuntu.com')))
return ctx.throw(Boom.notFound(ctx.translateError('UBUNTU_NOT_ALLOWED_EMAIL')));
if (
_.isArray(body.recipients) &&
body.recipients.some((r) => isEmail(r) && r.endsWith('@ubuntu.com'))
)
return ctx.throw(
Boom.notFound(ctx.translateError('UBUNTU_NOT_ALLOWED_EMAIL'))
);
}

ctx.state.body = body;
Expand Down
6 changes: 3 additions & 3 deletions app/views/ubuntu.pug
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ block body
img(
src=manifest("img/ubuntu.svg"),
width=274,
height=100
height=100,
alt=t("Canonical Ubuntu")
)
h1.h2.ubuntu-font.my-3= t("Log in with your Ubuntu account")
.alert.alert-info.ubuntu-font
= t("Manage email forwarding for your @ubuntu.com email address.")
form(action='/auth/ubuntu', method="POST")
form(action="/auth/ubuntu", method="POST")
.form-group.floating-label
input#input-email.form-control.form-control-lg.ubuntu-font(
type="email",
Expand All @@ -29,5 +29,5 @@ block body
value="[email protected]",
placeholder="[email protected]"
)
label(for="input-email").ubuntu-font= t("Your Ubuntu Account Email")
label.ubuntu-font(for="input-email")= t("Your Ubuntu Account Email")
button.btn.btn-dark.btn-lg.ubuntu-font(type="submit")= t("Continue")
9 changes: 6 additions & 3 deletions config/phrases.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ for (const key of Object.keys(statuses.message)) {
}

module.exports = {
UBUNTU_NOT_ALLOWED_EMAIL: 'You cannot use an @ubuntu.com email address as a forwarding recipient email address.',
UBUNTU_PERMISSIONS: 'You can only read or manage your existing @ubuntu.com aliases, not create new ones.',
UBUNTU_MAX_LIMIT: 'You cannot have more than 3 aliases for the @ubuntu.com domain.',
UBUNTU_NOT_ALLOWED_EMAIL:
'You cannot use an @ubuntu.com email address as a forwarding recipient email address.',
UBUNTU_PERMISSIONS:
'You can only read or manage your existing @ubuntu.com aliases, not create new ones.',
UBUNTU_MAX_LIMIT:
'You cannot have more than 3 aliases for the @ubuntu.com domain.',
UBUNTU_INVALID_USERNAME:
'Ubuntu username was missing or not detected, please try again later.',
UBUNTU_API_RESPONSE_INVALID:
Expand Down
3,153 changes: 2,811 additions & 342 deletions locales/da.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4803,5 +4803,5 @@
"Ubuntu username was missing or not detected, please try again later.": "Le nom d'utilisateur Ubuntu était manquant ou n'était pas détecté, veuillez réessayer plus tard.",
"Invalid response from Ubuntu Launchpad API, please try again later.": "Réponse invalide de l'API Ubuntu Launchpad, veuillez réessayer plus tard.",
"You must be a member of the Launchpad.net group ~ubuntumembers to get access to an @ubuntu.com email address.": "Vous devez être membre du groupe Launchpad.net ~ubuntumembers pour accéder à une adresse e-mail @ubuntu.com.",
"You <strong>must delete</strong> these <span class=\"notranslate\">%d</span> records <strong class=\"text-decoration-underline\">before you continue</strong>:": "You <strong>must delete</strong> these <span class=\"notranslate\">%d</span> records <strong class=\"text-decoration-underline\">before you continue</strong>:"
"You <strong>must delete</strong> these <span class=\"notranslate\">%d</span> records <strong class=\"text-decoration-underline\">before you continue</strong>:": "Vous <strong>devez supprimer</strong> ces <span class=\"notranslate\">%d</span> enregistrements <strong class=\"text-decoration-underline\">avant de continuer</strong> :"
}
2 changes: 1 addition & 1 deletion locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4809,5 +4809,5 @@
"Ubuntu username was missing or not detected, please try again later.": "Tên người dùng Ubuntu bị thiếu hoặc không được phát hiện, vui lòng thử lại sau.",
"Invalid response from Ubuntu Launchpad API, please try again later.": "Phản hồi không hợp lệ từ API Ubuntu Launchpad, vui lòng thử lại sau.",
"You must be a member of the Launchpad.net group ~ubuntumembers to get access to an @ubuntu.com email address.": "Bạn phải là thành viên của nhóm Launchpad.net ~ubuntumembers để có quyền truy cập vào địa chỉ email @ubuntu.com.",
"You <strong>must delete</strong> these <span class=\"notranslate\">%d</span> records <strong class=\"text-decoration-underline\">before you continue</strong>:": "You <strong>must delete</strong> these <span class=\"notranslate\">%d</span> records <strong class=\"text-decoration-underline\">before you continue</strong>:"
"You <strong>must delete</strong> these <span class=\"notranslate\">%d</span> records <strong class=\"text-decoration-underline\">before you continue</strong>:": "Bạn <strong>phải xóa</strong> các bản ghi <span class=\"notranslate\">%d</span> này <strong class=\"text-decoration-underline\">trước khi tiếp tục</strong> :"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"@ladjs/koa-simple-ratelimit": "4.1.1",
"@ladjs/mongoose": "6.0.1",
"@ladjs/mongoose-error-messages": "1.0.0",
"@ladjs/passport": "5.1.3",
"@ladjs/passport": "5.1.4",
"@ladjs/pick-original": "1.0.0",
"@ladjs/policies": "12.1.0",
"@ladjs/proxy": "4.0.1",
"@ladjs/redis": "1.1.1",
"@ladjs/shared-config": "9.1.4",
"@ladjs/web": "21.0.18",
"@ladjs/web": "21.0.19",
"@mermaid-js/mermaid-cli": "10.8.0",
"@octokit/core": "4.2.4",
"@openpgp/wkd-client": "0.0.4",
Expand Down
8 changes: 4 additions & 4 deletions test/web/snapshots/index.js.md

Large diffs are not rendered by default.

Binary file modified test/web/snapshots/index.js.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions test/web/snapshots/otp.js.md

Large diffs are not rendered by default.

Binary file modified test/web/snapshots/otp.js.snap
Binary file not shown.

0 comments on commit f2dee72

Please sign in to comment.