Skip to content

Commit

Permalink
Merge branch 'twentyhq:main' into TopRightKanbanAddButton
Browse files Browse the repository at this point in the history
  • Loading branch information
ehconitin authored Sep 10, 2024
2 parents aedb64d + ace0f7b commit 24107c4
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion packages/twenty-emails/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twenty-emails",
"version": "0.24.0",
"version": "0.24.2",
"description": "",
"author": "",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-front/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twenty-front",
"version": "0.24.0",
"version": "0.24.2",
"private": true,
"type": "module",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,24 @@ export const TaskGroups = ({
);
}

const sortedTasksByStatus = Object.entries(
groupBy(tasks, ({ status }) => status),
).toSorted(([statusA], [statusB]) => statusB.localeCompare(statusA));

return (
<StyledContainer>
{Object.entries(groupBy(tasks, ({ status }) => status)).map(
([status, tasksByStatus]: [string, Task[]]) => (
<TaskList
key={status}
title={status}
tasks={tasksByStatus}
button={
showAddButton && (
<AddTaskButton activityTargetableObjects={targetableObjects} />
)
}
/>
),
)}
{sortedTasksByStatus.map(([status, tasksByStatus]: [string, Task[]]) => (
<TaskList
key={status}
title={status}
tasks={tasksByStatus}
button={
showAddButton && (
<AddTaskButton activityTargetableObjects={targetableObjects} />
)
}
/>
))}
</StyledContainer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const StyledTaskBody = styled.div`
max-width: 100%;
flex: 1;
overflow: hidden;
padding-bottom: ${({ theme }) => theme.spacing(0.25)};
`;

const StyledTaskTitle = styled.div<{
Expand All @@ -44,10 +46,13 @@ const StyledTaskTitle = styled.div<{
color: ${({ theme }) => theme.font.color.primary};
font-weight: ${({ theme }) => theme.font.weight.medium};
padding: 0 ${({ theme }) => theme.spacing(2)};
padding-bottom: ${({ theme }) => theme.spacing(0.25)};
text-decoration: ${({ completed }) => (completed ? 'line-through' : 'none')};
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
align-items: center;
`;

const StyledDueDate = styled.div<{
Expand All @@ -71,8 +76,10 @@ const StyledPlaceholder = styled.div`
`;

const StyledLeftSideContainer = styled.div`
align-items: center;
display: flex;
flex: 1;
overflow: hidden;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';

const StyledTimelineItemContainer = styled.div`
color: ${({ theme }) => theme.font.color.primary};
display: flex;
gap: ${({ theme }) => theme.spacing(4)};
height: 'auto';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import styled from '@emotion/styled';
import { ReactNode } from 'react';

import { OBJECT_SETTINGS_WIDTH } from '@/settings/data-model/constants/ObjectSettings';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { isDefined } from '~/utils/isDefined';

import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import styled from '@emotion/styled';
import { ReactNode } from 'react';
import { isDefined } from '~/utils/isDefined';

const StyledSettingsPageContainer = styled.div<{ width?: number }>`
display: flex;
Expand All @@ -24,17 +22,12 @@ const StyledSettingsPageContainer = styled.div<{ width?: number }>`
}};
`;

const StyledScrollWrapper = styled(ScrollWrapper)`
background-color: ${({ theme }) => theme.background.secondary};
border-radius: ${({ theme }) => theme.border.radius.md};
`;

export const SettingsPageContainer = ({
children,
}: {
children: ReactNode;
}) => (
<StyledScrollWrapper contextProviderName="settingsPageContainer">
<ScrollWrapper contextProviderName="settingsPageContainer">
<StyledSettingsPageContainer>{children}</StyledSettingsPageContainer>
</StyledScrollWrapper>
</ScrollWrapper>
);
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import styled from '@emotion/styled';
import React from 'react';
import { Link } from 'react-router-dom';
import { Link, LinkProps } from 'react-router-dom';

const StyledUndecoratedLink = styled(Link)<{ fullWidth: boolean }>`
type StyledLinkProps = LinkProps & {
fullWidth?: boolean;
};

const StyledUndecoratedLink = styled(
// eslint-disable-next-line react/jsx-props-no-spreading
({ fullWidth: _, ...props }: StyledLinkProps) => <Link {...props} />,
)<StyledLinkProps>`
text-decoration: none;
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,21 @@ export const ViewPickerCreateOrEditContent = () => {

const { handleCreate, handleUpdate } = useViewPickerPersistView();

const { availableFieldsForKanban } = useGetAvailableFieldsForKanban();

useScopedHotkeys(
Key.Enter,
async () => {
if (viewPickerIsPersisting) {
return;
}
if (viewPickerMode === 'create') {
if (
viewPickerType === ViewType.Kanban &&
availableFieldsForKanban.length === 0
) {
return;
}
await handleCreate();
}
if (viewPickerMode === 'edit') {
Expand All @@ -100,8 +108,6 @@ export const ViewPickerCreateOrEditContent = () => {
setViewPickerSelectedIcon(iconKey);
};

const { availableFieldsForKanban } = useGetAvailableFieldsForKanban();

const handleClose = async () => {
if (viewPickerMode === 'edit') {
await handleUpdate();
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twenty-server",
"version": "0.24.0",
"version": "0.24.2",
"description": "",
"author": "",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twenty-ui",
"version": "0.24.0",
"version": "0.24.2",
"type": "module",
"main": "./src/index.ts",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/twenty-website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twenty-website",
"version": "0.24.0",
"version": "0.24.2",
"private": true,
"scripts": {
"nx": "NX_DEFAULT_PROJECT=twenty-website node ../../node_modules/nx/bin/nx.js",
Expand Down

0 comments on commit 24107c4

Please sign in to comment.