Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade mantine monorepo to v7 #104

Merged
merged 33 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6554aed
Update mantine monorepo to v7
renovate[bot] Dec 20, 2023
3c494c2
Add postcss and configure
maximilianruesch Dec 20, 2023
37402ca
Upgrade electron-forge to 6.4.2
maximilianruesch Dec 20, 2023
606acb9
Remove electron-forge workarounds
maximilianruesch Dec 20, 2023
833ff12
Revert "Remove electron-forge workarounds"
maximilianruesch Dec 20, 2023
2ac7fa2
Make project canvas able to start
maximilianruesch Dec 20, 2023
7708843
Resolve some errors
maximilianruesch Dec 20, 2023
c690661
Fix main layout
maximilianruesch Dec 21, 2023
23f22ba
Pull color scheme management out into shared function
maximilianruesch Dec 21, 2023
1d1a9f5
Correct typo
maximilianruesch Dec 21, 2023
f143326
Extract and fix common issue status menu component
maximilianruesch Dec 21, 2023
83ddd90
Add missing colors to theme
maximilianruesch Dec 21, 2023
98d0eac
Migrate away from deprecated color prop
maximilianruesch Dec 21, 2023
c8db14e
Extract common user select
maximilianruesch Dec 21, 2023
f1293a0
Fix most of the select components
maximilianruesch Dec 21, 2023
fe9b7d6
Fix user select for undefined props
maximilianruesch Dec 21, 2023
a4e5338
Unify badge components
maximilianruesch Dec 21, 2023
04e8f8d
Resolve some type errors and typos
maximilianruesch Dec 22, 2023
5973039
Fix projects table styling
maximilianruesch Dec 22, 2023
66e4cc2
Fix types in story points estimate menu
maximilianruesch Dec 22, 2023
15f9fea
Fix tests
maximilianruesch Dec 22, 2023
03fded2
Swap order of light-dark values
maximilianruesch Dec 22, 2023
a10c8f5
Fix label problems
maximilianruesch Dec 27, 2023
33fe3fe
Add custom item select
maximilianruesch Dec 27, 2023
892acc6
Use new custom select for editable epics
maximilianruesch Dec 27, 2023
b5582b8
Fix custom select problems and use in more selects
maximilianruesch Dec 27, 2023
9caa0e3
Fix delete button problems
maximilianruesch Dec 27, 2023
2a3b998
Fix epic editing problems
maximilianruesch Dec 28, 2023
fb18793
Switch to a more actively maintained dnd library that properly suppor…
maximilianruesch Dec 28, 2023
1dbb9d2
Resolve draggable issues
maximilianruesch Dec 28, 2023
bd2ea02
Resolve draggable story map cards
maximilianruesch Dec 28, 2023
8ada19c
Fix some styling issues with story maps
maximilianruesch Dec 28, 2023
575741e
Deactivate delete button on issue card for now
maximilianruesch Dec 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ export class JiraCloudProvider implements IProvider {
...(summary && {
summary,
}),
...(epic && epic.issueKey && {
...(epic && epic.issueKey !== undefined && {
parent: { key: epic.issueKey },
}),
...(type && {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ export class JiraServerProvider implements IProvider {
...(summary && {
summary,
}),
...(epic && epic.issueKey && {
...(epic && epic.issueKey !== undefined && {
parent: { key: epic.issueKey },
}),
...(type && {
Expand Down
5 changes: 4 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"setupFilesAfterEnv": ["@testing-library/jest-dom/extend-expect"],
"setupFilesAfterEnv": [
"@testing-library/jest-dom/extend-expect",
"./src/test/setup-undefined-jsdom-properties.ts"
],
"modulePathIgnorePatterns": ["/e2e"]
}
40 changes: 21 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
"dependencies": {
"@emotion/react": "^11.10.6",
"@fastify/env": "^4.2.0",
"@mantine/core": "^5.10.0",
"@mantine/dates": "^5.10.0",
"@mantine/form": "^5.10.0",
"@mantine/hooks": "^5.10.0",
"@mantine/notifications": "^5.10.0",
"@hello-pangea/dnd": "^16.5.0",
"@mantine/core": "^7.0.0",
"@mantine/dates": "^7.0.0",
"@mantine/form": "^7.0.0",
"@mantine/hooks": "^7.0.0",
"@mantine/notifications": "^7.0.0",
"@tabler/icons": "^1.116.1",
"@tanstack/react-query": "^4.23.0",
"@tanstack/react-query-devtools": "^4.23.0",
"@types/file-saver": "^2.0.5",
"@types/react-beautiful-dnd": "^13.1.3",
"axios": "^1.6.1",
"cross-fetch": "^3.1.5",
"dayjs": "^1.11.7",
Expand All @@ -47,21 +47,20 @@
"i18next": "21.10.0",
"immer": "^9.0.19",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.2.0",
"react-i18next": "11.18.6",
"react-router-dom": "^6.4.5",
"use-immer": "^0.8.1",
"zustand": "^4.3.1"
},
"devDependencies": {
"@electron-forge/cli": "^6.1.1",
"@electron-forge/maker-deb": "^6.1.1",
"@electron-forge/maker-rpm": "^6.1.1",
"@electron-forge/maker-squirrel": "^6.1.1",
"@electron-forge/maker-zip": "^6.1.1",
"@electron-forge/plugin-vite": "6.1.1",
"@electron-forge/publisher-github": "^6.1.1",
"@electron-forge/cli": "^6.4.2",
"@electron-forge/maker-deb": "^6.4.2",
"@electron-forge/maker-rpm": "^6.4.2",
"@electron-forge/maker-squirrel": "^6.4.2",
"@electron-forge/maker-zip": "^6.4.2",
"@electron-forge/plugin-vite": "6.4.2",
"@electron-forge/publisher-github": "^6.4.2",
"@playwright/test": "^1.32.3",
"@testing-library/dom": "^9.0.0",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -70,9 +69,11 @@
"@types/jest": "^29.4.0",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"@vitejs/plugin-react": "^4.0.0",
"electron": "^24.1.2",
"electron-playwright-helpers": "^1.5.4",
"eslint": "^8.28.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
Expand All @@ -85,15 +86,16 @@
"eslint-plugin-testing-library": "^5.10.2",
"husky": "^8.0.0",
"jest": "^29.5.0",
"lint-staged": "^13.0.3",
"typescript": "^4.9.3",
"electron": "^24.1.2",
"electron-playwright-helpers": "^1.5.4",
"jest-environment-jsdom": "^29.4.3",
"lint-staged": "^13.0.3",
"postcss": "^8.4.32",
"postcss-preset-mantine": "^1.12.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "2.7.1",
"sass": "^1.55.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.3",
"vite": "^4.3.2",
"vite-plugin-electron-renderer": "^0.14.1"
},
Expand Down
15 changes: 15 additions & 0 deletions postcss.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
plugins: {
'postcss-nested': {},
'postcss-preset-mantine': {},
'postcss-simple-vars': {
variables: {
'mantine-breakpoint-xs': '36em',
'mantine-breakpoint-sm': '48em',
'mantine-breakpoint-md': '62em',
'mantine-breakpoint-lg': '75em',
'mantine-breakpoint-xl': '88em',
},
},
},
};
33 changes: 9 additions & 24 deletions src/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
import {
ColorScheme,
ColorSchemeProvider,
MantineProvider,
} from "@mantine/core"
import { NotificationsProvider } from "@mantine/notifications"
import { ReactElement, useState } from "react"
import { MantineProvider } from "@mantine/core"
import { Notifications } from "@mantine/notifications"
import { ReactElement } from "react"
import { theme } from "../theme"

export function ThemeProvider({ children }: { children: ReactElement }) {
const [colorScheme, setColorScheme] = useState<ColorScheme>("light")
const toggleColorScheme = (value?: ColorScheme) =>
setColorScheme(value || (colorScheme === "dark" ? "light" : "dark"))
// withGlobalStyles
// withNormalizeCSS

return (
<NotificationsProvider>
<ColorSchemeProvider
colorScheme={colorScheme}
toggleColorScheme={toggleColorScheme}
>
<MantineProvider
theme={{ ...theme, colorScheme }}
withGlobalStyles
withNormalizeCSS
>
{children}
</MantineProvider>
</ColorSchemeProvider>
</NotificationsProvider>
<MantineProvider theme={theme}>
<Notifications />
{children}
</MantineProvider>
)
}
5 changes: 5 additions & 0 deletions src/common/color-scheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { useComputedColorScheme } from "@mantine/core";

export function useColorScheme(): "light" | "dark" {
return useComputedColorScheme('light', { getInitialValueInEffect: true })
}
4 changes: 4 additions & 0 deletions src/common/query-functions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { User } from "../../types";

export const getAssignableUsersByProject = (projectIdOrKey: string): Promise<User[]> =>
window.provider.getAssignableUsersByProject(projectIdOrKey)
2 changes: 1 addition & 1 deletion src/common/status-color.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MantineColor } from "@mantine/styles";
import { MantineColor } from "@mantine/core";
import { StatusType } from "../../types/status";

export const getStatusTypeColor = (statusType: StatusType): MantineColor => {
Expand Down
41 changes: 21 additions & 20 deletions src/components/BacklogView/BacklogView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
} from "@mantine/core"
import { IconSearch } from "@tabler/icons"
import { useQueries, useQuery } from "@tanstack/react-query"
import { useEffect, useState } from "react"
import { DragDropContext } from "react-beautiful-dnd"
import { ChangeEvent, useEffect, useState } from "react"
import { DragDropContext } from "@hello-pangea/dnd"
import { useNavigate } from "react-router-dom"
import { Issue, Sprint } from "types"
import { useCanvasStore } from "../../lib/Store"
Expand All @@ -32,8 +32,10 @@ import { resizeDivider } from "./helpers/resizeDivider"
import { DraggableIssuesWrapper } from "./IssuesWrapper/DraggableIssuesWrapper"
import { SprintsPanel } from "./IssuesWrapper/SprintsPanel"
import { ReloadButton } from "./ReloadButton"
import { useColorScheme } from "../../common/color-scheme";

export function BacklogView() {
const colorScheme = useColorScheme()
const navigate = useNavigate()
const [createIssueModalOpened, setCreateIssueModalOpened] = useState(false)
const projectName = useCanvasStore((state) => state.selectedProject?.name)
Expand Down Expand Up @@ -64,7 +66,7 @@ export function BacklogView() {

const sprintsIssuesResults = useQueries({
queries:
!isErrorSprints && sprints && sprints instanceof Array
!isErrorSprints && sprints
? sprints?.map((sprint) => ({
queryKey: ["issues", "sprints", projectKey, sprints, sprint.id],
queryFn: () => getIssuesBySprint(sprint.id),
Expand Down Expand Up @@ -140,7 +142,7 @@ export function BacklogView() {
</Center>
)

const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const handleSearchChange = (event: ChangeEvent<HTMLInputElement>) => {
const currentSearch = event.currentTarget.value
setSearch(currentSearch)
searchIssuesFilter(
Expand Down Expand Up @@ -168,13 +170,13 @@ export function BacklogView() {
</Center>
)
return (
<Stack sx={{ minHeight: "100%" }}>
<Stack align="left" spacing={0}>
<Stack style={{ minHeight: "100%" }}>
<Stack align="left" gap={0}>
<Group>
<Group spacing="xs" c="dimmed">
<Group gap="xs" c="dimmed">
<Text
onClick={() => navigate("/projectsview")}
sx={{
style={{
":hover": {
textDecoration: "underline",
cursor: "pointer",
Expand All @@ -191,13 +193,13 @@ export function BacklogView() {
<Title mb="sm">Backlog</Title>
<TextInput
placeholder="Search by issue summary, key, epic, labels, creator or assignee.."
icon={<IconSearch size={14} stroke={1.5} />}
leftSection={<IconSearch size={14} stroke={1.5} />}
value={search}
onChange={handleSearchChange}
/>
</Stack>

<Flex sx={{ flexGrow: 1 }}>
<Flex style={{ flexGrow: 1 }}>
<DragDropContext
onDragEnd={(dropResult) =>
onDragEnd({
Expand All @@ -209,10 +211,10 @@ export function BacklogView() {
>
<ScrollArea.Autosize
className="left-panel"
maxHeight="calc(100vh - 230px)"
w="50%"
p="sm"
sx={{
style={{
maxHeight: "calc(100vh - 230px)",
minWidth: "260px",
}}
>
Expand All @@ -234,13 +236,10 @@ export function BacklogView() {
display="flex"
fullWidth
onClick={() => setCreateIssueModalOpened(true)}
sx={(theme) => ({
style={(theme) => ({
justifyContent: "left",
":hover": {
background:
theme.colorScheme === "dark"
? theme.colors.dark[4]
: theme.colors.gray[4],
background: colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[4],
},
})}
>
Expand All @@ -257,16 +256,18 @@ export function BacklogView() {
size="xl"
className="resize-handle"
orientation="vertical"
sx={{
style={{
cursor: "col-resize",
}}
/>
<ScrollArea.Autosize
className="right-panel"
maxHeight="calc(100vh - 230px)"
w="50%"
p="xs"
sx={{ minWidth: "260px" }}
style={{
maxHeight: "calc(100vh - 230px)",
minWidth: "260px"
}}
>
<SprintsPanel
sprintsWithIssues={
Expand Down
12 changes: 5 additions & 7 deletions src/components/BacklogView/CreateSprint/CreateSprint.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Box, Button, Group, Loader, TextInput } from "@mantine/core"
import { Box, Button } from "@mantine/core"
import { useState } from "react"
import { CreateSprintModal } from "./CreateSprintModal"
import { useColorScheme } from "../../../common/color-scheme";

export function CreateSprint() {
const colorScheme = useColorScheme()
const [createSprintModalOpened, setCreateSprintModalOpened] = useState(false)

return (
Expand All @@ -17,13 +18,10 @@ export function CreateSprint() {
display="flex"
fullWidth
onClick={() => setCreateSprintModalOpened(true)}
sx={(theme) => ({
style={(theme) => ({
justifyContent: "left",
":hover": {
background:
theme.colorScheme === "dark"
? theme.colors.dark[4]
: theme.colors.gray[4],
background: colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[4],
},
})}
>
Expand Down
Loading