added translations for create/join organization and migrated to use Dockerfile

This commit is contained in:
Ronald A. Richardson
2024-02-15 23:11:20 +07:00
parent 2a2c7d8426
commit af4507cc87
5 changed files with 73 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
/**
* Controller responsible for handling two-factor authentication.
* @class AuthTwoFaController
@@ -53,6 +54,8 @@ export default class AuthTwoFaController extends Controller {
/**
* The current 2FA identity in memory
* @property {string} identity
* @tracked
*/
@tracked identity;

View File

@@ -51,6 +51,13 @@ export default class ConsoleController extends Controller {
*/
@service router;
/**
* Inject the `intl` service.
*
* @var {Service}
*/
@service intl;
/**
* Inject the `universe` service.
*
@@ -205,8 +212,8 @@ export default class ConsoleController extends Controller {
const country = this.currentUser.country;
this.modalsManager.show('modals/create-or-join-org', {
title: 'Create or join a organization',
acceptButtonText: 'Confirm',
title: this.intl.t('console.create-or-join-organization.modal-title'),
acceptButtonText: this.intl.t('common.confirm'),
acceptButtonIcon: 'check',
acceptButtonIconPrefix: 'fas',
action: 'join',
@@ -226,12 +233,21 @@ export default class ConsoleController extends Controller {
const { action, next, name, description, phone, currency, country, timezone } = modal.getOptions();
if (action === 'join') {
return this.fetch.post('auth/join-organization', { next }).then(() => {
return this.fetch
.post('auth/join-organization', { next })
.then(() => {
this.fetch.flushRequestCache('auth/organizations');
this.notifications.success('You have joined a new organization!');
setTimeout(() => {
this.notifications.success(this.intl.t('console.create-or-join-organization.join-success-notification'));
later(
this,
() => {
window.location.reload();
}, 900);
},
900
);
})
.catch((error) => {
this.notifications.serverError(error);
});
}
@@ -246,7 +262,7 @@ export default class ConsoleController extends Controller {
})
.then(() => {
this.fetch.flushRequestCache('auth/organizations');
this.notifications.success('You have created a new organization!');
this.notifications.success(this.intl.t('console.create-or-join-organization.create-success-notification'));
later(
this,
() => {
@@ -254,6 +270,9 @@ export default class ConsoleController extends Controller {
},
900
);
})
.catch((error) => {
this.notifications.serverError(error);
});
},
});
@@ -270,9 +289,9 @@ export default class ConsoleController extends Controller {
}
this.modalsManager.confirm({
title: `Are you sure you want to switch organization to ${organization.name}?`,
body: `By confirming your account will remain logged in, but your primary organization will be switched.`,
acceptButtonText: `Yes, I want to switch organization`,
title: this.intl.t('console.switch-organization.modal-title', { organizationName: organization.name }),
body: this.intl.t('console.switch-organization.modal-body'),
acceptButtonText: this.intl.t('console.switch-organization.modal-accept-button-text'),
acceptButtonScheme: 'primary',
confirm: (modal) => {
modal.startLoading();
@@ -281,10 +300,14 @@ export default class ConsoleController extends Controller {
.post('auth/switch-organization', { next: organization.uuid })
.then(() => {
this.fetch.flushRequestCache('auth/organizations');
this.notifications.success('You have switched organizations');
setTimeout(() => {
this.notifications.success(this.intl.t('console.switch-organization.success-notification'));
later(
this,
() => {
window.location.reload();
}, 900);
},
900
);
})
.catch((error) => {
this.notifications.serverError(error);
@@ -295,8 +318,8 @@ export default class ConsoleController extends Controller {
@action viewChangelog() {
this.modalsManager.show('modals/changelog', {
title: 'Changelog',
acceptButtonText: 'OK',
title: this.intl.t('common.changelog'),
acceptButtonText: this.intl.t('common.ok'),
hideDeclineButton: true,
});
}

View File

@@ -10,8 +10,8 @@
<FaIcon @icon="check-circle" @size="lg" class="text-green-900 mr-4" />
</div>
<p class="flex-1 text-sm text-green-900 dark:text-green-900">
<strong>Check your {{this.selectedMethod}}</strong><br />
We've sent you a verification code. Enter the code below to complete the login process.
<strong>{{t "auth.two-fa.verify-code.check-title"}}</strong><br />
{{t "auth.two-fa.verify-code.check-subtitle"}}
</p>
</div>
@@ -26,22 +26,22 @@
{{/if}}
{{#if this.isCodeExpired}}
<InfoBlock>
<div>Your 2FA authentication code has expired. You can request another code if you need more time.</div>
<Button @type="primary" @wrapperClass="mt-2" @text="Resend Code" @icon="arrow-rotate-right" @onClick={{this.resendCode}} />
<div>{{t "auth.two-fa.verify-code.expired-help-text"}}</div>
<Button @type="primary" @wrapperClass="mt-2" @text={{t "auth.two-fa.verify-code.resend-code"}} @icon="arrow-rotate-right" @onClick={{this.resendCode}} />
</InfoBlock>
{{/if}}
</div>
<div class="mt-4">
<Button @buttonType="submit" @type="primary" @text="Verify Code" @icon="check-circle" @wrapperClass="btn-block" @isLoading={{this.isLoading}} />
<Button @buttonType="submit" @type="primary" @text={{t "auth.two-fa.verify-code.verify-code"}} @icon="check-circle" @wrapperClass="btn-block" @isLoading={{this.isLoading}} />
</div>
<div class="text-center flex flex-row items-center justify-center space-x-4 mt-3.5">
<a href="#" class="text-sm text-blue-500 hover:underline inline-block" {{on "click" this.resendCode}}>
Resend Code
{{t "auth.two-fa.verify-code.resend-code"}}
</a>
<a href="#" class="text-sm text-danger hover:underline inline-block" {{on "click" this.cancelTwoFactor}}>
Cancel Two-Factor
{{t "auth.two-fa.verify-code.cancel-two-factor"}}
</a>
</div>
</form>

View File

@@ -13,6 +13,7 @@ terms:
search: Search
search-input: Search Input
common:
confirm: Confirm
edit: Edit
save: Save
cancel: Cancel
@@ -56,6 +57,8 @@ common:
status: Status
close-and-save: Close and Save
users: Users
changelog: Changelog
ok: OK
component:
file:
dropdown-label: File actions
@@ -124,6 +127,13 @@ auth:
send-by-sms: Send by SMS
two-fa:
verify-code:
verification-code: Verification Code
check-title: Check your email or phone
check-subtitle: We've sent you a verification code. Enter the code below to complete the login process.
expired-help-text: Your 2FA authentication code has expired. You can request another code if you need more time.
resend-code: Resend Code
verify-code: Verify Code
cancel-two-factor: Cancel Two-Factor
invalid-session-error-notification: Invalid session. Please try again.
verification-successful-notification: Verification successful!
verification-code-expired-notification: Verification code has expired. Please request a new one.
@@ -175,6 +185,15 @@ auth:
submit-button: Reset Password
back-button: Back
console:
create-or-join-organization:
modal-title: Create or join a organization
join-success-notification: You have joined a new organization!
create-success-notification: You have created a new organization!
switch-organization:
modal-title: Are you sure you want to switch organization to {organizationName}?
modal-body: By confirming your account will remain logged in, but your primary organization will be switched.
modal-accept-button-text: Yes, I want to switch organization
success-notification: You have switched organizations
account:
index:
upload-new: Upload new

View File

@@ -1,9 +1,9 @@
# syntax = docker/dockerfile:1.2
# Base stage
FROM dunglas/frankenphp:sha-7454826-php8.2-alpine as base
FROM dunglas/frankenphp:1.1.0-php8.2-bookworm as base
# Install packages
RUN apk update && apk add git openssh bind-tools mycli nodejs npm \
RUN apt-get update && apt-get install -y git bind9-utils mycli nodejs npm \
&& mkdir -p /root/.ssh \
&& ssh-keyscan github.com >> /root/.ssh/known_hosts