mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
fix: Responsive color buttons, cleanup
This commit is contained in:
parent
2813cab2e1
commit
cee11f627b
8 changed files with 46 additions and 119 deletions
|
@ -15,8 +15,6 @@ import { useForm } from '../../../hooks';
|
||||||
import LABEL_COLORS from '../../../constants/LabelColors';
|
import LABEL_COLORS from '../../../constants/LabelColors';
|
||||||
import Editor from './Editor';
|
import Editor from './Editor';
|
||||||
|
|
||||||
import styles from './AddStep.module.scss';
|
|
||||||
|
|
||||||
const AddStep = React.memo(({ cardId, defaultData, onBack }) => {
|
const AddStep = React.memo(({ cardId, defaultData, onBack }) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
@ -52,7 +50,7 @@ const AddStep = React.memo(({ cardId, defaultData, onBack }) => {
|
||||||
<Popup.Content>
|
<Popup.Content>
|
||||||
<Form onSubmit={handleSubmit}>
|
<Form onSubmit={handleSubmit}>
|
||||||
<Editor data={data} onFieldChange={handleFieldChange} />
|
<Editor data={data} onFieldChange={handleFieldChange} />
|
||||||
<Button positive content={t('action.createLabel')} className={styles.submitButton} />
|
<Button positive content={t('action.createLabel')} />
|
||||||
</Form>
|
</Form>
|
||||||
</Popup.Content>
|
</Popup.Content>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
/*!
|
|
||||||
* Copyright (c) 2024 PLANKA Software GmbH
|
|
||||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
||||||
*/
|
|
||||||
|
|
||||||
:global(#app) {
|
|
||||||
.submitButton {
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -89,19 +89,18 @@ const EditStep = React.memo(({ labelId, onBack }) => {
|
||||||
})}
|
})}
|
||||||
</Popup.Header>
|
</Popup.Header>
|
||||||
<Popup.Content>
|
<Popup.Content>
|
||||||
<div className={styles.content}>
|
|
||||||
<Form onSubmit={handleSubmit}>
|
<Form onSubmit={handleSubmit}>
|
||||||
<Editor data={data} onFieldChange={handleFieldChange} />
|
<Editor data={data} onFieldChange={handleFieldChange} />
|
||||||
<div className={styles.actions}>
|
<div className={styles.actions}>
|
||||||
<Button positive content={t('action.save')} className={styles.submitButton} />
|
<Button positive content={t('action.save')} />
|
||||||
<Button
|
<Button
|
||||||
|
type="button"
|
||||||
content={t('action.delete')}
|
content={t('action.delete')}
|
||||||
className={styles.deleteButton}
|
className={styles.deleteButton}
|
||||||
onClick={handleDeleteClick}
|
onClick={handleDeleteClick}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
|
||||||
</Popup.Content>
|
</Popup.Content>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,15 +4,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
:global(#app) {
|
:global(#app) {
|
||||||
|
.actions {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
.deleteButton {
|
.deleteButton {
|
||||||
box-shadow: 0 1px 0 #cbcccc;
|
box-shadow: 0 1px 0 #cbcccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.actions {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 12px;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,8 @@
|
||||||
|
|
||||||
:global(#app) {
|
:global(#app) {
|
||||||
.colorButton {
|
.colorButton {
|
||||||
float: left;
|
margin: 0;
|
||||||
height: 30px;
|
|
||||||
margin: 3px;
|
|
||||||
padding: 0;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 41.6px;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
@ -18,28 +14,43 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.colorButtonActive:before {
|
.colorButtonActive:before {
|
||||||
bottom: 1px;
|
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
content: "Г";
|
content: "Г";
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 4px;
|
right: calc(50% - 5px);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
|
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
|
||||||
top: 0;
|
top: calc(50% - 17px);
|
||||||
transform: rotate(-135deg);
|
transform: rotate(-135deg);
|
||||||
width: 32px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.colorButtons {
|
.colorButtons {
|
||||||
margin: -3px;
|
display: grid;
|
||||||
padding-bottom: 16px;
|
gap: 6px;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
|
||||||
|
margin-bottom: 12px;
|
||||||
|
max-height: 60vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
&:after {
|
@supports (-moz-appearance: none) {
|
||||||
clear: both;
|
scrollbar-color: rgba(0, 0, 0, 0.32) transparent;
|
||||||
content: "";
|
scrollbar-width: thin;
|
||||||
display: table;
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background-clip: padding-box;
|
||||||
|
border-left: 0.25em transparent solid;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
border-radius: 3px !important;
|
border-radius: 3px !important;
|
||||||
border-width: 0 !important;
|
border-width: 0 !important;
|
||||||
box-shadow: 0 8px 16px -4px rgba(9, 45, 66, 0.25),
|
box-shadow: 0 8px 16px -4px rgba(9, 45, 66, 0.25),
|
||||||
|
@ -26,13 +24,4 @@
|
||||||
max-height: calc(100% - 70px);
|
max-height: calc(100% - 70px);
|
||||||
padding: 0 12px 12px !important;
|
padding: 0 12px 12px !important;
|
||||||
width: 304px;
|
width: 304px;
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 900px) {
|
|
||||||
.wrapper {
|
|
||||||
width: 95vw;
|
|
||||||
max-width: 100vw;
|
|
||||||
max-height: 90vh;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
/*!
|
|
||||||
* Copyright (c) 2024 PLANKA Software GmbH
|
|
||||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
inputs: {},
|
|
||||||
|
|
||||||
async fn() {
|
|
||||||
const { currentUser } = this.req;
|
|
||||||
|
|
||||||
// Get all cards where the user is a member
|
|
||||||
const cardMemberships = await CardMembership.find({ userId: currentUser.id });
|
|
||||||
const cardIdsByMembership = cardMemberships.map((cm) => cm.cardId);
|
|
||||||
|
|
||||||
// Get all cards where the user is the author
|
|
||||||
const cardsByAuthor = await Card.find({ creatorUserId: currentUser.id });
|
|
||||||
const cardIdsByAuthor = cardsByAuthor.map((c) => c.id);
|
|
||||||
|
|
||||||
// Merge card ids
|
|
||||||
const cardIds = Array.from(new Set([...cardIdsByMembership, ...cardIdsByAuthor]));
|
|
||||||
if (cardIds.length === 0) {
|
|
||||||
return { items: [], included: {} };
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get cards
|
|
||||||
const cards = await Card.qm.getByIds(cardIds);
|
|
||||||
|
|
||||||
// Collect related data
|
|
||||||
const users = await User.qm.getByIds(cards.map((c) => c.creatorUserId));
|
|
||||||
const cardMembershipsAll = await CardMembership.qm.getByCardIds(cardIds);
|
|
||||||
const cardLabels = await CardLabel.qm.getByCardIds(cardIds);
|
|
||||||
const taskLists = await TaskList.qm.getByCardIds(cardIds);
|
|
||||||
const taskListIds = taskLists.map((tl) => tl.id);
|
|
||||||
const tasks = await Task.qm.getByTaskListIds(taskListIds);
|
|
||||||
const attachments = await Attachment.qm.getByCardIds(cardIds);
|
|
||||||
const customFieldGroups = await CustomFieldGroup.qm.getByCardIds(cardIds);
|
|
||||||
const customFieldGroupIds = customFieldGroups.map((cfg) => cfg.id);
|
|
||||||
const customFields = await CustomField.qm.getByCustomFieldGroupIds(customFieldGroupIds);
|
|
||||||
const customFieldValues = await CustomFieldValue.qm.getByCardIds(cardIds);
|
|
||||||
|
|
||||||
return {
|
|
||||||
items: cards,
|
|
||||||
included: {
|
|
||||||
cardMemberships: cardMembershipsAll,
|
|
||||||
cardLabels,
|
|
||||||
taskLists,
|
|
||||||
tasks,
|
|
||||||
customFieldGroups,
|
|
||||||
customFields,
|
|
||||||
customFieldValues,
|
|
||||||
users: sails.helpers.users.presentMany(users, currentUser),
|
|
||||||
attachments: sails.helpers.attachments.presentMany(attachments),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
|
|
@ -227,8 +227,6 @@ module.exports.routes = {
|
||||||
skipAssets: false,
|
skipAssets: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
'GET /api/cards/assigned': 'cards/assigned',
|
|
||||||
|
|
||||||
'GET /*': {
|
'GET /*': {
|
||||||
view: 'index',
|
view: 'index',
|
||||||
skipAssets: true,
|
skipAssets: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue