From 1084c7057bf8d332f4af36932ed525e057b10641 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 21 Aug 2023 18:22:14 -0700 Subject: [PATCH] refactor: lowercase Utils Signed-off-by: Varun Patil --- src/App.vue | 2 +- src/components/ClusterGrid.vue | 2 +- src/components/FirstStart.vue | 2 +- src/components/Metadata.vue | 3 +-- src/components/ScrollerManager.vue | 2 +- src/components/SelectionManager.vue | 2 +- src/components/Settings.vue | 2 +- src/components/Timeline.vue | 2 +- src/components/admin/AdminMain.vue | 2 +- src/components/admin/sections/Places.vue | 2 +- src/components/frame/Photo.vue | 2 +- src/components/frame/RowHead.vue | 2 +- src/components/modal/EditDate.vue | 2 +- src/components/modal/FaceMergeModal.vue | 2 +- src/components/modal/FaceMoveModal.vue | 2 +- src/components/modal/MoveToFolderModal.vue | 2 +- src/components/modal/MultiPathSelectionModal.vue | 2 +- src/components/modal/NodeShareModal.vue | 2 +- src/components/modal/ShareModal.vue | 2 +- src/components/top-matter/AlbumTopMatter.vue | 2 +- src/components/top-matter/FaceTopMatter.vue | 2 +- src/components/top-matter/FolderDynamicTopMatter.vue | 2 +- src/components/top-matter/FolderTopMatter.vue | 2 +- src/components/top-matter/MapSplitMatter.vue | 2 +- src/components/top-matter/OnThisDay.vue | 2 +- src/components/viewer/ImageEditor.vue | 2 +- src/components/viewer/PsLivePhoto.ts | 2 +- src/components/viewer/PsVideo.ts | 2 +- src/components/viewer/Viewer.vue | 2 +- src/mixins/GlobalMixin.ts | 2 +- src/native.ts | 1 - src/services/Utils.ts | 6 ------ src/services/dav/base.ts | 2 +- src/services/dav/face.ts | 2 +- src/services/dav/favorites.ts | 2 +- src/services/dav/onthisday.ts | 2 +- src/services/static-config.ts | 2 +- src/services/utils/index.ts | 6 ++++++ src/vue-globals.d.ts | 2 +- 39 files changed, 42 insertions(+), 44 deletions(-) delete mode 100644 src/services/Utils.ts create mode 100644 src/services/utils/index.ts diff --git a/src/App.vue b/src/App.vue index 5c7c13cf..bd8876fe 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,7 +73,7 @@ import { generateUrl } from '@nextcloud/router'; import { translate as t } from '@nextcloud/l10n'; import { emit, subscribe } from '@nextcloud/event-bus'; -import * as utils from './services/Utils'; +import * as utils from './services/utils'; import * as nativex from './native'; import router from './router'; import staticConfig from './services/static-config'; diff --git a/src/components/ClusterGrid.vue b/src/components/ClusterGrid.vue index 06f6fcb5..e9ff971c 100644 --- a/src/components/ClusterGrid.vue +++ b/src/components/ClusterGrid.vue @@ -29,7 +29,7 @@ import { defineComponent } from 'vue'; import Cluster from './frame/Cluster.vue'; import type { ICluster } from '../types'; -import * as utils from '../services/Utils'; +import * as utils from '../services/utils'; export default defineComponent({ name: 'ClusterGrid', diff --git a/src/components/FirstStart.vue b/src/components/FirstStart.vue index e371f292..4f2d9d10 100644 --- a/src/components/FirstStart.vue +++ b/src/components/FirstStart.vue @@ -57,7 +57,7 @@ import axios from '@nextcloud/axios'; import banner from '../assets/banner.svg'; import type { IDay } from '../types'; import { API } from '../services/API'; -import * as utils from '../services/Utils'; +import * as utils from '../services/utils'; export default defineComponent({ name: 'FirstStart', diff --git a/src/components/Metadata.vue b/src/components/Metadata.vue index 21a0d19e..c39ebcd1 100644 --- a/src/components/Metadata.vue +++ b/src/components/Metadata.vue @@ -83,8 +83,7 @@ import InfoIcon from 'vue-material-design-icons/InformationOutline.vue'; import LocationIcon from 'vue-material-design-icons/MapMarker.vue'; import TagIcon from 'vue-material-design-icons/Tag.vue'; -import * as utils from '../services/Utils'; -import * as dav from '../services/DavRequests'; +import * as utils from '../services/utils'; import { API } from '../services/API'; import type { IAlbum, IFace, IImageInfo, IPhoto } from '../types'; diff --git a/src/components/ScrollerManager.vue b/src/components/ScrollerManager.vue index 6cb120a2..15bf367a 100644 --- a/src/components/ScrollerManager.vue +++ b/src/components/ScrollerManager.vue @@ -55,7 +55,7 @@ import { emit } from '@nextcloud/event-bus'; import ScrollUpIcon from 'vue-material-design-icons/MenuUp.vue'; import ScrollDownIcon from 'vue-material-design-icons/MenuDown.vue'; -import * as utils from '../services/Utils'; +import * as utils from '../services/utils'; const SNAP_OFFSET = -5; // Pixels to snap at const SNAP_MIN_ROWS = 1000; // Minimum rows to snap at diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index aadbd912..554d076e 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -53,7 +53,7 @@ import { subscribe, unsubscribe } from '@nextcloud/event-bus'; import { getCurrentUser } from '@nextcloud/auth'; import * as dav from '../services/DavRequests'; -import * as utils from '../services/Utils'; +import * as utils from '../services/utils'; import * as nativex from '../native'; import FaceMoveModal from './modal/FaceMoveModal.vue'; diff --git a/src/components/Settings.vue b/src/components/Settings.vue index 0096dc93..efd92601 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -138,7 +138,7 @@ import { defineComponent } from 'vue'; import { getCurrentUser } from '@nextcloud/auth'; import UserConfig from '../mixins/UserConfig'; -import * as utils from '../services/Utils'; +import * as utils from '../services/utils'; import * as nativex from '../native'; import NcButton from '@nextcloud/vue/dist/Components/NcButton'; diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index 9f013c40..841d89df 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -110,7 +110,7 @@ import TopMatter from './top-matter/TopMatter.vue'; import DynamicTopMatter from './top-matter/DynamicTopMatter.vue'; import * as dav from '../services/DavRequests'; -import * as utils from '../services/Utils'; +import * as utils from '../services/utils'; import * as nativex from '../native'; import { API, DaysFilterType } from '../services/API'; diff --git a/src/components/admin/AdminMain.vue b/src/components/admin/AdminMain.vue index a5d1c9b6..49a89808 100644 --- a/src/components/admin/AdminMain.vue +++ b/src/components/admin/AdminMain.vue @@ -27,7 +27,7 @@ import axios from '@nextcloud/axios'; import { showError } from '@nextcloud/dialogs'; import { API } from '../../services/API'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import staticConfig from '../../services/static-config'; import Help from './sections/Help.vue'; diff --git a/src/components/admin/sections/Places.vue b/src/components/admin/sections/Places.vue index 06f12fb6..ae3d244d 100644 --- a/src/components/admin/sections/Places.vue +++ b/src/components/admin/sections/Places.vue @@ -72,7 +72,7 @@ import { defineComponent } from 'vue'; import { API } from '../../../services/API'; import { translate as t } from '@nextcloud/l10n'; -import * as utils from '../../../services/Utils'; +import * as utils from '../../../services/utils'; import AdminMixin from '../AdminMixin'; diff --git a/src/components/frame/Photo.vue b/src/components/frame/Photo.vue index d13fd0f9..aa794dfa 100644 --- a/src/components/frame/Photo.vue +++ b/src/components/frame/Photo.vue @@ -66,7 +66,7 @@ import { defineComponent, PropType } from 'vue'; import { IDay, IPhoto } from '../../types'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import errorsvg from '../../assets/error.svg'; import CheckCircleIcon from 'vue-material-design-icons/CheckCircle.vue'; diff --git a/src/components/frame/RowHead.vue b/src/components/frame/RowHead.vue index fbee923c..c9f0b70f 100644 --- a/src/components/frame/RowHead.vue +++ b/src/components/frame/RowHead.vue @@ -16,7 +16,7 @@ import { IHeadRow } from '../../types'; import CheckCircle from 'vue-material-design-icons/CheckCircle.vue'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; export default defineComponent({ name: 'RowHead', diff --git a/src/components/modal/EditDate.vue b/src/components/modal/EditDate.vue index b25e8ad0..3a18110b 100644 --- a/src/components/modal/EditDate.vue +++ b/src/components/modal/EditDate.vue @@ -106,7 +106,7 @@ import { IPhoto } from '../../types'; const NcTextField = () => import('@nextcloud/vue/dist/Components/NcTextField'); -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; export default defineComponent({ name: 'EditDate', diff --git a/src/components/modal/FaceMergeModal.vue b/src/components/modal/FaceMergeModal.vue index 761551ab..e9ef73e6 100644 --- a/src/components/modal/FaceMergeModal.vue +++ b/src/components/modal/FaceMergeModal.vue @@ -36,7 +36,7 @@ import FaceList from './FaceList.vue'; import Modal from './Modal.vue'; import client from '../../services/DavClient'; import * as dav from '../../services/DavRequests'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; export default defineComponent({ name: 'FaceMergeModal', diff --git a/src/components/modal/FaceMoveModal.vue b/src/components/modal/FaceMoveModal.vue index 44dda7be..3ac8f66d 100644 --- a/src/components/modal/FaceMoveModal.vue +++ b/src/components/modal/FaceMoveModal.vue @@ -30,7 +30,7 @@ import FaceList from './FaceList.vue'; import Modal from './Modal.vue'; import * as dav from '../../services/DavRequests'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; export default defineComponent({ name: 'FaceMoveModal', diff --git a/src/components/modal/MoveToFolderModal.vue b/src/components/modal/MoveToFolderModal.vue index 714b1e32..45e6551e 100644 --- a/src/components/modal/MoveToFolderModal.vue +++ b/src/components/modal/MoveToFolderModal.vue @@ -17,7 +17,7 @@ import { FilePickerType } from '@nextcloud/dialogs'; import { showInfo } from '@nextcloud/dialogs'; import * as dav from '../../services/DavRequests'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import type { IPhoto } from '../../types'; diff --git a/src/components/modal/MultiPathSelectionModal.vue b/src/components/modal/MultiPathSelectionModal.vue index cb200f6e..207220f0 100644 --- a/src/components/modal/MultiPathSelectionModal.vue +++ b/src/components/modal/MultiPathSelectionModal.vue @@ -33,7 +33,7 @@ import { defineComponent } from 'vue'; import Modal from './Modal.vue'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import NcActions from '@nextcloud/vue/dist/Components/NcActions'; import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton'; diff --git a/src/components/modal/NodeShareModal.vue b/src/components/modal/NodeShareModal.vue index a5577954..c27b7753 100644 --- a/src/components/modal/NodeShareModal.vue +++ b/src/components/modal/NodeShareModal.vue @@ -72,7 +72,7 @@ import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton'; import Modal from './Modal.vue'; import { API } from '../../services/API'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import * as nativex from '../../native'; import CloseIcon from 'vue-material-design-icons/Close.vue'; diff --git a/src/components/modal/ShareModal.vue b/src/components/modal/ShareModal.vue index 4c61b5e5..5f3f9540 100644 --- a/src/components/modal/ShareModal.vue +++ b/src/components/modal/ShareModal.vue @@ -80,7 +80,7 @@ import UserConfig from '../../mixins/UserConfig'; import { IPhoto } from '../../types'; import { API } from '../../services/API'; import * as dav from '../../services/DavRequests'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import * as nativex from '../../native'; import PhotoIcon from 'vue-material-design-icons/Image.vue'; diff --git a/src/components/top-matter/AlbumTopMatter.vue b/src/components/top-matter/AlbumTopMatter.vue index 06b7931e..fcee50c9 100644 --- a/src/components/top-matter/AlbumTopMatter.vue +++ b/src/components/top-matter/AlbumTopMatter.vue @@ -121,7 +121,7 @@ import SortIcon from 'vue-material-design-icons/SortVariant.vue'; import SlotAlphabeticalIcon from 'vue-material-design-icons/SortAlphabeticalAscending.vue'; import SortDateIcon from 'vue-material-design-icons/SortCalendarDescending.vue'; import { API } from '../../services/API'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; export default defineComponent({ name: 'AlbumTopMatter', diff --git a/src/components/top-matter/FaceTopMatter.vue b/src/components/top-matter/FaceTopMatter.vue index 137628d5..2bac1252 100644 --- a/src/components/top-matter/FaceTopMatter.vue +++ b/src/components/top-matter/FaceTopMatter.vue @@ -78,7 +78,7 @@ import DeleteIcon from 'vue-material-design-icons/Close.vue'; import MergeIcon from 'vue-material-design-icons/Merge.vue'; import UnassignedIcon from 'vue-material-design-icons/AccountQuestion.vue'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; export default defineComponent({ name: 'FaceTopMatter', diff --git a/src/components/top-matter/FolderDynamicTopMatter.vue b/src/components/top-matter/FolderDynamicTopMatter.vue index cfdfa6db..f4ba8e1b 100644 --- a/src/components/top-matter/FolderDynamicTopMatter.vue +++ b/src/components/top-matter/FolderDynamicTopMatter.vue @@ -10,7 +10,7 @@ import axios from '@nextcloud/axios'; import FolderGrid from './FolderGrid.vue'; import UserMixin from '../../mixins/UserConfig'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import { API } from '../../services/API'; import type { IFolder } from '../../types'; diff --git a/src/components/top-matter/FolderTopMatter.vue b/src/components/top-matter/FolderTopMatter.vue index d09b229f..660bb6f2 100644 --- a/src/components/top-matter/FolderTopMatter.vue +++ b/src/components/top-matter/FolderTopMatter.vue @@ -41,7 +41,7 @@ const NcBreadcrumb = () => import('@nextcloud/vue/dist/Components/NcBreadcrumb') import NcActions from '@nextcloud/vue/dist/Components/NcActions'; import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import HomeIcon from 'vue-material-design-icons/Home.vue'; import ShareIcon from 'vue-material-design-icons/ShareVariant.vue'; diff --git a/src/components/top-matter/MapSplitMatter.vue b/src/components/top-matter/MapSplitMatter.vue index cf76c9d4..eca348c2 100644 --- a/src/components/top-matter/MapSplitMatter.vue +++ b/src/components/top-matter/MapSplitMatter.vue @@ -44,7 +44,7 @@ import axios from '@nextcloud/axios'; import { subscribe, unsubscribe } from '@nextcloud/event-bus'; import { API } from '../../services/API'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import 'leaflet/dist/leaflet.css'; import 'leaflet-edgebuffer'; diff --git a/src/components/top-matter/OnThisDay.vue b/src/components/top-matter/OnThisDay.vue index bb092e62..3d938b76 100644 --- a/src/components/top-matter/OnThisDay.vue +++ b/src/components/top-matter/OnThisDay.vue @@ -35,7 +35,7 @@ import { defineComponent } from 'vue'; import NcActions from '@nextcloud/vue/dist/Components/NcActions'; import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import * as dav from '../../services/DavRequests'; import { IPhoto } from '../../types'; diff --git a/src/components/viewer/ImageEditor.vue b/src/components/viewer/ImageEditor.vue index e4d8e6d7..97a319d1 100644 --- a/src/components/viewer/ImageEditor.vue +++ b/src/components/viewer/ImageEditor.vue @@ -15,7 +15,7 @@ import translations from './ImageEditorTranslations'; import { API } from '../../services/API'; import { IImageInfo, IPhoto } from '../../types'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import { fetchImage } from '../frame/XImgCache'; // Crop preset icons diff --git a/src/components/viewer/PsLivePhoto.ts b/src/components/viewer/PsLivePhoto.ts index 41421919..de1e010b 100644 --- a/src/components/viewer/PsLivePhoto.ts +++ b/src/components/viewer/PsLivePhoto.ts @@ -1,6 +1,6 @@ import PhotoSwipe from 'photoswipe'; import PsImage from './PsImage'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import staticConfig from '../../services/static-config'; import type { PsContent, PsEvent } from './types'; diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index 828952d6..8adb8ca9 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -1,7 +1,7 @@ import PhotoSwipe from 'photoswipe'; import staticConfig from '../../services/static-config'; import * as nativex from '../../native'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import { showError } from '@nextcloud/dialogs'; import { translate as t } from '@nextcloud/l10n'; diff --git a/src/components/viewer/Viewer.vue b/src/components/viewer/Viewer.vue index 8e84762a..e4b34956 100644 --- a/src/components/viewer/Viewer.vue +++ b/src/components/viewer/Viewer.vue @@ -186,7 +186,7 @@ import axios from '@nextcloud/axios'; import { getDownloadLink } from '../../services/DavRequests'; import { API } from '../../services/API'; import * as dav from '../../services/DavRequests'; -import * as utils from '../../services/Utils'; +import * as utils from '../../services/utils'; import * as nativex from '../../native'; import ImageEditor from './ImageEditor.vue'; diff --git a/src/mixins/GlobalMixin.ts b/src/mixins/GlobalMixin.ts index 30c4bb42..3204eed0 100644 --- a/src/mixins/GlobalMixin.ts +++ b/src/mixins/GlobalMixin.ts @@ -1,5 +1,5 @@ import { translate as t, translatePlural as n } from '@nextcloud/l10n'; -import { constants } from '../services/Utils'; +import { constants } from '../services/utils'; import { loadState } from '@nextcloud/initial-state'; import { defineComponent } from 'vue'; diff --git a/src/native.ts b/src/native.ts index 58bdfba1..983a76f1 100644 --- a/src/native.ts +++ b/src/native.ts @@ -1,5 +1,4 @@ import axios from '@nextcloud/axios'; -import { constants } from './services/Utils'; import { generateUrl } from '@nextcloud/router'; import type { IDay, IPhoto, IImageInfo } from './types'; const euc = encodeURIComponent; diff --git a/src/services/Utils.ts b/src/services/Utils.ts deleted file mode 100644 index 3226a801..00000000 --- a/src/services/Utils.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './utils/algo'; -export * from './utils/cache'; -export * from './utils/const'; -export * from './utils/date'; -export * from './utils/helpers'; -export * from './utils/dialog'; diff --git a/src/services/dav/base.ts b/src/services/dav/base.ts index 77cbdf1f..d8ff039d 100644 --- a/src/services/dav/base.ts +++ b/src/services/dav/base.ts @@ -8,7 +8,7 @@ import { genFileInfo } from '../FileUtils'; import { API } from '../API'; import { getAlbumFileInfos } from './albums'; import client from '../DavClient'; -import * as utils from '../Utils'; +import * as utils from '../utils'; import * as nativex from '../../native'; export const props = ` diff --git a/src/services/dav/face.ts b/src/services/dav/face.ts index b87ebc93..f9e609bc 100644 --- a/src/services/dav/face.ts +++ b/src/services/dav/face.ts @@ -5,7 +5,7 @@ import { generateUrl } from '@nextcloud/router'; import { IFace, IPhoto } from '../../types'; import { API } from '../API'; import client from '../DavClient'; -import * as utils from '../Utils'; +import * as utils from '../utils'; import * as base from './base'; /** diff --git a/src/services/dav/favorites.ts b/src/services/dav/favorites.ts index c6cd700a..001c7f24 100644 --- a/src/services/dav/favorites.ts +++ b/src/services/dav/favorites.ts @@ -3,7 +3,7 @@ import { translate as t } from '@nextcloud/l10n'; import { IFileInfo, IPhoto } from '../../types'; import client from '../DavClient'; import * as base from './base'; -import * as utils from '../Utils'; +import * as utils from '../utils'; /** * Favorite a file diff --git a/src/services/dav/onthisday.ts b/src/services/dav/onthisday.ts index 5f7effa8..1d95d2a4 100644 --- a/src/services/dav/onthisday.ts +++ b/src/services/dav/onthisday.ts @@ -1,6 +1,6 @@ import { IDay, IPhoto } from '../../types'; import axios from '@nextcloud/axios'; -import * as utils from '../Utils'; +import * as utils from '../utils'; import { API } from '../API'; /** diff --git a/src/services/static-config.ts b/src/services/static-config.ts index cda4e5ba..a89088a0 100644 --- a/src/services/static-config.ts +++ b/src/services/static-config.ts @@ -4,7 +4,7 @@ import { API } from './API'; import { IConfig } from '../types'; import { getBuilder } from '@nextcloud/browser-storage'; import { translate as t } from '@nextcloud/l10n'; -import * as utils from './Utils'; +import * as utils from './utils'; import type Storage from '@nextcloud/browser-storage/dist/storage'; diff --git a/src/services/utils/index.ts b/src/services/utils/index.ts new file mode 100644 index 00000000..10794f62 --- /dev/null +++ b/src/services/utils/index.ts @@ -0,0 +1,6 @@ +export * from './algo'; +export * from './cache'; +export * from './const'; +export * from './date'; +export * from './helpers'; +export * from './dialog'; diff --git a/src/vue-globals.d.ts b/src/vue-globals.d.ts index 164fe487..42b30448 100644 --- a/src/vue-globals.d.ts +++ b/src/vue-globals.d.ts @@ -1,4 +1,4 @@ -import { type constants } from './services/Utils'; +import { type constants } from './services/utils'; import type { translate, translatePlural } from '@nextcloud/l10n'; declare module 'vue' {