Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Prep for main merge

Manav Rathi1c3f560cb005
diff --git a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
index eefbfd572c..f384c7a70d 100644
--- a/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
+++ b/web/apps/photos/src/components/Collections/GalleryBarAndListHeader.tsx
@@ -189,7 +189,9 @@ export const GalleryBarAndListHeader: React.FC<CollectionsProps> = ({
activeCollectionID,
isActiveCollectionDownloadInProgress,
activePerson,
- people,
+ // TODO-Cluster
+ // This causes a loop since it is an array dep
+ // people,
]);
// TODO-Cluster
diff --git a/web/packages/new/photos/components/Gallery/PeopleHeader.tsx b/web/packages/new/photos/components/Gallery/PeopleHeader.tsx
index 472e205b3b..1e02c8e65b 100644
--- a/web/packages/new/photos/components/Gallery/PeopleHeader.tsx
+++ b/web/packages/new/photos/components/Gallery/PeopleHeader.tsx
@@ -201,9 +201,19 @@ const ClusterPersonOptions: React.FC<ClusterPersonOptionsProps> = ({
}) => {
const { startLoading, finishLoading } = appContext;
+ const [openNameInput, setOpenNameInput] = useState(false);
const [openAddPersonDialog, setOpenAddPersonDialog] = useState(false);
- const handleAddPerson = () => setOpenAddPersonDialog(true);
+ const handleAddPerson = () => {
+ // TODO-Cluster
+ if (process.env.NEXT_PUBLIC_ENTE_WIP_CL) {
+ // WIP path
+ setOpenAddPersonDialog(true);
+ } else {
+ // Existing path
+ setOpenNameInput(true);
+ }
+ };
// TODO-Cluster
const addPersonWithName = async (name: string) => {
@@ -215,8 +225,6 @@ const ClusterPersonOptions: React.FC<ClusterPersonOptionsProps> = ({
}
};
- if (process.env.NEXT_PUBLIC_ENTE_WIP_CL) console.log(addPersonWithName);
-
return (
<>
<Stack direction="row" sx={{ alignItems: "center", gap: 2 }}>
@@ -240,6 +248,16 @@ const ClusterPersonOptions: React.FC<ClusterPersonOptionsProps> = ({
</OverflowMenu>
</Stack>
+ <NameInputDialog
+ open={openNameInput}
+ onClose={() => setOpenNameInput(false)}
+ title={pt("Add person") /* TODO-Cluster */}
+ placeholder={t("enter_name")}
+ initialValue={""}
+ submitButtonTitle={t("add")}
+ onSubmit={addPersonWithName}
+ />
+
<AddPersonDialog
open={openAddPersonDialog}
onClose={() => setOpenAddPersonDialog(false)}
diff --git a/web/packages/new/photos/components/SingleInputFormV2.tsx b/web/packages/new/photos/components/SingleInputFormV2.tsx
index 6972074d31..cdc56ea7cf 100644
--- a/web/packages/new/photos/components/SingleInputFormV2.tsx
+++ b/web/packages/new/photos/components/SingleInputFormV2.tsx
@@ -69,7 +69,7 @@ export const SingleInputFormV2: React.FC<SingleInputFormProps> = ({
onSubmit: async (values, { setFieldError }) => {
const value = values.value;
if (!value) {
- setFieldError("value", t("required"));
+ setFieldError("value", t("REQUIRED"));
return;
}
try {