Skip to content

Commit

Permalink
fix: remove react import and prettier runs
Browse files Browse the repository at this point in the history
  • Loading branch information
SilveerDusk committed May 28, 2024
1 parent 5f59944 commit c726c2a
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 27 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/remove-old-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: Remove old artifacts
on:
schedule:
# Every day at 1am
- cron: '0 1 * * *'
- cron: "0 1 * * *"

jobs:
remove-old-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Remove old artifacts
uses: c-hive/[email protected]
with:
age: '5 days' # '<number> <unit>', e.g. 5 days, 2 years, 90 seconds, parsed by Moment.js
# Optional inputs
# skip-tags: true
# skip-recent: 5
- name: Remove old artifacts
uses: c-hive/[email protected]
with:
age: "5 days" # '<number> <unit>', e.g. 5 days, 2 years, 90 seconds, parsed by Moment.js
# Optional inputs
# skip-tags: true
# skip-recent: 5
2 changes: 1 addition & 1 deletion frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
// }
10 changes: 5 additions & 5 deletions frontend/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions frontend/cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/react18'
import { mount } from "cypress/react18";

// Augment the Cypress namespace to include type definitions for
// your custom command.
Expand All @@ -28,12 +28,12 @@ import { mount } from 'cypress/react18'
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
mount: typeof mount;
}
}
}

Cypress.Commands.add('mount', mount)
Cypress.Commands.add("mount", mount);

// Example use:
// cy.mount(<MyComponent />)
// cy.mount(<MyComponent />)
4 changes: 2 additions & 2 deletions frontend/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
// require('./commands')
27 changes: 27 additions & 0 deletions frontend/lib/deletes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const handleDeleteGroup = async (groupId: string) => {
try {
const response = await fetch(`http://localhost:3001/groups/${groupId}`, {
method: "DELETE",
});
if (!response.ok) {
throw new Error(`Error: ${response.statusText}`);
}
console.log("group deleted successfully");
} catch (error) {
console.error("There was an error deleting the group", error);
}
};

export const handleDeleteBasket = async (basketId: string) => {
try {
const response = await fetch(`http://localhost:3001/baskets/${basketId}`, {
method: "DELETE",
});
if (!response.ok) {
throw new Error(`Error: ${response.statusText}`);
}
console.log("Basket deleted successfully");
} catch (error) {
console.error("There was an error deleting the basket", error);
}
};
15 changes: 15 additions & 0 deletions frontend/lib/edits.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type updatedGroup = {
groupName: string;
description: string;
privateGroup: string;
};

export const editGroup = async (groupId: string, groupData: updatedGroup) => {
return fetch(`http://localhost:3001/groups/${groupId}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(groupData),
});
};
4 changes: 2 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import { Box, ChakraProvider } from "@chakra-ui/react";
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import LoginPage from "./pages/LoginPage";
import HomePage from "./pages/HomePage";
import SignupPage from "./pages/SignupPage";
Expand Down Expand Up @@ -52,7 +52,7 @@ function App() {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
}
},
);
if (userres.status === 200) {
const user = await userres.json();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const UserProfile: React.FC<UserProfileProps> = ({ userId, avatarColor }) => {
// `${profileData.firstName[0]}${profileData.lastName[0]}`.toUpperCase();

return (
<Box bg="white" borderRadius="md" boxShadow="md" p={6} mb={4} >
<Box bg="white" borderRadius="md" boxShadow="md" p={6} mb={4}>
<Flex justifyContent="center" mb={4}>
<Avatar size={{ base: "xl", md: "2xl" }} bg={avatarColor} color="white">
{/* {initials} */} {/* it looked weird w initials in the avatar */}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/tests/ConstrainedText.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ConstrainedText from "../ConstrainedText";
describe("<ConstrainedText />", () => {
it("renders", () => {
cy.mount(
<ConstrainedText text="This is the constrained text." charLimit={10} />
<ConstrainedText text="This is the constrained text." charLimit={10} />,
);
});
});
2 changes: 1 addition & 1 deletion frontend/src/components/tests/PageSelector.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("<PageSelector/>", () => {
onSelect={() => {
console.log("Printin");
}}
/>
/>,
);
});
});
2 changes: 1 addition & 1 deletion frontend/src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ProfilePage: React.FC<ProfilePageProps> = ({
avatarColor,
}) => {
return (
<Box bg="gray.100" color="gray.800" minH="93vh" p={4} overflowY={"auto"} >
<Box bg="gray.100" color="gray.800" minH="93vh" p={4} overflowY={"auto"}>
<Grid
templateColumns={{ base: "1fr", md: "2fr 3fr" }}
height="100%"
Expand Down

0 comments on commit c726c2a

Please sign in to comment.