-
Notifications
You must be signed in to change notification settings - Fork 63
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
new front end changes for the download api #406
Conversation
@derneuere new pr for the download api as i was not able to find how to remove the package.json file from pr also |
@AnkurPrabhu make sure that all PR checks are passing. Also enable pre-commit checks if you haven't done so yet. You can do that by running |
src/App.tsx
Outdated
@@ -1,6 +1,6 @@ | |||
import type { ColorScheme } from "@mantine/core"; | |||
import { AppShell, ColorSchemeProvider, MantineProvider } from "@mantine/core"; | |||
import { Notifications } from "@mantine/notifications"; | |||
import { NotificationsProvider } from "@mantine/notifications"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make the build to fail. Mantine v6 does not have NotificationsProvider
anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it will make a new image and then push my pr will fix my issues ig
src/actions/photosActions.ts
Outdated
shared: val_shared, | ||
target_user_id: target_user.id, | ||
}) | ||
.then(() => { | ||
let notificationMessage = i18n.t("toasts.unsharephoto", { | ||
let notificationMessage = i18n.t<string>("toasts.unsharephoto", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you must to specify the type, it should be i18n.t<string|TemplateStringsArray, TOptions, string>("...")
.
As it looks too verbose and does not provide any value I suggest to remove type from translation function completely (as it was before) and let the type be inferred.
@sickelap thing is my pr only had 2 issues which were of a variable being used in function call when i rebased it ,it showed me 37 errors which were not on even related to my code so i pushed them |
could it be that you rebased of the wrong commit? |
I had the latest dev branch- |
these are the errors i am getting not related to my code also we should implement the commit hooks like: - @sickelap any other code changes ? or thats it ? |
make sure PR checks are passing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the suggestions for most if not all lint check errors
src/actions/photosActions.ts
Outdated
}); | ||
return Server.post("photos/download", { | ||
image_hashes: image_hashes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_hashes: image_hashes, | |
image_hashes, |
src/actions/photosActions.ts
Outdated
const startDownloadProcess = () => { | ||
showNotification({ | ||
message: "Download Starting ...", | ||
title: i18n.t<string>("toasts.downloadstart"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: i18n.t<string>("toasts.downloadstart"), | |
title: i18n.t("toasts.downloadstart"), |
src/actions/photosActions.ts
Outdated
// eslint-disable-next-line import/no-cycle | ||
import { Server } from "../api_client/apiClient"; | ||
import { Server,serverAddress } from "../api_client/apiClient"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Server,serverAddress } from "../api_client/apiClient"; | |
import { Server, serverAddress } from "../api_client/apiClient"; |
src/actions/photosActions.ts
Outdated
else if (status === "FAILURE") { | ||
showNotification({ | ||
message: "Download failed", | ||
title: i18n.t<string>("toasts.downloaderror"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: i18n.t<string>("toasts.downloaderror"), | |
title: i18n.t("toasts.downloaderror"), |
src/actions/photosActions.ts
Outdated
dispatch({ type: "SET_PHOTOS_SHARED" }); | ||
Server.post(`photosedit/share/`, { | ||
image_hashes, | ||
image_hashes: image_hashes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_hashes: image_hashes, | |
image_hashes, |
src/actions/photosActions.ts
Outdated
}); | ||
}; | ||
} | ||
|
||
export function editPhoto(image_hash: string, photo_details: any) { | ||
return function cb(dispatch: Dispatch<any>) { | ||
return function (dispatch: Dispatch<any>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return function (dispatch: Dispatch<any>) { | |
return function cb(dispatch: Dispatch<any>) { |
src/actions/photosActions.ts
Outdated
message: i18n.t<string>("toasts.editphoto"), | ||
title: i18n.t<string>("toasts.editphototitle"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message: i18n.t<string>("toasts.editphoto"), | |
title: i18n.t<string>("toasts.editphototitle"), | |
message: i18n.t("toasts.editphoto"), | |
title: i18n.t("toasts.editphototitle"), |
src/actions/photosActions.ts
Outdated
dispatch({ type: "EDIT_PHOTO_REJECTED" }); | ||
console.error(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispatch({ type: "EDIT_PHOTO_REJECTED" }); | |
console.error(error); | |
dispatch({ type: "EDIT_PHOTO_REJECTED", payload: error }); |
src/locales/en/translation.json
Outdated
@@ -253,7 +253,7 @@ | |||
"favorites": "Favorites", | |||
"mypublicphotos": "My Public Photos", | |||
"photos": "Photos", | |||
"videos": "Videos", | |||
"videos":"Videos", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"videos":"Videos", | |
"videos": "Videos", |
src/locales/en/translation.json
Outdated
@@ -351,7 +351,7 @@ | |||
"notimestamp": "Photos without Timestamps", | |||
"hidden": "Hidden Photos", | |||
"favorite": "Favorite Photos", | |||
"videos": "Videos", | |||
"videos" :"Videos", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"videos" :"Videos", | |
"videos": "Videos", |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
all the eslint issues are solved and i currently see 0 errors so should be good to go learned a lot of new things while solving these errors, @sickelap sorry to bother you but your suggestions did help a lot thank-you also did u manually point all of these issues or used some extension to do it ? (more than 56 suggestions i think) sorry for the trouble |
@derneuere @sickelap pls let me know if there are any changes needed lets merge this asap I want to see this change live Im really excited for this one 🥂 |
Not a problem. Suggestions is a feature of GitHub PR review. |
Please update LibrePhotos/librephotos#1057 so all checks are green. After that's done I will verify the feature and both PRs can merged |
@derneuere @sickelap
related backend pr: LibrePhotos/librephotos#1057
related issue : LibrePhotos/librephotos#375