mirror of
https://github.com/plankanban/planka.git
synced 2025-12-22 17:25:01 +03:00
feat: Allow setting customer panel URL via environment variables
This commit is contained in:
@@ -44,7 +44,7 @@ const SmtpPane = React.memo(() => {
|
||||
const [data, handleFieldChange] = useForm(() => ({
|
||||
...defaultData,
|
||||
smtpHost: defaultData.smtpHost || '',
|
||||
smtpPort: defaultData.smtpPort || '',
|
||||
smtpPort: defaultData.smtpPort === null ? '' : `${defaultData.smtpPort}`,
|
||||
smtpName: defaultData.smtpName || '',
|
||||
smtpSecure: defaultData.smtpSecure,
|
||||
smtpTlsRejectUnauthorized: defaultData.smtpTlsRejectUnauthorized,
|
||||
|
||||
@@ -19,6 +19,10 @@ import styles from './UserStep.module.scss';
|
||||
const UserStep = React.memo(({ onClose }) => {
|
||||
const isLogouting = useSelector(selectors.selectIsLogouting);
|
||||
|
||||
const customerPanelUrl = useSelector(
|
||||
(state) => selectors.selectBootstrap(state).customerPanelUrl,
|
||||
);
|
||||
|
||||
const withAdministration = useSelector(
|
||||
(state) => selectors.selectCurrentUser(state).role === UserRoles.ADMIN,
|
||||
);
|
||||
@@ -67,12 +71,27 @@ const UserStep = React.memo(({ onClose }) => {
|
||||
})}
|
||||
</Menu.Item>
|
||||
{withAdministration && (
|
||||
<>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleAdministrationClick}>
|
||||
<Icon name="setting" className={styles.menuItemIcon} />
|
||||
{t('common.administration', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
{customerPanelUrl && (
|
||||
<Menu.Item
|
||||
href={customerPanelUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className={styles.menuItem}
|
||||
>
|
||||
<Icon name="shield alternate" className={styles.menuItemIcon} />
|
||||
{t('common.customerPanel', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<hr className={styles.divider} />
|
||||
<Menu.Item
|
||||
|
||||
@@ -135,6 +135,7 @@ export default {
|
||||
customFieldGroups_title: 'مجموعات الحقول المخصصة',
|
||||
customField_title: 'الحقل المخصص',
|
||||
customFields_title: 'الحقول المخصصة',
|
||||
customerPanel_title: 'لوحة العملاء',
|
||||
dangerZone_title: 'منطقة الخطر',
|
||||
date: 'تاريخ',
|
||||
deactivateUser_title: 'إلغاء تفعيل المستخدم',
|
||||
|
||||
@@ -146,6 +146,7 @@ export default {
|
||||
customFieldGroups_title: 'Групи персонализирани полета',
|
||||
customField_title: 'Персонализирано поле',
|
||||
customFields_title: 'Персонализирани полета',
|
||||
customerPanel_title: 'Панел на клиента',
|
||||
dangerZone_title: 'Опасна зона',
|
||||
date: 'Дата',
|
||||
deactivateUser_title: 'Деактивиране на потребител',
|
||||
|
||||
@@ -145,6 +145,7 @@ export default {
|
||||
customFieldGroups_title: 'Grups de camps personalitzats',
|
||||
customField_title: 'Camp personalitzat',
|
||||
customFields_title: 'Camps personalitzats',
|
||||
customerPanel_title: 'Panell del client',
|
||||
dangerZone_title: 'Zona de perill',
|
||||
date: 'Data',
|
||||
deactivateUser_title: 'Desactivar usuari',
|
||||
|
||||
@@ -137,6 +137,7 @@ export default {
|
||||
customFieldGroups_title: 'Skupina vlastních polí',
|
||||
customField_title: 'Vlastní pole',
|
||||
customFields_title: 'Vlastní pole',
|
||||
customerPanel_title: 'Panel zákazníka',
|
||||
dangerZone_title: 'Nebezpečná zóna',
|
||||
date: 'Datum',
|
||||
deactivateUser_title: 'Deaktivace uživatele',
|
||||
|
||||
@@ -141,6 +141,7 @@ export default {
|
||||
customFieldGroups_title: 'Brugerdefinerede feltgrupper',
|
||||
customField_title: 'Brugerdefineret felt',
|
||||
customFields_title: 'Brugerdefinerede felter',
|
||||
customerPanel_title: 'Kundepanel',
|
||||
dangerZone_title: 'Farezone',
|
||||
date: 'Dato',
|
||||
deactivateUser_title: 'Deaktiver bruger',
|
||||
|
||||
@@ -156,6 +156,7 @@ export default {
|
||||
customFieldGroups_title: 'Benutzerdefinierte Feldgruppen',
|
||||
customField_title: 'Feldgruppe',
|
||||
customFields_title: 'Feldgruppen',
|
||||
customerPanel_title: 'Kundenpanel',
|
||||
dangerZone_title: 'Gefahrenbereich',
|
||||
date: 'Datum',
|
||||
deactivateUser_title: 'Benutzer deaktivieren',
|
||||
|
||||
@@ -154,6 +154,7 @@ export default {
|
||||
customFieldGroups_title: 'Ομάδες προσαρμοσμένων πεδίων',
|
||||
customField_title: 'Προσαρμοσμένο πεδίο',
|
||||
customFields_title: 'Προσαρμοσμένα πεδία',
|
||||
customerPanel_title: 'Πίνακας πελάτη',
|
||||
dangerZone_title: 'Επικίνδυνη ζώνη',
|
||||
date: 'Ημερομηνία',
|
||||
deactivateUser_title: 'Απενεργοποίηση χρήστη',
|
||||
|
||||
@@ -140,6 +140,7 @@ export default {
|
||||
customFieldGroups_title: 'Custom Field Groups',
|
||||
customField_title: 'Custom Field',
|
||||
customFields_title: 'Custom Fields',
|
||||
customerPanel_title: 'Customer Panel',
|
||||
dangerZone_title: 'Danger Zone',
|
||||
date: 'Date',
|
||||
deactivateUser_title: 'Deactivate User',
|
||||
|
||||
@@ -135,6 +135,7 @@ export default {
|
||||
customFieldGroups_title: 'Custom Field Groups',
|
||||
customField_title: 'Custom Field',
|
||||
customFields_title: 'Custom Fields',
|
||||
customerPanel_title: 'Customer Panel',
|
||||
dangerZone_title: 'Danger Zone',
|
||||
date: 'Date',
|
||||
deactivateUser_title: 'Deactivate User',
|
||||
|
||||
@@ -146,6 +146,7 @@ export default {
|
||||
customFieldGroups_title: 'Grupos de campos personalizados',
|
||||
customField_title: 'Campo personalizado',
|
||||
customFields_title: 'Campos personalizados',
|
||||
customerPanel_title: 'Panel del cliente',
|
||||
dangerZone_title: 'Zona de peligro',
|
||||
date: 'Fecha',
|
||||
deactivateUser_title: 'Desactivar usuario',
|
||||
|
||||
@@ -141,6 +141,7 @@ export default {
|
||||
customFieldGroups_title: 'Kohandatud väljade grupid',
|
||||
customField_title: 'Kohandatud väli',
|
||||
customFields_title: 'Kohandatud väljad',
|
||||
customerPanel_title: 'Kliendi paneel',
|
||||
dangerZone_title: 'Ohtliku ala',
|
||||
date: 'Kuupäev',
|
||||
deactivateUser_title: 'Deaktiveeri kasutaja',
|
||||
|
||||
@@ -144,6 +144,7 @@ export default {
|
||||
customFieldGroups_title: 'گروههای فیلد سفارشی',
|
||||
customField_title: 'فیلد سفارشی',
|
||||
customFields_title: 'فیلدهای سفارشی',
|
||||
customerPanel_title: 'پنل مشتری',
|
||||
dangerZone_title: 'منطقه خطر',
|
||||
date: 'تاریخ',
|
||||
deactivateUser_title: 'غیرفعال کردن کاربر',
|
||||
|
||||
@@ -137,6 +137,7 @@ export default {
|
||||
customFieldGroups_title: 'Mukautettujen kenttien ryhmät',
|
||||
customField_title: 'Mukautettu kenttä',
|
||||
customFields_title: 'Mukautetut kentät',
|
||||
customerPanel_title: 'Asiakaspaneeli',
|
||||
dangerZone_title: 'Vaaravyöhyke',
|
||||
date: 'Päivämäärä',
|
||||
deactivateUser_title: 'Poista käyttäjä käytöstä',
|
||||
|
||||
@@ -145,6 +145,7 @@ export default {
|
||||
customFieldGroups_title: 'Groupes de champs personnalisés',
|
||||
customField_title: 'Champ personnalisé',
|
||||
customFields_title: 'Champs personnalisés',
|
||||
customerPanel_title: 'Panneau client',
|
||||
dangerZone_title: 'Zone dangereuse',
|
||||
date: 'Date',
|
||||
deactivateUser_title: 'Désactiver l’utilisateur',
|
||||
|
||||
@@ -135,6 +135,7 @@ export default {
|
||||
customFieldGroups_title: 'Egyedi mezőcsoportok',
|
||||
customField_title: 'Egyedi mező',
|
||||
customFields_title: 'Egyedi mezők',
|
||||
customerPanel_title: 'Ügyfélpanel',
|
||||
dangerZone_title: 'Veszélyzóna',
|
||||
date: 'Dátum',
|
||||
deactivateUser_title: 'Felhasználó inaktiválása',
|
||||
|
||||
@@ -142,6 +142,7 @@ export default {
|
||||
customFieldGroups_title: 'Grup bidang kustom',
|
||||
customField_title: 'Bidang kustom',
|
||||
customFields_title: 'Bidang kustom',
|
||||
customerPanel_title: 'Panel pelanggan',
|
||||
dangerZone_title: 'Zona berbahaya',
|
||||
date: 'Tanggal',
|
||||
deactivateUser_title: 'Nonaktifkan pengguna',
|
||||
|
||||
@@ -142,6 +142,7 @@ export default {
|
||||
customFieldGroups_title: 'Campi personalizzati',
|
||||
customField_title: 'Campo personalizzato',
|
||||
customFields_title: 'Campi personalizzati',
|
||||
customerPanel_title: 'Pannello cliente',
|
||||
dangerZone_title: 'Zona pericolosa',
|
||||
date: 'Data',
|
||||
deactivateUser_title: 'Disattiva utente',
|
||||
|
||||
@@ -138,6 +138,7 @@ export default {
|
||||
customFieldGroups_title: 'カスタムフィールドグループ',
|
||||
customField_title: 'カスタムフィールド',
|
||||
customFields_title: 'カスタムフィールド',
|
||||
customerPanel_title: '顧客パネル',
|
||||
dangerZone_title: '危険ゾーン',
|
||||
date: '日付',
|
||||
deactivateUser_title: 'ユーザーを非アクティブにする',
|
||||
|
||||
@@ -133,6 +133,7 @@ export default {
|
||||
customFieldGroups_title: '사용자 정의 필드 그룹들',
|
||||
customField_title: '사용자 정의 필드',
|
||||
customFields_title: '사용자 정의 필드들',
|
||||
customerPanel_title: '고객 패널',
|
||||
dangerZone_title: '위험 구역',
|
||||
date: '날짜',
|
||||
deactivateUser_title: '사용자 비활성화',
|
||||
|
||||
@@ -141,6 +141,7 @@ export default {
|
||||
customFieldGroups_title: 'Aangepaste veldgroepen',
|
||||
customField_title: 'Aangepast veld',
|
||||
customFields_title: 'Aangepaste velden',
|
||||
customerPanel_title: 'Klantenpaneel',
|
||||
dangerZone_title: 'Gevaarlijke zone',
|
||||
date: 'Datum',
|
||||
deactivateUser_title: 'Gebruiker deactiveren',
|
||||
|
||||
@@ -140,6 +140,7 @@ export default {
|
||||
customFieldGroups_title: 'Grupy pól własnych',
|
||||
customField_title: 'Własne pole',
|
||||
customFields_title: 'Własne pola',
|
||||
customerPanel_title: 'Panel klienta',
|
||||
dangerZone_title: 'Strefa niebezpieczeństwa',
|
||||
date: 'Data',
|
||||
deactivateUser_title: 'Dezaktywuj użytkownika',
|
||||
|
||||
@@ -143,6 +143,7 @@ export default {
|
||||
customFieldGroups_title: 'Grupos de campo personalizado',
|
||||
customField_title: 'Campo personalizado',
|
||||
customFields_title: 'Campos personalizados',
|
||||
customerPanel_title: 'Painel do cliente',
|
||||
dangerZone_title: 'Zona de perigo',
|
||||
date: 'Data',
|
||||
deactivateUser_title: 'Desativar usuário',
|
||||
|
||||
@@ -145,6 +145,7 @@ export default {
|
||||
customFieldGroups_title: 'Grupos de campos personalizados',
|
||||
customField_title: 'Campo personalizado',
|
||||
customFields_title: 'Campos personalizados',
|
||||
customerPanel_title: 'Painel do cliente',
|
||||
dangerZone_title: 'Zona perigosa',
|
||||
date: 'Data',
|
||||
deactivateUser_title: 'Desativar utilizador',
|
||||
|
||||
@@ -139,6 +139,7 @@ export default {
|
||||
customFieldGroups_title: 'Grupuri de câmpuri personalizate',
|
||||
customField_title: 'Câmp personalizat',
|
||||
customFields_title: 'Câmpuri personalizate',
|
||||
customerPanel_title: 'Panoul clientului',
|
||||
dangerZone_title: 'Zona periculoasă',
|
||||
date: 'Data',
|
||||
deactivateUser_title: 'Dezactivează utilizatorul',
|
||||
|
||||
@@ -142,6 +142,7 @@ export default {
|
||||
customFieldGroups_title: 'Группы настраиваемых полей',
|
||||
customField_title: 'Настраиваемое поле',
|
||||
customFields_title: 'Настраиваемые поля',
|
||||
customerPanel_title: 'Панель клиента',
|
||||
dangerZone_title: 'Опасная зона',
|
||||
date: 'Дата',
|
||||
deactivateUser_title: 'Деактивировать пользователя',
|
||||
|
||||
@@ -136,6 +136,7 @@ export default {
|
||||
customFieldGroups_title: 'Skupiny vlastných polí',
|
||||
customField_title: 'Vlastné pole',
|
||||
customFields_title: 'Vlastné polia',
|
||||
customerPanel_title: 'Panel zákazníka',
|
||||
dangerZone_title: 'Nebezpečná zóna',
|
||||
date: 'Dátum',
|
||||
deactivateUser_title: 'Deaktivovať používateľa',
|
||||
|
||||
@@ -139,6 +139,7 @@ export default {
|
||||
customFieldGroups_title: 'Групе прилагођених поља',
|
||||
customField_title: 'Прилагођено поље',
|
||||
customFields_title: 'Прилагођена поља',
|
||||
customerPanel_title: 'Панел купца',
|
||||
dangerZone_title: 'Опасна зона',
|
||||
date: 'Датум',
|
||||
deactivateUser_title: 'Деактивирај корисника',
|
||||
|
||||
@@ -140,6 +140,7 @@ export default {
|
||||
customFieldGroups_title: 'Grupe prilagođenih polja',
|
||||
customField_title: 'Prilagođeno polje',
|
||||
customFields_title: 'Prilagođena polja',
|
||||
customerPanel_title: 'Panel kupca',
|
||||
dangerZone_title: 'Opasna zona',
|
||||
date: 'Datum',
|
||||
deactivateUser_title: 'Deaktiviraj korisnika',
|
||||
|
||||
@@ -146,6 +146,7 @@ export default {
|
||||
customFieldGroups_title: 'Anpassade fältgrupper',
|
||||
customField_title: 'Anpassat fält',
|
||||
customFields_title: 'Anpassade fält',
|
||||
customerPanel_title: 'Kundpanel',
|
||||
dangerZone_title: 'Farozon',
|
||||
date: 'Datum',
|
||||
deactivateUser_title: 'Inaktivera användare',
|
||||
|
||||
@@ -143,6 +143,7 @@ export default {
|
||||
customFieldGroups_title: 'özel alan grupları',
|
||||
customField_title: 'Özel alan',
|
||||
customFields_title: 'Özel alanlar',
|
||||
customerPanel_title: 'Müşteri paneli',
|
||||
dangerZone_title: 'Tehlikeli bölge',
|
||||
date: 'tarih',
|
||||
deactivateUser_title: 'Kullanıcıyı devre dışı bırak',
|
||||
|
||||
@@ -141,6 +141,7 @@ export default {
|
||||
customFieldGroups_title: 'Користувацькі групи полів',
|
||||
customField_title: 'Користувацьке поле',
|
||||
customFields_title: 'Користувацькі поля',
|
||||
customerPanel_title: 'Панель клієнта',
|
||||
dangerZone_title: 'Небезпечна зона',
|
||||
date: 'Дата',
|
||||
deactivateUser_title: 'Деактивувати користувача',
|
||||
|
||||
@@ -137,6 +137,7 @@ export default {
|
||||
customFieldGroups_title: 'Maxsus maydon guruhlari',
|
||||
customField_title: 'Maxsus maydon',
|
||||
customFields_title: 'Maxsus maydonlar',
|
||||
customerPanel_title: 'Mijoz paneli',
|
||||
dangerZone_title: 'Xavfli hudud',
|
||||
date: 'Sana',
|
||||
deactivateUser_title: 'Foydalanuvchini faolsizlantirish',
|
||||
|
||||
@@ -122,6 +122,7 @@ export default {
|
||||
customFieldGroups_title: '自定义字段组',
|
||||
customField_title: '自定义字段',
|
||||
customFields_title: '自定义字段',
|
||||
customerPanel_title: '客户面板',
|
||||
dangerZone_title: '危险区域',
|
||||
date: '日期',
|
||||
deactivateUser_title: '停用用户',
|
||||
|
||||
@@ -122,6 +122,7 @@ export default {
|
||||
customFieldGroups_title: '自定義欄位群組',
|
||||
customField_title: '自定義欄位',
|
||||
customFields_title: '自定義欄位',
|
||||
customerPanel_title: '客戶面板',
|
||||
dangerZone_title: '危險區域',
|
||||
date: '日期',
|
||||
deactivateUser_title: '停用使用者',
|
||||
|
||||
@@ -43,6 +43,7 @@ services:
|
||||
# - INTERNAL_ACCESS_TOKEN=
|
||||
# - STORAGE_LIMIT=
|
||||
# - ACTIVE_USERS_LIMIT=
|
||||
# - CUSTOMER_PANEL_URL=
|
||||
|
||||
# Set to true to show more detailed authentication error messages.
|
||||
# It should not be enabled without a rate limiter for security reasons.
|
||||
|
||||
@@ -57,6 +57,7 @@ services:
|
||||
# - INTERNAL_ACCESS_TOKEN=
|
||||
# - STORAGE_LIMIT=
|
||||
# - ACTIVE_USERS_LIMIT=
|
||||
# - CUSTOMER_PANEL_URL=
|
||||
|
||||
# Set to true to show more detailed authentication error messages.
|
||||
# It should not be enabled without a rate limiter for security reasons.
|
||||
|
||||
@@ -34,6 +34,7 @@ SECRET_KEY=notsecretkey
|
||||
# INTERNAL_ACCESS_TOKEN=
|
||||
# STORAGE_LIMIT=
|
||||
# ACTIVE_USERS_LIMIT=
|
||||
# CUSTOMER_PANEL_URL=
|
||||
|
||||
# Set to true to show more detailed authentication error messages.
|
||||
# It should not be enabled without a rate limiter for security reasons.
|
||||
|
||||
@@ -52,6 +52,11 @@
|
||||
* nullable: true
|
||||
* description: Maximum number of active users allowed (conditionally added for admins if configured)
|
||||
* example: 100
|
||||
* customerPanelUrl:
|
||||
* type: string
|
||||
* format: uri
|
||||
* description: URL to the customer management panel (conditionally added for admins if configured)
|
||||
* example: https://panel.example.com
|
||||
* version:
|
||||
* type: string
|
||||
* description: Current version of the PLANKA application
|
||||
|
||||
@@ -21,7 +21,10 @@ module.exports = {
|
||||
version: sails.config.custom.version,
|
||||
};
|
||||
if (inputs.user && inputs.user.role === User.Roles.ADMIN) {
|
||||
data.activeUsersLimit = sails.config.custom.activeUsersLimit;
|
||||
Object.assign(data, {
|
||||
activeUsersLimit: sails.config.custom.activeUsersLimit,
|
||||
customerPanelUrl: sails.config.custom.customerPanelUrl,
|
||||
});
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
@@ -62,6 +62,7 @@ module.exports.custom = {
|
||||
internalAccessToken: process.env.INTERNAL_ACCESS_TOKEN,
|
||||
storageLimit: envToBytes(process.env.STORAGE_LIMIT),
|
||||
activeUsersLimit: envToNumber(process.env.ACTIVE_USERS_LIMIT),
|
||||
customerPanelUrl: process.env.CUSTOMER_PANEL_URL,
|
||||
|
||||
showDetailedAuthErrors: process.env.SHOW_DETAILED_AUTH_ERRORS === 'true',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user