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

chore: Upgraded dependencies and solved connected errors #523

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion components/modals/CocktailRatingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function CocktailRatingsModal(props: CocktailRatingModalProps) {

const { workspaceId } = router.query;

const avgRating = (cocktailRatings ?? []).reduce((acc, rating) => acc + rating.rating ?? 0, 0) / (cocktailRatings ?? []).length;
const avgRating = (cocktailRatings ?? []).reduce((acc, rating) => acc + (rating.rating ?? 0), 0) / (cocktailRatings ?? []).length;

const [search, setSearch] = React.useState<string>('');

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,54 +24,54 @@
"deep-diff": "1.0.2",
"express-validator": "7.2.0",
"formik": "2.4.6",
"graph-data-structure": "3.5.0",
"graph-data-structure": "4.3.0",
"http-method-enum": "1.0.0",
"js-levenshtein": "^1.1.6",
"js-levenshtein": "1.1.6",
"jssoup": "0.0.15",
"lodash": "4.17.21",
"marked": "15.0.5",
"next": "15.1.5",
"next-auth": "4.24.10",
"next-pwa": "^5.6.0",
"next-pwa": "5.6.0",
"node-html-parser": "6.1.13",
"playwright": "1.49.1",
"prop-types": "^15.8.1",
"prop-types": "15.8.1",
"react": "18.3.1",
"react-chartjs-2": "^5.2.0",
"react-device-detect": "^2.2.3",
"react-chartjs-2": "5.3.0",
"react-device-detect": "2.2.3",
"react-dom": "18.3.1",
"react-icons": "5.4.0",
"react-image-crop": "11.0.7",
"react-markdown": "9.0.3",
"react-select": "^5.8.3",
"react-select": "5.9.0",
"react-three-state-checkbox": "3.0.0",
"rxjs": "7.8.1",
"sharp": "^0.33.5"
"sharp": "0.33.5"
},
"devDependencies": {
"@codedependant/semantic-release-docker": "5.0.3",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@types/deep-diff": "1.0.5",
"@types/js-levenshtein": "^1.1.3",
"@types/js-levenshtein": "1.1.3",
"@types/lodash": "4.17.14",
"@types/node": "22.10.5",
"@types/prop-types": "15.7.13",
"@types/react": "18.3.12",
"@types/react-is": "19.0.0",
"autoprefixer": "10.4.20",
"daisyui": "4.12.23",
"eslint": "8.57.0",
"eslint": "9.18.0",
"eslint-config-next": "15.1.3",
"eslint-config-prettier": "9.1.0",
"postcss": "8.4.49",
"prettier": "3.3.3",
"prettier-plugin-prisma": "^5.0.0",
"prettier-plugin-prisma": "5.0.0",
"prettier-plugin-tailwindcss": "0.6.10",
"prisma": "6.2.1",
"semantic-release": "24.2.0",
"tailwindcss": "3.4.17",
"typescript": "5.5.4"
"typescript": "5.7.3"
},
"packageManager": "pnpm@9.14.4"
"packageManager": "pnpm@10.0.0"
}
9 changes: 5 additions & 4 deletions pages/api/workspaces/[workspaceId]/units/conversions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import HTTPMethod from 'http-method-enum';
import { withWorkspacePermission } from '../../../../../../middleware/api/authenticationMiddleware';
import { Prisma, Role, Unit, UnitConversion } from '@prisma/client';
import prisma from '../../../../../../prisma/prisma';
import Graph from 'graph-data-structure';
import { Graph, shortestPath } from 'graph-data-structure';
import UnitConversionCreateInput = Prisma.UnitConversionCreateInput;

export default withHttpMethods({
Expand Down Expand Up @@ -53,7 +53,7 @@ export async function regenerateUnitConversions(workspaceId: string): Promise<Un
const nodes: Unit[] = await prisma.unit.findMany({ where: { workspaceId: workspaceId } });
const paths: UnitConversion[] = await prisma.unitConversion.findMany({ where: { workspaceId: workspaceId } });

const graph = Graph();
const graph = new Graph<string>();
nodes.forEach((node) => graph.addNode(node.id));
paths.forEach((path) => {
graph.addEdge(path.fromUnitId, path.toUnitId);
Expand All @@ -79,8 +79,9 @@ export async function regenerateUnitConversions(workspaceId: string): Promise<Un

combinations.forEach((combination) => {
try {
const path = graph.shortestPath(combination[0], combination[1]);
allConnections.push(path);
const path = shortestPath(graph, combination[0], combination[1]);
// const path = graph.shortestPath(combination[0], combination[1]);
allConnections.push(path.nodes);
} catch (e) {}
});

Expand Down
20 changes: 10 additions & 10 deletions pages/workspaces/[workspaceId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ export default function OverviewPage() {
}, [cocktailCards, router, selectedCardId, sortCards, workspaceId]);

useEffect(() => {
setShowImage(userContext.user?.settings?.find((s) => s.setting == Setting.showImage)?.value == 'true' ?? false);
setShowTags(userContext.user?.settings?.find((s) => s.setting == Setting.showTags)?.value == 'true' ?? false);
setLessItems(userContext.user?.settings?.find((s) => s.setting == Setting.lessItems)?.value == 'true' ?? false);
setShowStatisticActions(userContext.user?.settings?.find((s) => s.setting == Setting.showStatisticActions)?.value == 'true' ?? false);
setShowQueueAsOverlay(userContext.user?.settings?.find((s) => s.setting == Setting.showQueueAsOverlay)?.value == 'true' ?? false);
setShowDescription(userContext.user?.settings?.find((s) => s.setting == Setting.showDescription)?.value == 'true' ?? false);
setShowNotes(userContext.user?.settings?.find((s) => s.setting == Setting.showNotes)?.value == 'true' ?? false);
setShowHistory(userContext.user?.settings?.find((s) => s.setting == Setting.showHistory)?.value == 'true' ?? false);
setShowTime(userContext.user?.settings?.find((s) => s.setting == Setting.showTime)?.value == 'true' ?? false);
setShowRating(userContext.user?.settings?.find((s) => s.setting == Setting.showRating)?.value == 'true' ?? false);
setShowImage(userContext.user?.settings?.find((s) => s.setting == Setting.showImage)?.value == 'true');
setShowTags(userContext.user?.settings?.find((s) => s.setting == Setting.showTags)?.value == 'true');
setLessItems(userContext.user?.settings?.find((s) => s.setting == Setting.lessItems)?.value == 'true');
setShowStatisticActions(userContext.user?.settings?.find((s) => s.setting == Setting.showStatisticActions)?.value == 'true');
setShowQueueAsOverlay(userContext.user?.settings?.find((s) => s.setting == Setting.showQueueAsOverlay)?.value == 'true');
setShowDescription(userContext.user?.settings?.find((s) => s.setting == Setting.showDescription)?.value == 'true');
setShowNotes(userContext.user?.settings?.find((s) => s.setting == Setting.showNotes)?.value == 'true');
setShowHistory(userContext.user?.settings?.find((s) => s.setting == Setting.showHistory)?.value == 'true');
setShowTime(userContext.user?.settings?.find((s) => s.setting == Setting.showTime)?.value == 'true');
setShowRating(userContext.user?.settings?.find((s) => s.setting == Setting.showRating)?.value == 'true');
}, [userContext.user?.settings]);

const [currentTime, setCurrentTime] = useState(new Date());
Expand Down
Loading