mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 12:49:43 +02:00
Merge branch 'plankanban:master' into master
This commit is contained in:
commit
dd91d2b9d4
26 changed files with 467 additions and 333 deletions
|
@ -13,26 +13,26 @@ env:
|
|||
|
||||
jobs:
|
||||
build-and-push-docker-base-image:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
|
|
34
.github/workflows/build-and-push-docker-image-dev.yml
vendored
Normal file
34
.github/workflows/build-and-push-docker-image-dev.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: Build and push Docker DEV image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build-and-push-docker-image-dev:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/plankanban/planka:dev
|
|
@ -6,19 +6,19 @@ on:
|
|||
|
||||
jobs:
|
||||
build-and-push-docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
|
@ -32,7 +32,7 @@ jobs:
|
|||
script: return context.payload.release.tag_name.replace('v', '')
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
|
|
4
.github/workflows/helm-chart-release.yml
vendored
4
.github/workflows/helm-chart-release.yml
vendored
|
@ -13,10 +13,10 @@ jobs:
|
|||
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ WORKDIR /app
|
|||
COPY server/package.json server/package-lock.json .
|
||||
|
||||
RUN npm install npm@latest --global \
|
||||
&& npm clean-install --omit=dev
|
||||
&& npm install pnpm --global \
|
||||
&& pnpm install --prod
|
||||
|
||||
FROM node:lts AS client
|
||||
|
||||
|
@ -14,7 +15,8 @@ WORKDIR /app
|
|||
COPY client/package.json client/package-lock.json .
|
||||
|
||||
RUN npm install npm@latest --global \
|
||||
&& npm clean-install --omit=dev
|
||||
&& npm install pnpm --global \
|
||||
&& pnpm install --prod
|
||||
|
||||
COPY client .
|
||||
RUN DISABLE_ESLINT_PLUGIN=true npm run build
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { dequal } from 'dequal';
|
||||
import omit from 'lodash/omit';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
import React, { useCallback, useMemo, useRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
@ -9,7 +10,7 @@ import { useForm } from '../../hooks';
|
|||
|
||||
import styles from './UserInformationEdit.module.scss';
|
||||
|
||||
const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
||||
const UserInformationEdit = React.memo(({ defaultData, isNameEditable, onUpdate }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const [data, handleFieldChange] = useForm(() => ({
|
||||
|
@ -32,13 +33,17 @@ const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
|||
const nameField = useRef(null);
|
||||
|
||||
const handleSubmit = useCallback(() => {
|
||||
if (!cleanData.name) {
|
||||
nameField.current.select();
|
||||
return;
|
||||
}
|
||||
if (isNameEditable) {
|
||||
if (!cleanData.name) {
|
||||
nameField.current.select();
|
||||
return;
|
||||
}
|
||||
|
||||
onUpdate(cleanData);
|
||||
}, [onUpdate, cleanData]);
|
||||
onUpdate(cleanData);
|
||||
} else {
|
||||
onUpdate(omit(cleanData, 'name'));
|
||||
}
|
||||
}, [isNameEditable, onUpdate, cleanData]);
|
||||
|
||||
return (
|
||||
<Form onSubmit={handleSubmit}>
|
||||
|
@ -48,6 +53,7 @@ const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
|||
ref={nameField}
|
||||
name="name"
|
||||
value={data.name}
|
||||
disabled={!isNameEditable}
|
||||
className={styles.field}
|
||||
onChange={handleFieldChange}
|
||||
/>
|
||||
|
@ -74,6 +80,7 @@ const UserInformationEdit = React.memo(({ defaultData, onUpdate }) => {
|
|||
|
||||
UserInformationEdit.propTypes = {
|
||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
isNameEditable: PropTypes.bool.isRequired,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
|
|
|
@ -5,33 +5,40 @@ import { Popup } from '../lib/custom-ui';
|
|||
|
||||
import UserInformationEdit from './UserInformationEdit';
|
||||
|
||||
const UserInformationEditStep = React.memo(({ defaultData, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
const UserInformationEditStep = React.memo(
|
||||
({ defaultData, isNameEditable, onUpdate, onBack, onClose }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handleUpdate = useCallback(
|
||||
(data) => {
|
||||
onUpdate(data);
|
||||
onClose();
|
||||
},
|
||||
[onUpdate, onClose],
|
||||
);
|
||||
const handleUpdate = useCallback(
|
||||
(data) => {
|
||||
onUpdate(data);
|
||||
onClose();
|
||||
},
|
||||
[onUpdate, onClose],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editInformation', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<UserInformationEdit defaultData={defaultData} onUpdate={handleUpdate} />
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<Popup.Header onBack={onBack}>
|
||||
{t('common.editInformation', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<UserInformationEdit
|
||||
defaultData={defaultData}
|
||||
isNameEditable={isNameEditable}
|
||||
onUpdate={handleUpdate}
|
||||
/>
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
UserInformationEditStep.propTypes = {
|
||||
defaultData: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
isNameEditable: PropTypes.bool.isRequired,
|
||||
onUpdate: PropTypes.func.isRequired,
|
||||
onBack: PropTypes.func,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
|
|
|
@ -23,6 +23,7 @@ const AccountPane = React.memo(
|
|||
phone,
|
||||
organization,
|
||||
language,
|
||||
isLocked,
|
||||
isAvatarUpdating,
|
||||
usernameUpdateForm,
|
||||
emailUpdateForm,
|
||||
|
@ -74,6 +75,7 @@ const AccountPane = React.memo(
|
|||
phone,
|
||||
organization,
|
||||
}}
|
||||
isNameEditable={!isLocked}
|
||||
onUpdate={onUpdate}
|
||||
/>
|
||||
<Divider horizontal section>
|
||||
|
@ -102,63 +104,67 @@ const AccountPane = React.memo(
|
|||
value={language || 'auto'}
|
||||
onChange={handleLanguageChange}
|
||||
/>
|
||||
<Divider horizontal section>
|
||||
<Header as="h4">
|
||||
{t('common.authentication', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Header>
|
||||
</Divider>
|
||||
<div className={styles.action}>
|
||||
<UserUsernameEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={usernameUpdateForm.data}
|
||||
username={username}
|
||||
isSubmitting={usernameUpdateForm.isSubmitting}
|
||||
error={usernameUpdateForm.error}
|
||||
onUpdate={onUsernameUpdate}
|
||||
onMessageDismiss={onUsernameUpdateMessageDismiss}
|
||||
>
|
||||
<Button className={styles.actionButton}>
|
||||
{t('action.editUsername', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UserUsernameEditPopup>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<UserEmailEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={emailUpdateForm.data}
|
||||
email={email}
|
||||
isSubmitting={emailUpdateForm.isSubmitting}
|
||||
error={emailUpdateForm.error}
|
||||
onUpdate={onEmailUpdate}
|
||||
onMessageDismiss={onEmailUpdateMessageDismiss}
|
||||
>
|
||||
<Button className={styles.actionButton}>
|
||||
{t('action.editEmail', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UserEmailEditPopup>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<UserPasswordEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={passwordUpdateForm.data}
|
||||
isSubmitting={passwordUpdateForm.isSubmitting}
|
||||
error={passwordUpdateForm.error}
|
||||
onUpdate={onPasswordUpdate}
|
||||
onMessageDismiss={onPasswordUpdateMessageDismiss}
|
||||
>
|
||||
<Button className={styles.actionButton}>
|
||||
{t('action.editPassword', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UserPasswordEditPopup>
|
||||
</div>
|
||||
{!isLocked && (
|
||||
<>
|
||||
<Divider horizontal section>
|
||||
<Header as="h4">
|
||||
{t('common.authentication', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Header>
|
||||
</Divider>
|
||||
<div className={styles.action}>
|
||||
<UserUsernameEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={usernameUpdateForm.data}
|
||||
username={username}
|
||||
isSubmitting={usernameUpdateForm.isSubmitting}
|
||||
error={usernameUpdateForm.error}
|
||||
onUpdate={onUsernameUpdate}
|
||||
onMessageDismiss={onUsernameUpdateMessageDismiss}
|
||||
>
|
||||
<Button className={styles.actionButton}>
|
||||
{t('action.editUsername', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UserUsernameEditPopup>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<UserEmailEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={emailUpdateForm.data}
|
||||
email={email}
|
||||
isSubmitting={emailUpdateForm.isSubmitting}
|
||||
error={emailUpdateForm.error}
|
||||
onUpdate={onEmailUpdate}
|
||||
onMessageDismiss={onEmailUpdateMessageDismiss}
|
||||
>
|
||||
<Button className={styles.actionButton}>
|
||||
{t('action.editEmail', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UserEmailEditPopup>
|
||||
</div>
|
||||
<div className={styles.action}>
|
||||
<UserPasswordEditPopup
|
||||
usePasswordConfirmation
|
||||
defaultData={passwordUpdateForm.data}
|
||||
isSubmitting={passwordUpdateForm.isSubmitting}
|
||||
error={passwordUpdateForm.error}
|
||||
onUpdate={onPasswordUpdate}
|
||||
onMessageDismiss={onPasswordUpdateMessageDismiss}
|
||||
>
|
||||
<Button className={styles.actionButton}>
|
||||
{t('action.editPassword', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Button>
|
||||
</UserPasswordEditPopup>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</Tab.Pane>
|
||||
);
|
||||
},
|
||||
|
@ -172,6 +178,7 @@ AccountPane.propTypes = {
|
|||
phone: PropTypes.string,
|
||||
organization: PropTypes.string,
|
||||
language: PropTypes.string,
|
||||
isLocked: PropTypes.bool.isRequired,
|
||||
isAvatarUpdating: PropTypes.bool.isRequired,
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
usernameUpdateForm: PropTypes.object.isRequired,
|
||||
|
|
|
@ -16,6 +16,7 @@ const UserSettingsModal = React.memo(
|
|||
phone,
|
||||
organization,
|
||||
language,
|
||||
isLocked,
|
||||
subscribeToOwnCards,
|
||||
isAvatarUpdating,
|
||||
usernameUpdateForm,
|
||||
|
@ -48,6 +49,7 @@ const UserSettingsModal = React.memo(
|
|||
phone={phone}
|
||||
organization={organization}
|
||||
language={language}
|
||||
isLocked={isLocked}
|
||||
isAvatarUpdating={isAvatarUpdating}
|
||||
usernameUpdateForm={usernameUpdateForm}
|
||||
emailUpdateForm={emailUpdateForm}
|
||||
|
@ -104,6 +106,7 @@ UserSettingsModal.propTypes = {
|
|||
phone: PropTypes.string,
|
||||
organization: PropTypes.string,
|
||||
language: PropTypes.string,
|
||||
isLocked: PropTypes.bool.isRequired,
|
||||
subscribeToOwnCards: PropTypes.bool.isRequired,
|
||||
isAvatarUpdating: PropTypes.bool.isRequired,
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
|
|
|
@ -64,6 +64,7 @@ const ActionsStep = React.memo(
|
|||
return (
|
||||
<UserInformationEditStep
|
||||
defaultData={pick(user, ['name', 'phone', 'organization'])}
|
||||
isNameEditable={!user.isLocked}
|
||||
onUpdate={onUpdate}
|
||||
onBack={handleBack}
|
||||
onClose={onClose}
|
||||
|
@ -135,26 +136,30 @@ const ActionsStep = React.memo(
|
|||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleEditUsernameClick}>
|
||||
{t('action.editUsername', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleEditEmailClick}>
|
||||
{t('action.editEmail', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleEditPasswordClick}>
|
||||
{t('action.editPassword', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleDeleteClick}>
|
||||
{t('action.deleteUser', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
{!user.isLocked && (
|
||||
<>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleEditUsernameClick}>
|
||||
{t('action.editUsername', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleEditEmailClick}>
|
||||
{t('action.editEmail', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleEditPasswordClick}>
|
||||
{t('action.editPassword', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={handleDeleteClick}>
|
||||
{t('action.deleteUser', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
</Popup.Content>
|
||||
</>
|
||||
|
|
|
@ -17,6 +17,7 @@ const Item = React.memo(
|
|||
organization,
|
||||
phone,
|
||||
isAdmin,
|
||||
isLocked,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
usernameUpdateForm,
|
||||
|
@ -46,7 +47,7 @@ const Item = React.memo(
|
|||
<Table.Cell>{username || '-'}</Table.Cell>
|
||||
<Table.Cell>{email}</Table.Cell>
|
||||
<Table.Cell>
|
||||
<Radio toggle checked={isAdmin} onChange={handleIsAdminChange} />
|
||||
<Radio toggle checked={isAdmin} disabled={isLocked} onChange={handleIsAdminChange} />
|
||||
</Table.Cell>
|
||||
<Table.Cell textAlign="right">
|
||||
<ActionsPopup
|
||||
|
@ -57,6 +58,7 @@ const Item = React.memo(
|
|||
organization,
|
||||
phone,
|
||||
isAdmin,
|
||||
isLocked,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
usernameUpdateForm,
|
||||
|
@ -88,6 +90,7 @@ Item.propTypes = {
|
|||
organization: PropTypes.string,
|
||||
phone: PropTypes.string,
|
||||
isAdmin: PropTypes.bool.isRequired,
|
||||
isLocked: PropTypes.bool.isRequired,
|
||||
/* eslint-disable react/forbid-prop-types */
|
||||
emailUpdateForm: PropTypes.object.isRequired,
|
||||
passwordUpdateForm: PropTypes.object.isRequired,
|
||||
|
|
|
@ -110,6 +110,7 @@ const UsersModal = React.memo(
|
|||
organization={item.organization}
|
||||
phone={item.phone}
|
||||
isAdmin={item.isAdmin}
|
||||
isLocked={item.isLocked}
|
||||
emailUpdateForm={item.emailUpdateForm}
|
||||
passwordUpdateForm={item.passwordUpdateForm}
|
||||
usernameUpdateForm={item.usernameUpdateForm}
|
||||
|
|
|
@ -14,6 +14,7 @@ const mapStateToProps = (state) => {
|
|||
phone,
|
||||
organization,
|
||||
language,
|
||||
isLocked,
|
||||
subscribeToOwnCards,
|
||||
isAvatarUpdating,
|
||||
emailUpdateForm,
|
||||
|
@ -29,6 +30,7 @@ const mapStateToProps = (state) => {
|
|||
phone,
|
||||
organization,
|
||||
language,
|
||||
isLocked,
|
||||
subscribeToOwnCards,
|
||||
isAvatarUpdating,
|
||||
emailUpdateForm,
|
||||
|
|
|
@ -24,201 +24,196 @@ export default {
|
|||
all: 'Tümü',
|
||||
allChangesWillBeAutomaticallySavedAfterConnectionRestored:
|
||||
'Bağlantı yeniden kurulduğunda tüm değişiklikler kaydedilecektir.',
|
||||
areYouSureYouWantToDeleteThisAttachment:
|
||||
'Bu eki silmek istediğinize emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisBoard: 'Bu panoyu silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisCard: 'Bu kartı silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisComment:
|
||||
'Bu yorumu silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisLabel: 'Bu etiketi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisList: 'Bu listeyi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisProject:
|
||||
'Bu projeyi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisTask: 'Bu görevi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisUser:
|
||||
'Bu kullanıcıyı silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToLeaveBoard: 'Panodan ayrılmak istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToLeaveProject: 'Projeden ayrılmak istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToRemoveThisManagerFromProject:
|
||||
'Bu yöneticiyi projeden çıkarmak istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToRemoveThisMemberFromBoard:
|
||||
'Bu üyeyi panodan çıkarmak istediğinizden emin misiniz?',
|
||||
attachment: 'ek',
|
||||
attachments: 'ekler',
|
||||
authentication: 'kimlik doğrulama',
|
||||
background: 'arka plan',
|
||||
board: 'pano',
|
||||
boardNotFound_title: 'Pano bulunamadı',
|
||||
cardActions_title: 'Kart İşlemleri',
|
||||
cardNotFound_title: 'Kart bulunamadı',
|
||||
cardOrActionAreDeleted: 'Kart veya işlem silindi',
|
||||
color: 'renk',
|
||||
createBoard_title: 'Pano Oluştur',
|
||||
createLabel_title: 'Etiket Oluştur',
|
||||
createNewOneOrSelectExistingOne:
|
||||
'Yeni bir tane oluşturun veya mevcut bir tanesini seçin.',
|
||||
createProject_title: 'Proje Oluştur',
|
||||
createTextFile_title: 'Metin Dosyası Oluştur',
|
||||
currentPassword: 'Geçerli şifre',
|
||||
dangerZone_title: 'Tehlikeli Bölge',
|
||||
date: 'tarih',
|
||||
dueDate_title: 'Termin Tarihi',
|
||||
deleteAttachment_title: 'Eki Sil',
|
||||
deleteBoard_title: 'Panoyu Sil',
|
||||
deleteCard_title: 'Kartı Sil',
|
||||
deleteComment_title: 'Yorumu Sil',
|
||||
deleteLabel_title: 'Etiketi Sil',
|
||||
deleteList_title: 'Listeyi Sil',
|
||||
deleteProject_title: 'Projeyi Sil',
|
||||
deleteTask_title: 'Görevi Sil',
|
||||
deleteUser_title: 'Kullanıcıyı Sil',
|
||||
description: 'açıklama',
|
||||
detectAutomaically: 'Otomatik olarak algıla',
|
||||
dropFileToUpload: 'Yüklenecek dosyayı buraya bırakın',
|
||||
editAttachment_title: 'Eki Düzenle',
|
||||
editAvatar_title: 'Avatarı Düzenle',
|
||||
editBoard_title: 'Panoyu Düzenle',
|
||||
editDueDate_title: 'Son Tarihi Düzenle',
|
||||
editEmail_title: 'E-posta Adresini Düzenle',
|
||||
editLabel_title: 'Etiketi Düzenle',
|
||||
editPassword_title: 'Şifreyi Değiştir',
|
||||
editStopwatch_title: 'Kronometreyi Düzenle',
|
||||
editUsername_title: 'Kullanıcı Adını Düzenle',
|
||||
email: 'e-posta',
|
||||
emailAlreadyInUse: 'E-posta adresi zaten kullanımda',
|
||||
enterCardTitle: 'Kart başlığını girin',
|
||||
enterDescription: 'Açıklamayı girin',
|
||||
enterFilename: 'Dosya adını girin',
|
||||
enterListTitle: 'Liste başlığını girin',
|
||||
enterProjectTitle: 'Proje başlığını girin',
|
||||
enterTaskDescription: 'Görev açıklamasını girin',
|
||||
filterByLabels_title: 'Etikete Göre Filtrele',
|
||||
filterByMembers_title: 'Üyelere göre filtrele',
|
||||
fromComputer_title: 'Bilgisayardan',
|
||||
general: 'Genel',
|
||||
hours: 'saat',
|
||||
invalidCurrentPassword: 'Mevcut şifre yanlış',
|
||||
labels: 'etiketler',
|
||||
language: 'dil',
|
||||
leaveBoard_title: 'Panodan Ayrıl',
|
||||
leaveProject_title: 'Projeden Ayrıl',
|
||||
list: 'Listeler',
|
||||
listActions_title: 'Görevleri Listele',
|
||||
managers: 'Yöneticiler',
|
||||
members: 'Üyeler',
|
||||
minutes: 'dakika',
|
||||
moveCard_title: 'Kartı Taşı',
|
||||
name: 'isim',
|
||||
newEmail: 'Yeni e-posta adresi',
|
||||
newPassword: 'Yeni şifre',
|
||||
newUsername: 'Yeni kullanıcı adı',
|
||||
noConnectionToServer: 'Sunucuya bağlantı yok',
|
||||
noBoards: 'Pano yok',
|
||||
noLists: 'Liste yok',
|
||||
noProjects: 'Proje yok',
|
||||
notifications: 'Bildirimler',
|
||||
noUnreadNotifications: 'Okunmamış bildirim yok',
|
||||
openBoard_title: 'Açık Pano',
|
||||
optional_inline: 'İsteğe bağlı',
|
||||
organization: 'Organizasyon',
|
||||
phone: 'telefon',
|
||||
preferences: 'Tercihler',
|
||||
pressPasteShortcutToAddAttachmentFromClipboard:
|
||||
'İpucu: Panodan bir ek eklemek için CTRL-V ye (Macte Cmd-V) basın',
|
||||
project: 'Proje',
|
||||
projectNotFound_title: 'Proje bulunamadı',
|
||||
removeManager_title: 'Yöneticiyi Kaldır',
|
||||
removeMember_title: 'Üyeyi Kaldır',
|
||||
seconds: 'saniye',
|
||||
selectBoard: 'Pano Seç',
|
||||
selectList: 'Liste seç',
|
||||
selectProject: 'Proje seç',
|
||||
settings: 'Ayarlar',
|
||||
stopwatch: 'kronometre',
|
||||
subscribeToMyOwnCardsByDefault: 'Varsayılan olarak kendi kartlarıma abone ol',
|
||||
taskActions_title: 'Görev Eylemleri',
|
||||
tasks: 'Görevler',
|
||||
thereIsNoPreviewAvailableForThisAttachment: 'Bu ek için önizleme mevcut değil',
|
||||
time: 'zaman',
|
||||
title: 'başlık',
|
||||
userActions_title: 'Kullanıcı İşlemleri',
|
||||
userAddedThisCardToList: '<0>{{user}}</0><1> bu kartı {{list}</1> listesine ekledi',
|
||||
userLeftNewCommentToCard:
|
||||
'{{user}} yeni bir yorum yazdı: <2>{{card}</2> kartına «{{comment}}»',
|
||||
userMovedCardFromListToList:
|
||||
'{{user}}, <2>{{card}></2> kartını {{fromList}} listesinden {{toList}} listesine taşıdı',
|
||||
userMovedThisCardFromListToList:
|
||||
'<0>{{user}}</0><1> bu kartı {{fromList}} konumundan {{toList}}</1> konumuna taşıdı',
|
||||
username: 'kullanıcı adı',
|
||||
usernameAlreadyInUse: 'Kullanıcı adı zaten kullanımda',
|
||||
users: 'kullanıcı',
|
||||
writeComment: 'Yorum yazın',
|
||||
},
|
||||
action: {
|
||||
addAnotherCard: 'Başka bir kart ekle',
|
||||
addAnotherList: 'Başka bir liste ekle',
|
||||
addAnotherTask: 'Başka bir görev ekle',
|
||||
addCard: 'Kart ekle',
|
||||
addCard_title: 'Kart Ekle',
|
||||
addComment: 'Yorum ekle',
|
||||
addList: 'Liste ekle',
|
||||
addMoreDetailedDescription: 'Ayrıntılı bir açıklama ekleyin',
|
||||
addTask: 'Görev ekle',
|
||||
addToCard: 'Karta ekle',
|
||||
addUser: 'Kullanıcı ekle',
|
||||
createBoard: 'Pano oluştur',
|
||||
createFile: 'Dosya oluştur',
|
||||
createLabel: 'Etiket Oluştur',
|
||||
createNewLabel: 'Yeni etiket oluştur',
|
||||
createProject: 'Proje oluştur',
|
||||
delete: 'Sil',
|
||||
deleteAttachment: 'Eki sil',
|
||||
deleteAvatar: 'Avatarı sil',
|
||||
deleteBoard: 'Panoyu Sil',
|
||||
deleteCard: 'Kartı sil',
|
||||
deleteCard_title: 'Kartı Sil',
|
||||
deleteComment: 'Yorumu sil',
|
||||
deleteImage: 'Resmi sil',
|
||||
deleteLabel: 'Etiketi sil',
|
||||
deleteList: 'Listeyi sil',
|
||||
deleteList_title: 'Listeyi Sil',
|
||||
deleteProject: 'Projeyi sil',
|
||||
deleteProject_title: 'Projeyi Sil',
|
||||
deleteTask: 'Görevi sil',
|
||||
deleteTask_title: 'Görevi Sil',
|
||||
deleteUser: 'Kullanıcıyı sil',
|
||||
edit: 'Düzenle',
|
||||
editDueDate_title: 'Son Tarihi Düzenle',
|
||||
editDescription_title: 'Açıklamayı Düzenle',
|
||||
editEmail_title: 'E-posta Adresini Düzenle',
|
||||
editPassword_title: 'Şifreyi Değiştir',
|
||||
editStopwatch_title: 'Kronometreyi Düzenle',
|
||||
editTitle_title: 'Başlığı düzenle',
|
||||
editUsername_title: 'Kullanıcı Adını Düzenle',
|
||||
hideDetails: 'Ayrıntıları gizle',
|
||||
leaveBoard: 'Panodan Ayrıl',
|
||||
leaveProject: 'Projeden ayrıl',
|
||||
logOut_title: 'Çıkış',
|
||||
makeCover_title: 'Önizleme olarak ayarla',
|
||||
move: 'Taşı',
|
||||
moveCard_title: 'Kartı Taşı',
|
||||
remove: 'Sil',
|
||||
removeBackground: 'Arka planı kaldır',
|
||||
removeCover_title: 'Önizlemeyi Kaldır',
|
||||
removeFromBoard: 'Panodan kaldır',
|
||||
removeFromProject: 'Projeden kaldır',
|
||||
removeManager: 'Yöneticiyi kaldır',
|
||||
removeMember: 'Üyeyi kaldır',
|
||||
save: 'Kaydet',
|
||||
showAllAttachments: 'Tüm ekleri göster ({{hidden}} gizli)',
|
||||
showDetails: 'Ayrıntıları göster',
|
||||
showFewerAttachments: 'Daha az ek göster',
|
||||
start: 'başlat',
|
||||
stop: 'dur',
|
||||
subscribe: 'Abone ol',
|
||||
unsubscribe: 'Abonelikten çık',
|
||||
uploadNewAvatar: 'Yeni avatar yükle',
|
||||
uploadNewImage: 'Yeni resim yükle',
|
||||
areYouSureYouWantToDeleteThisAttachment: 'Bu eki silmek istediğinize emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisBoard: 'Bu panoyu silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisCard: 'Bu kartı silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisComment: 'Bu yorumu silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisLabel: 'Bu etiketi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisList: 'Bu listeyi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisProject: 'Bu projeyi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisTask: 'Bu görevi silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToDeleteThisUser: 'Bu kullanıcıyı silmek istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToLeaveBoard: 'Panodan ayrılmak istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToLeaveProject: 'Projeden ayrılmak istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToRemoveThisManagerFromProject:
|
||||
'Bu yöneticiyi projeden çıkarmak istediğinizden emin misiniz?',
|
||||
areYouSureYouWantToRemoveThisMemberFromBoard:
|
||||
'Bu üyeyi panodan çıkarmak istediğinizden emin misiniz?',
|
||||
attachment: 'ek',
|
||||
attachments: 'ekler',
|
||||
authentication: 'kimlik doğrulama',
|
||||
background: 'arka plan',
|
||||
board: 'pano',
|
||||
boardNotFound_title: 'Pano bulunamadı',
|
||||
cardActions_title: 'Kart İşlemleri',
|
||||
cardNotFound_title: 'Kart bulunamadı',
|
||||
cardOrActionAreDeleted: 'Kart veya işlem silindi',
|
||||
color: 'renk',
|
||||
createBoard_title: 'Pano Oluştur',
|
||||
createLabel_title: 'Etiket Oluştur',
|
||||
createNewOneOrSelectExistingOne: 'Yeni bir tane oluşturun veya mevcut bir tanesini seçin.',
|
||||
createProject_title: 'Proje Oluştur',
|
||||
createTextFile_title: 'Metin Dosyası Oluştur',
|
||||
currentPassword: 'Geçerli şifre',
|
||||
dangerZone_title: 'Tehlikeli Bölge',
|
||||
date: 'tarih',
|
||||
dueDate_title: 'Termin Tarihi',
|
||||
deleteAttachment_title: 'Eki Sil',
|
||||
deleteBoard_title: 'Panoyu Sil',
|
||||
deleteCard_title: 'Kartı Sil',
|
||||
deleteComment_title: 'Yorumu Sil',
|
||||
deleteLabel_title: 'Etiketi Sil',
|
||||
deleteList_title: 'Listeyi Sil',
|
||||
deleteProject_title: 'Projeyi Sil',
|
||||
deleteTask_title: 'Görevi Sil',
|
||||
deleteUser_title: 'Kullanıcıyı Sil',
|
||||
description: 'açıklama',
|
||||
detectAutomaically: 'Otomatik olarak algıla',
|
||||
dropFileToUpload: 'Yüklenecek dosyayı buraya bırakın',
|
||||
editAttachment_title: 'Eki Düzenle',
|
||||
editAvatar_title: 'Avatarı Düzenle',
|
||||
editBoard_title: 'Panoyu Düzenle',
|
||||
editDueDate_title: 'Son Tarihi Düzenle',
|
||||
editEmail_title: 'E-posta Adresini Düzenle',
|
||||
editLabel_title: 'Etiketi Düzenle',
|
||||
editPassword_title: 'Şifreyi Değiştir',
|
||||
editStopwatch_title: 'Kronometreyi Düzenle',
|
||||
editUsername_title: 'Kullanıcı Adını Düzenle',
|
||||
email: 'e-posta',
|
||||
emailAlreadyInUse: 'E-posta adresi zaten kullanımda',
|
||||
enterCardTitle: 'Kart başlığını girin',
|
||||
enterDescription: 'Açıklamayı girin',
|
||||
enterFilename: 'Dosya adını girin',
|
||||
enterListTitle: 'Liste başlığını girin',
|
||||
enterProjectTitle: 'Proje başlığını girin',
|
||||
enterTaskDescription: 'Görev açıklamasını girin',
|
||||
filterByLabels_title: 'Etikete Göre Filtrele',
|
||||
filterByMembers_title: 'Üyelere göre filtrele',
|
||||
fromComputer_title: 'Bilgisayardan',
|
||||
general: 'Genel',
|
||||
hours: 'saat',
|
||||
invalidCurrentPassword: 'Mevcut şifre yanlış',
|
||||
labels: 'etiketler',
|
||||
language: 'dil',
|
||||
leaveBoard_title: 'Panodan Ayrıl',
|
||||
leaveProject_title: 'Projeden Ayrıl',
|
||||
list: 'Listeler',
|
||||
listActions_title: 'Görevleri Listele',
|
||||
managers: 'Yöneticiler',
|
||||
members: 'Üyeler',
|
||||
minutes: 'dakika',
|
||||
moveCard_title: 'Kartı Taşı',
|
||||
name: 'isim',
|
||||
newEmail: 'Yeni e-posta adresi',
|
||||
newPassword: 'Yeni şifre',
|
||||
newUsername: 'Yeni kullanıcı adı',
|
||||
noConnectionToServer: 'Sunucuya bağlantı yok',
|
||||
noBoards: 'Pano yok',
|
||||
noLists: 'Liste yok',
|
||||
noProjects: 'Proje yok',
|
||||
notifications: 'Bildirimler',
|
||||
noUnreadNotifications: 'Okunmamış bildirim yok',
|
||||
openBoard_title: 'Açık Pano',
|
||||
optional_inline: 'İsteğe bağlı',
|
||||
organization: 'Organizasyon',
|
||||
phone: 'telefon',
|
||||
preferences: 'Tercihler',
|
||||
pressPasteShortcutToAddAttachmentFromClipboard:
|
||||
'İpucu: Panodan bir ek eklemek için CTRL-V ye (Macte Cmd-V) basın',
|
||||
project: 'Proje',
|
||||
projectNotFound_title: 'Proje bulunamadı',
|
||||
removeManager_title: 'Yöneticiyi Kaldır',
|
||||
removeMember_title: 'Üyeyi Kaldır',
|
||||
seconds: 'saniye',
|
||||
selectBoard: 'Pano Seç',
|
||||
selectList: 'Liste seç',
|
||||
selectProject: 'Proje seç',
|
||||
settings: 'Ayarlar',
|
||||
stopwatch: 'kronometre',
|
||||
subscribeToMyOwnCardsByDefault: 'Varsayılan olarak kendi kartlarıma abone ol',
|
||||
taskActions_title: 'Görev Eylemleri',
|
||||
tasks: 'Görevler',
|
||||
thereIsNoPreviewAvailableForThisAttachment: 'Bu ek için önizleme mevcut değil',
|
||||
time: 'zaman',
|
||||
title: 'başlık',
|
||||
userActions_title: 'Kullanıcı İşlemleri',
|
||||
userAddedThisCardToList: '<0>{{user}}</0><1> bu kartı {{list}</1> listesine ekledi',
|
||||
userLeftNewCommentToCard:
|
||||
'{{user}} yeni bir yorum yazdı: <2>{{card}</2> kartına «{{comment}}»',
|
||||
userMovedCardFromListToList:
|
||||
'{{user}}, <2>{{card}></2> kartını {{fromList}} listesinden {{toList}} listesine taşıdı',
|
||||
userMovedThisCardFromListToList:
|
||||
'<0>{{user}}</0><1> bu kartı {{fromList}} konumundan {{toList}}</1> konumuna taşıdı',
|
||||
username: 'kullanıcı adı',
|
||||
usernameAlreadyInUse: 'Kullanıcı adı zaten kullanımda',
|
||||
users: 'kullanıcı',
|
||||
writeComment: 'Yorum yazın',
|
||||
},
|
||||
action: {
|
||||
addAnotherCard: 'Başka bir kart ekle',
|
||||
addAnotherList: 'Başka bir liste ekle',
|
||||
addAnotherTask: 'Başka bir görev ekle',
|
||||
addCard: 'Kart ekle',
|
||||
addCard_title: 'Kart Ekle',
|
||||
addComment: 'Yorum ekle',
|
||||
addList: 'Liste ekle',
|
||||
addMoreDetailedDescription: 'Ayrıntılı bir açıklama ekleyin',
|
||||
addTask: 'Görev ekle',
|
||||
addToCard: 'Karta ekle',
|
||||
addUser: 'Kullanıcı ekle',
|
||||
createBoard: 'Pano oluştur',
|
||||
createFile: 'Dosya oluştur',
|
||||
createLabel: 'Etiket Oluştur',
|
||||
createNewLabel: 'Yeni etiket oluştur',
|
||||
createProject: 'Proje oluştur',
|
||||
delete: 'Sil',
|
||||
deleteAttachment: 'Eki sil',
|
||||
deleteAvatar: 'Avatarı sil',
|
||||
deleteBoard: 'Panoyu Sil',
|
||||
deleteCard: 'Kartı sil',
|
||||
deleteCard_title: 'Kartı Sil',
|
||||
deleteComment: 'Yorumu sil',
|
||||
deleteImage: 'Resmi sil',
|
||||
deleteLabel: 'Etiketi sil',
|
||||
deleteList: 'Listeyi sil',
|
||||
deleteList_title: 'Listeyi Sil',
|
||||
deleteProject: 'Projeyi sil',
|
||||
deleteProject_title: 'Projeyi Sil',
|
||||
deleteTask: 'Görevi sil',
|
||||
deleteTask_title: 'Görevi Sil',
|
||||
deleteUser: 'Kullanıcıyı sil',
|
||||
edit: 'Düzenle',
|
||||
editDueDate_title: 'Son Tarihi Düzenle',
|
||||
editDescription_title: 'Açıklamayı Düzenle',
|
||||
editEmail_title: 'E-posta Adresini Düzenle',
|
||||
editPassword_title: 'Şifreyi Değiştir',
|
||||
editStopwatch_title: 'Kronometreyi Düzenle',
|
||||
editTitle_title: 'Başlığı düzenle',
|
||||
editUsername_title: 'Kullanıcı Adını Düzenle',
|
||||
hideDetails: 'Ayrıntıları gizle',
|
||||
leaveBoard: 'Panodan Ayrıl',
|
||||
leaveProject: 'Projeden ayrıl',
|
||||
logOut_title: 'Çıkış',
|
||||
makeCover_title: 'Önizleme olarak ayarla',
|
||||
move: 'Taşı',
|
||||
moveCard_title: 'Kartı Taşı',
|
||||
remove: 'Sil',
|
||||
removeBackground: 'Arka planı kaldır',
|
||||
removeCover_title: 'Önizlemeyi Kaldır',
|
||||
removeFromBoard: 'Panodan kaldır',
|
||||
removeFromProject: 'Projeden kaldır',
|
||||
removeManager: 'Yöneticiyi kaldır',
|
||||
removeMember: 'Üyeyi kaldır',
|
||||
save: 'Kaydet',
|
||||
showAllAttachments: 'Tüm ekleri göster ({{hidden}} gizli)',
|
||||
showDetails: 'Ayrıntıları göster',
|
||||
showFewerAttachments: 'Daha az ek göster',
|
||||
start: 'başlat',
|
||||
stop: 'dur',
|
||||
subscribe: 'Abone ol',
|
||||
unsubscribe: 'Abonelikten çık',
|
||||
uploadNewAvatar: 'Yeni avatar yükle',
|
||||
uploadNewImage: 'Yeni resim yükle',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -50,6 +50,9 @@ export default class extends BaseModel {
|
|||
isAdmin: attr({
|
||||
getDefault: () => false,
|
||||
}),
|
||||
isLocked: attr({
|
||||
getDefault: () => false,
|
||||
}),
|
||||
isAvatarUpdating: attr({
|
||||
getDefault: () => false,
|
||||
}),
|
||||
|
|
|
@ -24,6 +24,12 @@ services:
|
|||
- DATABASE_URL=postgresql://postgres@postgres/planka
|
||||
- SECRET_KEY=notsecretkey
|
||||
|
||||
# Can be removed after installation
|
||||
- DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted
|
||||
- DEFAULT_ADMIN_PASSWORD=demo
|
||||
- DEFAULT_ADMIN_NAME=Demo Demo
|
||||
- DEFAULT_ADMIN_USERNAME=demo
|
||||
|
||||
# related: https://github.com/knex/knex/issues/2354
|
||||
# As knex does not pass query parameters from the connection string we
|
||||
# have to use environment variables in order to pass the desired values, e.g.
|
||||
|
|
|
@ -4,6 +4,13 @@ BASE_URL=http://localhost:1337
|
|||
DATABASE_URL=postgresql://postgres@localhost/planka
|
||||
SECRET_KEY=notsecretkey
|
||||
|
||||
## Can be removed after installation
|
||||
|
||||
DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted
|
||||
DEFAULT_ADMIN_PASSWORD=demo
|
||||
DEFAULT_ADMIN_NAME=Demo Demo
|
||||
DEFAULT_ADMIN_USERNAME=demo
|
||||
|
||||
## Optional
|
||||
|
||||
# TRUST_PROXY=0
|
||||
|
|
|
@ -26,6 +26,10 @@ module.exports = {
|
|||
throw Errors.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (user.email === sails.config.custom.defaultAdminEmail) {
|
||||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
user = await sails.helpers.users.deleteOne.with({
|
||||
record: user,
|
||||
request: this.req,
|
||||
|
|
|
@ -59,6 +59,10 @@ module.exports = {
|
|||
throw Errors.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (user.email === sails.config.custom.defaultAdminEmail) {
|
||||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
if (
|
||||
inputs.id === currentUser.id &&
|
||||
!bcrypt.compareSync(inputs.currentPassword, user.password)
|
||||
|
|
|
@ -58,6 +58,10 @@ module.exports = {
|
|||
throw Errors.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (user.email === sails.config.custom.defaultAdminEmail) {
|
||||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
if (
|
||||
inputs.id === currentUser.id &&
|
||||
!bcrypt.compareSync(inputs.currentPassword, user.password)
|
||||
|
|
|
@ -61,6 +61,10 @@ module.exports = {
|
|||
throw Errors.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (user.email === sails.config.custom.defaultAdminEmail) {
|
||||
throw Errors.USER_NOT_FOUND; // Forbidden
|
||||
}
|
||||
|
||||
if (
|
||||
inputs.id === currentUser.id &&
|
||||
!bcrypt.compareSync(inputs.currentPassword, user.password)
|
||||
|
|
|
@ -67,6 +67,13 @@ module.exports = {
|
|||
throw Errors.USER_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (user.email === sails.config.custom.defaultAdminEmail) {
|
||||
/* eslint-disable no-param-reassign */
|
||||
delete inputs.isAdmin;
|
||||
delete inputs.name;
|
||||
/* eslint-enable no-param-reassign */
|
||||
}
|
||||
|
||||
const values = {
|
||||
..._.pick(inputs, [
|
||||
'isAdmin',
|
||||
|
|
|
@ -114,6 +114,7 @@ module.exports = {
|
|||
avatarUrl:
|
||||
this.avatar &&
|
||||
`${sails.config.custom.userAvatarsUrl}/${this.avatar.dirname}/square-100.${this.avatar.extension}`,
|
||||
isLocked: this.email === sails.config.custom.defaultAdminEmail,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
@ -35,9 +35,11 @@ module.exports.custom = {
|
|||
oidcAudience: process.env.OIDC_AUDIENCE,
|
||||
oidcClientId: process.env.OIDC_CLIENT_ID,
|
||||
oidcRolesAttribute: process.env.OIDC_ROLES_ATTRIBUTE || 'groups',
|
||||
oidcAdminRoles: process.env.OIDC_ADMIN_ROLES.split(',') || [],
|
||||
oidcAdminRoles: process.env.OIDC_ADMIN_ROLES ? process.env.OIDC_ADMIN_ROLES.split(',') : [],
|
||||
oidcredirectUri: process.env.OIDC_REDIRECT_URI,
|
||||
oidcJwksUri: process.env.OIDC_JWKS_URI,
|
||||
oidcScopes: process.env.OIDC_SCOPES || 'openid profile email',
|
||||
oidcSkipUserInfo: process.env.OIDC_SKIP_USER_INFO === 'true',
|
||||
|
||||
defaultAdminEmail: process.env.DEFAULT_ADMIN_EMAIL,
|
||||
};
|
||||
|
|
|
@ -6,12 +6,8 @@ const knex = initKnex(knexfile);
|
|||
|
||||
(async () => {
|
||||
try {
|
||||
const isExists = await knex.schema.hasTable(knexfile.migrations.tableName);
|
||||
|
||||
await knex.migrate.latest();
|
||||
if (!isExists) {
|
||||
await knex.seed.run();
|
||||
}
|
||||
await knex.seed.run();
|
||||
} catch (error) {
|
||||
process.exitCode = 1;
|
||||
|
||||
|
|
|
@ -1,12 +1,42 @@
|
|||
const bcrypt = require('bcrypt');
|
||||
|
||||
exports.seed = (knex) =>
|
||||
knex('user_account').insert({
|
||||
email: 'demo@demo.demo',
|
||||
password: bcrypt.hashSync('demo', 10),
|
||||
const buildData = () => {
|
||||
const data = {
|
||||
isAdmin: true,
|
||||
name: 'Demo Demo',
|
||||
username: 'demo',
|
||||
subscribeToOwnCards: false,
|
||||
createdAt: new Date().toISOString(),
|
||||
});
|
||||
};
|
||||
|
||||
if (process.env.DEFAULT_ADMIN_PASSWORD) {
|
||||
data.password = bcrypt.hashSync(process.env.DEFAULT_ADMIN_PASSWORD, 10);
|
||||
}
|
||||
if (process.env.DEFAULT_ADMIN_NAME) {
|
||||
data.name = process.env.DEFAULT_ADMIN_NAME;
|
||||
}
|
||||
if (process.env.DEFAULT_ADMIN_USERNAME) {
|
||||
data.username = process.env.DEFAULT_ADMIN_USERNAME;
|
||||
}
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
exports.seed = async (knex) => {
|
||||
if (!process.env.DEFAULT_ADMIN_EMAIL) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = buildData();
|
||||
|
||||
try {
|
||||
await knex('user_account').insert({
|
||||
...data,
|
||||
email: process.env.DEFAULT_ADMIN_EMAIL,
|
||||
subscribeToOwnCards: false,
|
||||
createdAt: new Date().toISOString(),
|
||||
});
|
||||
} catch (error) {
|
||||
if (Object.keys(data).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
await knex('user_account').update(data).where('email', process.env.DEFAULT_ADMIN_EMAIL);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue