Skip to content

Commit

Permalink
Update package-lock.json and fix two dev env issues
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Dec 12, 2023
1 parent acecfd3 commit ba0e035
Show file tree
Hide file tree
Showing 14 changed files with 8,912 additions and 11,622 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ module.exports = {
},
parserOptions: {
project: "./tsconfig.eslint.json",
tsconfigRootDir: __dirname,
},
};
20,436 changes: 8,858 additions & 11,578 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/api_client/albums/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export const peopleAlbumsApi = api
}),
transformResponse(response, meta, query) {
showNotification({
message: i18n.t<string>("toasts.renameperson", query),
title: i18n.t<string>("toasts.renamepersontitle"),
message: i18n.t("toasts.renameperson", query),
title: i18n.t("toasts.renamepersontitle"),
color: "teal",
});
},
Expand All @@ -82,8 +82,8 @@ export const peopleAlbumsApi = api
}),
transformResponse() {
showNotification({
message: i18n.t<string>("toasts.deleteperson"),
title: i18n.t<string>("toasts.deletepersontitle"),
message: i18n.t("toasts.deleteperson"),
title: i18n.t("toasts.deletepersontitle"),
color: "teal",
});
},
Expand Down
1 change: 1 addition & 0 deletions src/api_client/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const searchApi = api
};
} catch (e) {
return {
// @ts-ignore
photosFlat: response.results,
photosGroupedByDate: [],
};
Expand Down
1 change: 1 addition & 0 deletions src/components/AlbumLocationMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function AlbumLocationMap({ photos }: Readonly<Props>) {
const { avgLat, avgLon } = getAveragedCoordinates(photosWithGPS);

const markers = photosWithGPS.map(photo => (
// @ts-ignore
<Marker key={`marker-${photo.id}`} position={[photo.exif_gps_lat, photo.exif_gps_lon]} />
));
if (photosWithGPS.length > 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/facedashboard/ButtonHeaderGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export function ButtonHeaderGroup({
onClick={() => {
dispatch(api.endpoints.trainFaces.initiate());
showNotification({
message: i18n.t<string>("toasts.trainingstarted"),
title: i18n.t<string>("toasts.trainingstartedtitle"),
message: i18n.t("toasts.trainingstarted"),
title: i18n.t("toasts.trainingstartedtitle"),
color: "teal",
});
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/facedashboard/FaceTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function FaceTooltip({ tooltipOpened, cell, children }: Props) {

const confidencePercentageLabel =
activeTab === "inferred"
? t<string>("settings.confidencepercentage", { percentage: (cell.person_label_probability * 100).toFixed(1) })
? t("settings.confidencepercentage", { percentage: (cell.person_label_probability * 100).toFixed(1) })
: null;

const dateTimeLabel = DateTime.fromISO(cell.timestamp).isValid
Expand Down
1 change: 0 additions & 1 deletion src/components/job/JobList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export function JobList() {
</Table>
<Flex justify="center" mt={20}>
<Pagination
page={activePage}
total={Math.ceil(+jobCount.toFixed(1) / pageSize)}
onChange={newPage => setActivePage(newPage)}
withEdges
Expand Down
7 changes: 6 additions & 1 deletion src/components/lightbox/TimestampItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ export function TimestampItem({ photoDetail }: Props) {
</Group>
<Stack>
<DatePicker locale={lang} value={timestamp} onChange={onChangeDate} />
<TimeInput withSeconds value={timestamp} onChange={onChangeTime} />

<TimeInput
withSeconds
value={timestamp?.toString()}
onChange={event => onChangeTime(new Date(event.target.value))}
/>
<Group position="center">
<Tooltip label={t("lightbox.sidebar.cancel")}>
<ActionIcon variant="light" onClick={onCancelDateTime} color="red">
Expand Down
18 changes: 12 additions & 6 deletions src/components/modals/ModalPersonEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { fuzzyMatch } from "../../util/util";
type Props = {
isOpen: boolean;
onRequestClose: () => void;
resetGroups: () => void;
resetGroups?: () => void;
selectedFaces: any[];
};

Expand Down Expand Up @@ -100,14 +100,16 @@ export function ModalPersonEdit(props: Props) {
api.endpoints.setFacesPersonLabel.initiate({ faceIds: selectedFaceIDs, personName: newPersonName })
);
showNotification({
message: i18n.t<string>("toasts.addfacestoperson", {
message: i18n.t("toasts.addfacestoperson", {
numberOfFaces: selectedFaceIDs.length,
personName: newPersonName,
}),
title: i18n.t<string>("toasts.addfacestopersontitle"),
title: i18n.t("toasts.addfacestopersontitle"),
color: "teal",
});
resetGroups();
if (resetGroups) {
resetGroups();
}
onRequestClose();
setNewPersonName("");
}}
Expand Down Expand Up @@ -144,11 +146,11 @@ export function ModalPersonEdit(props: Props) {
})
);
showNotification({
message: i18n.t<string>("toasts.addfacestoperson", {
message: i18n.t("toasts.addfacestoperson", {
numberOfFaces: selectedFaceIDs.length,
personName: item.text,
}),
title: i18n.t<string>("toasts.addfacestopersontitle"),
title: i18n.t("toasts.addfacestopersontitle"),
color: "teal",
});
onRequestClose();
Expand Down Expand Up @@ -177,3 +179,7 @@ export function ModalPersonEdit(props: Props) {
</Modal>
);
}

ModalPersonEdit.defaultProps = {
resetGroups: () => {},
};
1 change: 0 additions & 1 deletion src/components/modals/ModalUserDelete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function ModalUserDelete(props: Props) {
<Modal
opened={isOpen}
centered
overflow="outside"
size="md"
onClose={() => {
clearStateAndClose();
Expand Down
48 changes: 23 additions & 25 deletions src/components/photolist/PhotoListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,31 +293,29 @@ function PhotoListViewComponent(props: Props) {
updateSelectionState={updateSelectionState}
/>
<Group position="right">
{
// @ts-ignore
!route.location.pathname.startsWith("/deleted") && (
<SelectionActions
selectedItems={selectionState.selectedItems}
albumID={params ? params.albumID : undefined}
title={title}
setAlbumCover={actionType => {
if (actionType === "person") {
dispatch(setAlbumCoverForPerson(params.albumID, selectionState.selectedItems[0].id));
}
if (actionType === "useralbum") {
setUserAlbumCover({
id: `${params.albumID}`,
photo: selectionState.selectedItems[0].id,
});
}
}}
onSharePhotos={() => setModalSharePhotosOpen(true)}
onShareAlbum={() => setModalAlbumShareOpen(true)}
onAddToAlbum={() => setModalAddToAlbumOpen(true)}
updateSelectionState={updateSelectionState}
/>
)
}
{!route.location.pathname.startsWith("/deleted") && (
<SelectionActions
selectedItems={selectionState.selectedItems}
// @ts-ignore
albumID={params ? params.albumID : undefined}
title={title}
setAlbumCover={actionType => {
if (actionType === "person") {
dispatch(setAlbumCoverForPerson(params.albumID, selectionState.selectedItems[0].id));
}
if (actionType === "useralbum") {
setUserAlbumCover({
id: `${params.albumID}`,
photo: selectionState.selectedItems[0].id,
});
}
}}
onSharePhotos={() => setModalSharePhotosOpen(true)}
onShareAlbum={() => setModalAlbumShareOpen(true)}
onAddToAlbum={() => setModalAddToAlbumOpen(true)}
updateSelectionState={updateSelectionState}
/>
)}
<TrashcanActions
selectedItems={selectionState.selectedItems}
updateSelectionState={updateSelectionState}
Expand Down
2 changes: 1 addition & 1 deletion src/components/photolist/SelectionActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export function SelectionActions(props: Readonly<Props>) {
disabled={!route.location.pathname.startsWith("/useralbum/") || selectedItems.length === 0}
onClick={() => {
removePhotosFromAlbum({
id: albumID,
id: albumID.toString(),
title,
photos: selectedItems.map(i => i.id),
});
Expand Down
4 changes: 2 additions & 2 deletions src/store/faces/faceSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ const faceSlice = createSlice({
personListToChange[indexToReplace] = personToChange;
}
})
// @ts-ignore
.addMatcher(api.endpoints.clusterFaces.matchFulfilled, (state, { payload }) => ({
...state,
// @ts-ignore
facesVis: payload,
clustered: true,
}))
// @ts-ignore
.addMatcher(api.endpoints.trainFaces.matchFulfilled, (state, { payload }) => ({
...state,
training: false,
trained: true,
// @ts-ignore
facesVis: payload,
}))
.addMatcher(api.endpoints.deleteFaces.matchFulfilled, (state, { payload }) => {
Expand Down

0 comments on commit ba0e035

Please sign in to comment.