From 7326ee8ec0db6f1040c5f21477bcf408da8aedf7 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 24 Mar 2023 12:30:08 -0700 Subject: [PATCH] refactor: tag frame to cluster Signed-off-by: Varun Patil --- src/components/ClusterView.vue | 137 ++++++++++++++++++ src/components/SelectionManager.vue | 3 +- src/components/Timeline.vue | 107 ++------------ src/components/frame/{Tag.vue => Cluster.vue} | 82 ++++------- src/components/modal/FaceList.vue | 64 +++----- src/components/modal/FaceMergeModal.vue | 10 +- src/components/modal/FaceMoveModal.vue | 10 +- src/components/top-matter/AlbumTopMatter.vue | 23 --- ...{TagTopMatter.vue => ClusterTopMatter.vue} | 54 +++---- src/components/top-matter/EmptyContent.vue | 53 +++++++ src/components/top-matter/FaceTopMatter.vue | 23 --- src/components/top-matter/FolderTopMatter.vue | 15 -- src/components/top-matter/TopMatter.vue | 66 +++++++-- src/global.scss | 18 ++- src/router.ts | 11 +- src/services/API.ts | 23 +-- src/services/Utils.ts | 30 +--- src/services/dav/albums.ts | 38 +---- src/services/dav/face.ts | 40 +---- src/services/dav/places.ts | 40 +---- src/services/dav/tags.ts | 37 +---- src/services/strings.ts | 70 +++++++++ src/types.ts | 35 +++-- 23 files changed, 480 insertions(+), 509 deletions(-) create mode 100644 src/components/ClusterView.vue rename src/components/frame/{Tag.vue => Cluster.vue} (69%) rename src/components/top-matter/{TagTopMatter.vue => ClusterTopMatter.vue} (53%) create mode 100644 src/components/top-matter/EmptyContent.vue create mode 100644 src/services/strings.ts diff --git a/src/components/ClusterView.vue b/src/components/ClusterView.vue new file mode 100644 index 00000000..40c1750f --- /dev/null +++ b/src/components/ClusterView.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 67292fcf..9dfa0551 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -528,8 +528,7 @@ export default defineComponent({ selectPhoto(photo: IPhoto, val?: boolean, noUpdate?: boolean) { if ( photo.flag & this.c.FLAG_PLACEHOLDER || - photo.flag & this.c.FLAG_IS_FOLDER || - photo.flag & this.c.FLAG_IS_TAG + photo.flag & this.c.FLAG_IS_FOLDER ) { return; // ignore placeholders } diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index b3c71f2f..3fbe0155 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -8,22 +8,12 @@ - - - + - - this.$route.query.b); + API.DAYS_FILTER( + query, + DaysFilterType.MAP_BOUNDS, + this.$route.query.b + ); } // Month view @@ -739,14 +678,6 @@ export default defineComponent({ let data: IDay[] = []; if (this.$route.name === "thisday") { data = await dav.getOnThisDayData(); - } else if (this.$route.name === "albums" && !this.$route.params.name) { - data = await dav.getAlbumsData(3, this.config_albumListSort); - } else if (this.routeIsPeople && !this.$route.params.name) { - data = await dav.getPeopleData(this.$route.name as any); - } else if (this.$route.name === "places" && !this.$route.params.name) { - data = await dav.getPlacesData(); - } else if (this.$route.name === "tags" && !this.$route.params.name) { - data = await dav.getTagsData(); } else if (dav.isSingleItem()) { data = await dav.getSingleItemData(); this.$router.replace(utils.getViewerRoute(data[0]!.detail[0])); @@ -1043,9 +974,7 @@ export default defineComponent({ return { width: p.w || this.rowHeight, height: p.h || this.rowHeight, - forceSquare: Boolean( - (p.flag & this.c.FLAG_IS_FOLDER) | (p.flag & this.c.FLAG_IS_TAG) - ), + forceSquare: Boolean(p.flag & this.c.FLAG_IS_FOLDER), }; }), { @@ -1419,13 +1348,7 @@ export default defineComponent({ } } -/** Static and dynamic top matter */ -.top-matter { - padding-top: 4px; - @include phone { - padding-left: 40px; - } -} +/** Dynamic top matter */ .recycler-before { width: 100%; > .text { diff --git a/src/components/frame/Tag.vue b/src/components/frame/Cluster.vue similarity index 69% rename from src/components/frame/Tag.vue rename to src/components/frame/Cluster.vue index fc85786c..2eca1c4e 100644 --- a/src/components/frame/Tag.vue +++ b/src/components/frame/Cluster.vue @@ -1,10 +1,10 @@