Skip to content

Commit

Permalink
Merge pull request #447 from world-wide-weights/formatfrontend
Browse files Browse the repository at this point in the history
Add format
  • Loading branch information
LarsFlieger authored Feb 20, 2023
2 parents 8fed5cb + 219f60b commit 8d9cbe7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 24 deletions.
3 changes: 1 addition & 2 deletions frontend/cypress/e2e/account/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ describe("Login Page", () => {
})
})

export { }

export {}
3 changes: 1 addition & 2 deletions frontend/cypress/e2e/account/register.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,4 @@ describe("Register", () => {
})
})

export { }

export {}
3 changes: 1 addition & 2 deletions frontend/cypress/e2e/profile/error.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ describe("Error Profile", () => {
})
})

export { }

export {}
21 changes: 10 additions & 11 deletions frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ Cypress.Commands.add("mockProfilePage", (options) => {
const body =
options?.contribtionsCount || options?.contribtionsCount === 0
? {
...paginatedContributions,
data: paginatedContributions.data.slice(0, options?.contribtionsCount),
}
...paginatedContributions,
data: paginatedContributions.data.slice(0, options?.contribtionsCount),
}
: paginatedContributions

cy.mockImageServe()
Expand Down Expand Up @@ -158,9 +158,9 @@ Cypress.Commands.add("mockTagsList", (options) => {
const body =
options?.itemCount || options?.itemCount === 0
? {
...paginatedTagsList,
data: paginatedTagsList.data.slice(0, options.itemCount),
}
...paginatedTagsList,
data: paginatedTagsList.data.slice(0, options.itemCount),
}
: paginatedTagsList

cy.task("nock", {
Expand All @@ -178,9 +178,9 @@ Cypress.Commands.add("mockItemsList", (options) => {
const body =
options?.itemCount || options?.itemCount === 0
? {
...paginatedItems,
data: paginatedItems.data.slice(0, options.itemCount),
}
...paginatedItems,
data: paginatedItems.data.slice(0, options.itemCount),
}
: paginatedItems

cy.task("nock", {
Expand Down Expand Up @@ -286,5 +286,4 @@ Cypress.Commands.add("mockDeleteItem", () => {
}).as("mockDeleteItem")
})

export { }

export {}
5 changes: 3 additions & 2 deletions frontend/src/components/Form/ImageUpload/ImageUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ export const ImageUpload: React.FC<ImageUploadProps> = ({ name, filePath }) => {
{(props: FieldProps<any>) => (
<>
<div
className={`mb-2 md:mb-4 relative transition duration-200 w-full h-56 border-2 border-dashed ${dragActive ? "border-blue-500" : `${image ? "" : props.meta.error && props.meta.touched ? "border-red-500" : "border-gray-300"}`
}`}
className={`mb-2 md:mb-4 relative transition duration-200 w-full h-56 border-2 border-dashed ${
dragActive ? "border-blue-500" : `${image ? "" : props.meta.error && props.meta.touched ? "border-red-500" : "border-gray-300"}`
}`}
onDragEnter={handleDrag}
>
{/* Upload Drag and Dropbox */}
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/Item/ItemPreviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ export const ItemPreviewList: React.FC<ItemPreviewListProps> = ({
{hasDifference && (
<div
datacy="itempreviewlist-difference"
className={`flex items-center justify-center ${!selectedItem ? "" : "opacity-0"} ${difference === 0 ? "text-gray-500" : difference > 0 ? "text-green-500" : "text-red-500"
} md:px-3 lg:px-0 w-2/6 md:w-1/4`}
className={`flex items-center justify-center ${!selectedItem ? "" : "opacity-0"} ${
difference === 0 ? "text-gray-500" : difference > 0 ? "text-green-500" : "text-red-500"
} md:px-3 lg:px-0 w-2/6 md:w-1/4`}
>
<span className="font-medium mr-1">{renderWeightAsNumberIntoString(Math.abs(difference))}</span>
<Icon datacy="arrow-icon" className="text-xl">
Expand All @@ -97,8 +98,9 @@ export const ItemPreviewList: React.FC<ItemPreviewListProps> = ({
<h5
datacy="itempreviewlist-weight"
title={`${name} has a weight of ${weightString}`}
className={`${selectedItem ? "text-blue-500" : "text-gray-800"} text-right font-bold w-52 lg:w-48 pl-5 truncate ${hasDifference ? (selectedItem ? "w-2/3 md:w-1/4" : "w-3/6 md:w-1/4") : "w-1/3"
} mr-4`}
className={`${selectedItem ? "text-blue-500" : "text-gray-800"} text-right font-bold w-52 lg:w-48 pl-5 truncate ${
hasDifference ? (selectedItem ? "w-2/3 md:w-1/4" : "w-3/6 md:w-1/4") : "w-1/3"
} mr-4`}
>
{weightString}
</h5>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/services/axios/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export const imageServerRequest = axios.create({

export const imageClientRequest = axios.create({
baseURL: process.env.NEXT_PUBLIC_API_BASE_URL_IMAGE_CLIENT,
})
})

0 comments on commit 8d9cbe7

Please sign in to comment.