mirror of https://github.com/nextcloud/photos
1 line
31 KiB
Plaintext
1 line
31 KiB
Plaintext
{"version":3,"file":"photos-src_views_SharedAlbumContent_vue.js?v=f76169ad8cf580d53915","mappings":";sNA+BA,SACCA,KAAM,8BAENC,KAAIA,KACI,CACNC,eAAgB,IAAIC,EAAAA,EAAsB,GAC1CC,mBAAmB,EACnBC,wBAAwB,EACxBC,wBAAyB,KACzBC,6BAA8B,OAIhCC,OAAQ,CACPC,EAAAA,GAGDC,QAAS,KACLC,EAAAA,EAAAA,IAAW,CACb,cACA,iBACA,uBAQDC,sBAAsBC,EAAoBC,EAAYC,GACrD,GAAIC,KAAKZ,kBACR,OAAO,KAGR,IACCY,KAAKZ,mBAAoB,EACzBY,KAAKV,wBAA0B,KAE/B,MAAMW,QAAmBC,EAAAA,EAAAA,IAAgBL,EAAoB,CAAEM,OAAQH,KAAKI,gBAAgBD,QAAUL,EAAYC,GAElH,OADAC,KAAKK,eAAe,CAAEC,YAAa,CAACL,KAC7BA,CACR,CAAE,MAAOM,GAAO,IAAAC,EACf,GAA+B,OAAb,QAAdA,EAAAD,EAAME,gBAAQ,IAAAD,OAAA,EAAdA,EAAgBE,QAEnB,OADAV,KAAKV,wBAA0B,IACxB,KAGRU,KAAKV,wBAA0BiB,EAC/BI,EAAAA,EAAAA,MAAa,sDAAuD,CAAEJ,WACtEK,EAAAA,EAAAA,IAAUZ,KAAKa,EAAE,SAAU,+BAC5B,CAAE,QACDb,KAAKZ,mBAAoB,CAC1B,CAEA,OAAO,IACR,EASAQ,2BAA2BC,EAAoBC,EAAYC,GAAsB,IAAde,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAC5E,GAAIf,KAAKX,uBACR,MAAO,GAGR,MAAM6B,QAA6BlB,KAAKd,eAAeiC,UAEvD,IACCnB,KAAKT,6BAA+B,KACpCS,KAAKX,wBAAyB,EAE9B,IAAI+B,QAAqBC,EAAAA,EAAAA,IAAqBxB,EAAoB,CAA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UAAU,IAAIf,EAAImB,MAAM,IAAI,GAAGnB,EAAImB,MAAM,EAAE,IAAI,MAAK,EAAM,YAAY,CAACnB,EAAIgB,GAAG,UAAoBlG,IAAdkF,EAAI/B,OAA6C,IAAtB+B,EAAI/B,MAAMoD,SAAmBrB,EAAI9G,wBAA0B8G,EAAI/G,kBAA8lB+G,EAAImB,KAA9kBlB,EAAG,iBAAiB,CAACa,YAAY,eAAeV,MAAM,CAAC,KAAO,gBAAgB,KAAOJ,EAAItF,EAAE,SAAU,uDAAuDqG,KAAK,iBAAiB,CAACd,EAAG,YAAY,CAACG,MAAM,CAAC,KAAO,QAAQW,KAAK,SAASf,EAAIgB,GAAG,KAAKf,EAAG,WAAW,CAACa,YAAY,uBAAuBV,MAAM,CAAC,KAAO,SAAS,KAAO,UAAU,aAAaJ,EAAItF,EAAE,SAAU,6BAA6BkG,GAAG,CAAC,MAAQ,SAASU,GAAQtB,EAAItC,oBAAqB,CAAI,GAAGqD,KAAK,UAAU,CAACd,EAAG,OAAO,CAACG,MAAM,CAAC,KAAO,QAAQW,KAAK,SAASf,EAAIgB,GAAG,aAAahB,EAAIiB,GAAGjB,EAAItF,EAAE,SAAU,QAAQ,aAAa,IAAI,IAAa,GAAYsF,EAAIgB,GAAG,KAAKf,EAAG,eAAe,CAACG,MAAM,CAAC,KAAOJ,EAAItC,mBAAmB,KAAOsC,EAAItF,EAAE,SAAU,4BAA6B,CAAC4C,UAAW0C,EAAI1B,oBAAoB,YAAc0B,EAAI/B,MAAMyD,SAAS,gBAAgB1B,EAAI5B,aAAa,QAAU4B,EAAIpC,wBAAwBgD,GAAG,CAAC,cAAc,SAASU,GAAQtB,EAAItC,mBAAmB4D,CAAM,EAAE,eAAetB,EAAI2B,sBAAsB,EAC1mH,GACsB,IIUpB,EACA,KACA,WACA,MAI8B","sources":["webpack:///photos/src/mixins/FetchCollectionContentMixin.js","webpack:///photos/src/views/SharedAlbumContent.vue?vue&type=style&index=0&id=8d782e7e&prod&lang=scss&scoped=true","webpack://photos/./src/views/SharedAlbumContent.vue?2ff2","webpack:///photos/src/views/SharedAlbumContent.vue","webpack:///photos/src/views/SharedAlbumContent.vue?vue&type=script&lang=js","webpack://photos/./src/views/SharedAlbumContent.vue?8c6c","webpack://photos/./src/views/SharedAlbumContent.vue?a937"],"sourcesContent":["/**\n * @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n *\n * @author Louis Chemineau <louis@chmn.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { mapActions } from 'vuex'\n\nimport { showError } from '@nextcloud/dialogs'\n\nimport AbortControllerMixin from './AbortControllerMixin.js'\nimport { fetchCollection, fetchCollectionFiles } from '../services/collectionFetcher.js'\nimport logger from '../services/logger.js'\nimport SemaphoreWithPriority from '../utils/semaphoreWithPriority.js'\n\nexport default {\n\tname: 'FetchCollectionContentMixin',\n\n\tdata() {\n\t\treturn {\n\t\t\tfetchSemaphore: new SemaphoreWithPriority(1),\n\t\t\tloadingCollection: false,\n\t\t\tloadingCollectionFiles: false,\n\t\t\terrorFetchingCollection: null,\n\t\t\terrorFetchingCollectionFiles: null,\n\t\t}\n\t},\n\n\tmixins: [\n\t\tAbortControllerMixin,\n\t],\n\n\tmethods: {\n\t\t...mapActions([\n\t\t\t'appendFiles',\n\t\t\t'addCollections',\n\t\t\t'setCollectionFiles',\n\t\t]),\n\t\t/**\n\t\t * @param {string} collectionFileName\n\t\t * @param {string[]} [extraProps] - Extra properties to add to the DAV request.\n\t\t * @param {import('webdav').WebDAVClient} [client] - The DAV client to use.\n\t\t * @return {Promise<import('../services/collectionFetcher.js').Collection|null>}\n\t\t */\n\t\tasync fetchCollection(collectionFileName, extraProps, client) {\n\t\t\tif (this.loadingCollection) {\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tthis.loadingCollection = true\n\t\t\t\tthis.errorFetchingCollection = null\n\n\t\t\t\tconst collection = await fetchCollection(collectionFileName, { signal: this.abortController.signal }, extraProps, client)\n\t\t\t\tthis.addCollections({ collections: [collection] })\n\t\t\t\treturn collection\n\t\t\t} catch (error) {\n\t\t\t\tif (error.response?.status === 404) {\n\t\t\t\t\tthis.errorFetchingCollection = 404\n\t\t\t\t\treturn null\n\t\t\t\t}\n\n\t\t\t\tthis.errorFetchingCollection = error\n\t\t\t\tlogger.error('[PublicCollectionContent] Error fetching collection', { error })\n\t\t\t\tshowError(this.t('photos', 'Failed to fetch collection.'))\n\t\t\t} finally {\n\t\t\t\tthis.loadingCollection = false\n\t\t\t}\n\n\t\t\treturn null\n\t\t},\n\n\t\t/**\n\t\t * @param {string} collectionFileName\n\t\t * @param {string[]} [extraProps] - Extra properties to add to the DAV request.\n\t\t * @param {import('webdav').WebDAVClient} [client] - The DAV client to use.\n\t\t * @param {((value: import('../services/collectionFetcher.js').CollectionFile, index: number, array: import('../services/collectionFetcher.js').CollectionFile[]) => any)[]} [mappers] - Callback that can transform files before they are appended.\n\t\t * @return {Promise<import('../services/collectionFetcher.js').CollectionFile[]>}\n\t\t */\n\t\tasync fetchCollectionFiles(collectionFileName, extraProps, client, mappers = []) {\n\t\t\tif (this.loadingCollectionFiles) {\n\t\t\t\treturn []\n\t\t\t}\n\n\t\t\tconst fetchSemaphoreSymbol = await this.fetchSemaphore.acquire()\n\n\t\t\ttry {\n\t\t\t\tthis.errorFetchingCollectionFiles = null\n\t\t\t\tthis.loadingCollectionFiles = true\n\n\t\t\t\tlet fetchedFiles = await fetchCollectionFiles(collectionFileName, { signal: this.abortController.signal }, extraProps, client)\n\t\t\t\tconst fileIds = fetchedFiles.map(file => file.fileid.toString())\n\n\t\t\t\tmappers.forEach(mapper => (fetchedFiles = fetchedFiles.map(mapper)))\n\n\t\t\t\tthis.appendFiles(fetchedFiles)\n\n\t\t\t\tif (fetchedFiles.length > 0) {\n\t\t\t\t\tawait this.$store.commit('setCollectionFiles', { collectionFileName, fileIds })\n\t\t\t\t}\n\n\t\t\t\treturn fetchedFiles\n\t\t\t} catch (error) {\n\t\t\t\tif (error.response?.status === 404) {\n\t\t\t\t\tthis.errorFetchingCollectionFiles = 404\n\t\t\t\t\treturn []\n\t\t\t\t}\n\n\t\t\t\tthis.errorFetchingCollectionFiles = error\n\n\t\t\t\tshowError(this.t('photos', 'Failed to fetch collections list.'))\n\t\t\t\tlogger.error('[PublicCollectionContent] Error fetching collection files', { error })\n\t\t\t} finally {\n\t\t\t\tthis.loadingCollectionFiles = false\n\t\t\t\tthis.fetchSemaphore.release(fetchSemaphoreSymbol)\n\t\t\t}\n\n\t\t\treturn []\n\t\t},\n\t},\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".album[data-v-8d782e7e]{display:flex;flex-direction:column}.album__title[data-v-8d782e7e]{width:100%}.album__name[data-v-8d782e7e]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.album__location[data-v-8d782e7e]{margin-left:-4px;display:flex;color:var(--color-text-lighter)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/views/SharedAlbumContent.vue\"],\"names\":[],\"mappings\":\"AAEA,wBACC,YAAA,CACA,qBAAA,CAEA,+BACC,UAAA,CAGD,8BACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAGD,kCACC,gBAAA,CACA,YAAA,CACA,+BAAA\",\"sourcesContent\":[\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2560\\\": (\\\"count\\\": 8, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"3440\\\": (\\\"count\\\": 9, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"max\\\": (\\\"count\\\": 10, \\\"marginTop\\\": 88, \\\"marginW\\\": 88));\\n\\n.album {\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\n\\t&__title {\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t&__name {\\n\\t\\toverflow: hidden;\\n\\t\\twhite-space: nowrap;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n\\n\\t&__location {\\n\\t\\tmargin-left: -4px;\\n\\t\\tdisplay: flex;\\n\\t\\tcolor: var(--color-text-lighter);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(true)?_c('CollectionContent',{ref:\"collectionContent\",attrs:{\"collection\":_vm.album,\"collection-file-ids\":_vm.albumFileIds,\"loading\":_vm.loadingCollection || _vm.loadingCollectionFiles,\"error\":_vm.errorFetchingCollection || _vm.errorFetchingCollectionFiles},scopedSlots:_vm._u([{key:\"header\",fn:function({selectedFileIds, resetSelection}){return _c('HeaderNavigation',{key:\"navigation\",attrs:{\"loading\":_vm.loadingCollectionFiles,\"params\":{ albumName: _vm.albumName },\"path\":'/' + _vm.albumName,\"title\":_vm.albumOriginalName},on:{\"refresh\":_vm.fetchAlbumContent}},[(_vm.album !== undefined && _vm.album.location !== '')?_c('div',{staticClass:\"album__location\",attrs:{\"slot\":\"subtitle\"},slot:\"subtitle\"},[_c('MapMarker'),_vm._v(_vm._s(_vm.album.location)+\" ⸱ \"+_vm._s(_vm.t('photos', 'Shared by'))+\" \"),_c('NcUserBubble',{attrs:{\"display-name\":_vm.album.collaborators[0].label,\"user\":_vm.album.collaborators[0].id}})],1):_vm._e(),_vm._v(\" \"),_c('template',{slot:\"default\"},[(selectedFileIds.length > 0)?_c('NcButton',{attrs:{\"aria-label\":_vm.t('photos', 'Unselect all')},on:{\"click\":resetSelection},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('Close')]},proxy:true}],null,true)},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', 'Unselect all'))+\"\\n\\t\\t\\t\\t\")]):_vm._e()],1),_vm._v(\" \"),(_vm.album !== undefined)?_c('template',{slot:\"right\"},[(_vm.album.nbItems !== 0)?_c('NcButton',{attrs:{\"type\":\"secondary\",\"aria-label\":_vm.t('photos', 'Add photos to this album')},on:{\"click\":function($event){_vm.showAddPhotosModal = true}}},[_c('Plus',{attrs:{\"slot\":\"icon\"},slot:\"icon\"}),_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', \"Add\"))+\"\\n\\t\\t\\t\\t\")],1):_vm._e(),_vm._v(\" \"),_c('NcActions',{attrs:{\"force-menu\":true,\"aria-label\":_vm.t('photos', 'Open actions menu')}},[(_vm.album.collaborators[0].type === _vm.collaboratorTypes.SHARE_TYPE_USER)?_c('NcActionButton',{attrs:{\"close-after-click\":true},on:{\"click\":_vm.handleDeleteAlbum}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', 'Delete album'))+\"\\n\\t\\t\\t\\t\\t\\t\"),_c('Delete',{attrs:{\"slot\":\"icon\"},slot:\"icon\"})],1):_vm._e(),_vm._v(\" \"),(selectedFileIds.length > 0)?[_c('NcActionSeparator'),_vm._v(\" \"),_c('NcActionButton',{attrs:{\"close-after-click\":true},on:{\"click\":function($event){return _vm.handleRemoveFilesFromAlbum(selectedFileIds)}}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', 'Remove selection from album'))+\"\\n\\t\\t\\t\\t\\t\\t\\t\"),_c('Close',{attrs:{\"slot\":\"icon\"},slot:\"icon\"})],1)]:_vm._e()],2)],1):_vm._e()],2)}}],null,false,284801126)},[_vm._v(\" \"),(_vm.album !== undefined && _vm.album.nbItems === 0 && !(_vm.loadingCollectionFiles || _vm.loadingCollection))?_c('NcEmptyContent',{staticClass:\"album__empty\",attrs:{\"slot\":\"empty-content\",\"name\":_vm.t('photos', 'This album does not have any photos or videos yet!')},slot:\"empty-content\"},[_c('ImagePlus',{attrs:{\"slot\":\"icon\"},slot:\"icon\"}),_vm._v(\" \"),_c('NcButton',{staticClass:\"album__empty__button\",attrs:{\"slot\":\"action\",\"type\":\"primary\",\"aria-label\":_vm.t('photos', 'Add photos to this album')},on:{\"click\":function($event){_vm.showAddPhotosModal = true}},slot:\"action\"},[_c('Plus',{attrs:{\"slot\":\"icon\"},slot:\"icon\"}),_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', \"Add\"))+\"\\n\\t\\t\\t\")],1)],1):_vm._e()],1):_vm._e(),_vm._v(\" \"),_c('PhotosPicker',{attrs:{\"open\":_vm.showAddPhotosModal,\"name\":_vm.t('photos', 'Add photos to {albumName}', {albumName: _vm.albumOriginalName}),\"destination\":_vm.album.basename,\"blacklist-ids\":_vm.albumFileIds,\"loading\":_vm.loadingAddFilesToAlbum},on:{\"update:open\":function($event){_vm.showAddPhotosModal=$event},\"files-picked\":_vm.handleFilesPicked}})],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n -\n - @author Louis Chemineau <louis@chmn.me>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n<template>\n\t<div>\n\t\t<CollectionContent v-if=\"true\"\n\t\t\tref=\"collectionContent\"\n\t\t\t:collection=\"album\"\n\t\t\t:collection-file-ids=\"albumFileIds\"\n\t\t\t:loading=\"loadingCollection || loadingCollectionFiles\"\n\t\t\t:error=\"errorFetchingCollection || errorFetchingCollectionFiles\">\n\t\t\t<!-- Header -->\n\t\t\t<HeaderNavigation key=\"navigation\"\n\t\t\t\tslot=\"header\"\n\t\t\t\tslot-scope=\"{selectedFileIds, resetSelection}\"\n\t\t\t\t:loading=\"loadingCollectionFiles\"\n\t\t\t\t:params=\"{ albumName }\"\n\t\t\t\t:path=\"'/' + albumName\"\n\t\t\t\t:title=\"albumOriginalName\"\n\t\t\t\t@refresh=\"fetchAlbumContent\">\n\t\t\t\t<div v-if=\"album !== undefined && album.location !== ''\" slot=\"subtitle\" class=\"album__location\">\n\t\t\t\t\t<MapMarker />{{ album.location }} ⸱ {{ t('photos', 'Shared by') }} <NcUserBubble :display-name=\"album.collaborators[0].label\" :user=\"album.collaborators[0].id\" />\n\t\t\t\t</div>\n\n\t\t\t\t<template slot=\"default\">\n\t\t\t\t\t<NcButton v-if=\"selectedFileIds.length > 0\"\n\t\t\t\t\t\t:aria-label=\"t('photos', 'Unselect all')\"\n\t\t\t\t\t\t@click=\"resetSelection\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Close />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('photos', 'Unselect all') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\n\t\t\t\t<template v-if=\"album !== undefined\" slot=\"right\">\n\t\t\t\t\t<NcButton v-if=\"album.nbItems !== 0\"\n\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t:aria-label=\"t('photos', 'Add photos to this album')\"\n\t\t\t\t\t\t@click=\"showAddPhotosModal = true\">\n\t\t\t\t\t\t<Plus slot=\"icon\" />\n\t\t\t\t\t\t{{ t('photos', \"Add\") }}\n\t\t\t\t\t</NcButton>\n\n\t\t\t\t\t<NcActions :force-menu=\"true\" :aria-label=\"t('photos', 'Open actions menu')\">\n\t\t\t\t\t\t<!-- TODO: enable download on shared albums -->\n\t\t\t\t\t\t<!-- <ActionDownload v-if=\"albumFileIds.length > 0\"\n\t\t\t\t\t\t\t:selected-file-ids=\"albumFileIds\"\n\t\t\t\t\t\t\t:title=\"t('photos', 'Download all files in album')\">\n\t\t\t\t\t\t\t<DownloadMultiple slot=\"icon\" />\n\t\t\t\t\t\t</ActionDownload> -->\n\n\t\t\t\t\t\t<NcActionButton v-if=\"album.collaborators[0].type === collaboratorTypes.SHARE_TYPE_USER\"\n\t\t\t\t\t\t\t:close-after-click=\"true\"\n\t\t\t\t\t\t\t@click=\"handleDeleteAlbum\">\n\t\t\t\t\t\t\t{{ t('photos', 'Delete album') }}\n\t\t\t\t\t\t\t<Delete slot=\"icon\" />\n\t\t\t\t\t\t</NcActionButton>\n\n\t\t\t\t\t\t<template v-if=\"selectedFileIds.length > 0\">\n\t\t\t\t\t\t\t<NcActionSeparator />\n\n\t\t\t\t\t\t\t<!-- TODO: enable download on shared albums -->\n\t\t\t\t\t\t\t<!-- <ActionDownload :selected-file-ids=\"selectedFileIds\" :title=\"t('photos', 'Download selected files')\">\n\t\t\t\t\t\t\t\t<Download slot=\"icon\" />\n\t\t\t\t\t\t\t</ActionDownload> -->\n\n\t\t\t\t\t\t\t<NcActionButton :close-after-click=\"true\"\n\t\t\t\t\t\t\t\t@click=\"handleRemoveFilesFromAlbum(selectedFileIds)\">\n\t\t\t\t\t\t\t\t{{ t('photos', 'Remove selection from album') }}\n\t\t\t\t\t\t\t\t<Close slot=\"icon\" />\n\t\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcActions>\n\t\t\t\t</template>\n\t\t\t</HeaderNavigation>\n\n\t\t\t<!-- No content -->\n\t\t\t<NcEmptyContent v-if=\"album !== undefined && album.nbItems === 0 && !(loadingCollectionFiles || loadingCollection)\"\n\t\t\t\tslot=\"empty-content\"\n\t\t\t\t:name=\"t('photos', 'This album does not have any photos or videos yet!')\"\n\t\t\t\tclass=\"album__empty\">\n\t\t\t\t<ImagePlus slot=\"icon\" />\n\n\t\t\t\t<NcButton slot=\"action\"\n\t\t\t\t\tclass=\"album__empty__button\"\n\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t:aria-label=\"t('photos', 'Add photos to this album')\"\n\t\t\t\t\t@click=\"showAddPhotosModal = true\">\n\t\t\t\t\t<Plus slot=\"icon\" />\n\t\t\t\t\t{{ t('photos', \"Add\") }}\n\t\t\t\t</NcButton>\n\t\t\t</NcEmptyContent>\n\t\t</CollectionContent>\n\n\t\t<PhotosPicker :open.sync=\"showAddPhotosModal\"\n\t\t\t:name=\"t('photos', 'Add photos to {albumName}', {albumName: albumOriginalName})\"\n\t\t\t:destination=\"album.basename\"\n\t\t\t:blacklist-ids=\"albumFileIds\"\n\t\t\t:loading=\"loadingAddFilesToAlbum\"\n\t\t\t@files-picked=\"handleFilesPicked\" />\n\t</div>\n</template>\n\n<script>\nimport { mapActions, mapGetters } from 'vuex'\n\nimport { NcActions, NcActionButton, NcButton, NcEmptyContent, NcActionSeparator, NcUserBubble, isMobile } from '@nextcloud/vue'\nimport { Type } from '@nextcloud/sharing'\nimport { translate } from '@nextcloud/l10n'\n\nimport MapMarker from 'vue-material-design-icons/MapMarker.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport ImagePlus from 'vue-material-design-icons/ImagePlus.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\n// import Download from 'vue-material-design-icons/Download.vue'\n// import DownloadMultiple from 'vue-material-design-icons/DownloadMultiple.vue'\n\nimport FetchFilesMixin from '../mixins/FetchFilesMixin.js'\nimport FetchCollectionContentMixin from '../mixins/FetchCollectionContentMixin.js'\n\nimport CollectionContent from '../components/Collection/CollectionContent.vue'\nimport HeaderNavigation from '../components/HeaderNavigation.vue'\n// import ActionDownload from '../components/Actions/ActionDownload.vue'\nimport PhotosPicker from '../components/PhotosPicker.vue'\n\nexport default {\n\tname: 'SharedAlbumContent',\n\tcomponents: {\n\t\tMapMarker,\n\t\tPlus,\n\t\tClose,\n\t\t// Download,\n\t\t// DownloadMultiple,\n\t\tDelete,\n\t\tImagePlus,\n\t\tNcEmptyContent,\n\t\tNcActions,\n\t\tNcActionButton,\n\t\tNcActionSeparator,\n\t\tNcButton,\n\t\tNcUserBubble,\n\t\tCollectionContent,\n\t\t// ActionDownload,\n\t\tPhotosPicker,\n\t\tHeaderNavigation,\n\t},\n\n\tmixins: [\n\t\tFetchCollectionContentMixin,\n\t\tFetchFilesMixin,\n\t\tisMobile,\n\t],\n\n\tprops: {\n\t\talbumName: {\n\t\t\ttype: String,\n\t\t\tdefault: '/',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tshowAddPhotosModal: false,\n\t\t\tloadingCount: 0,\n\t\t\tloadingAddFilesToAlbum: false,\n\t\t\tcollaboratorTypes: Type,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t...mapGetters([\n\t\t\t'files',\n\t\t\t'sharedAlbumsFiles',\n\t\t]),\n\n\t\t/**\n\t\t * @return {import('../store/sharedAlbums.js').SharedAlbum|undefined} The album information for the current albumName.\n\t\t */\n\t\talbum() {\n\t\t\treturn this.$store.getters.getSharedAlbum(this.albumName)\n\t\t},\n\n\t\t/**\n\t\t * @return {string[]} The list of files for the current albumName.\n\t\t */\n\t\talbumFileIds() {\n\t\t\treturn this.$store.getters.getSharedAlbumFiles(this.albumName)\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The album name without the userId between parentheses.\n\t\t */\n\t\talbumOriginalName() {\n\t\t\treturn this.albumName.replace(new RegExp(`\\\\(${this.album.collaborators[0].id}\\\\)$`), '')\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The album's filename based on its name. Useful to fetch the location information and content.\n\t\t */\n\t\talbumFileName() {\n\t\t\treturn this.$store.getters.getSharedAlbumName(this.albumName)\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tthis.fetchAlbum()\n\t\tthis.fetchAlbumContent()\n\t},\n\n\tmethods: {\n\t\t...mapActions([\n\t\t\t'addFilesToCollection',\n\t\t\t'removeFilesFromCollection',\n\t\t\t'deleteCollection',\n\t\t]),\n\n\t\tasync fetchAlbum() {\n\t\t\tawait this.fetchCollection(\n\t\t\t\tthis.albumFileName,\n\t\t\t\t['<nc:location />', '<nc:dateRange />', '<nc:collaborators />']\n\t\t\t)\n\t\t},\n\n\t\tasync fetchAlbumContent() {\n\t\t\tawait this.fetchCollectionFiles(this.albumFileName)\n\t\t},\n\n\t\tasync handleFilesPicked(fileIds) {\n\t\t\tthis.showAddPhotosModal = false\n\t\t\tawait this.addFilesToCollection({ collectionFileName: this.album.filename, fileIdsToAdd: fileIds })\n\t\t\t// Re-fetch album content to have the proper filenames.\n\t\t\tawait this.fetchAlbumContent()\n\t\t},\n\n\t\tasync handleRemoveFilesFromAlbum(fileIds) {\n\t\t\tthis.$refs.collectionContent.onUncheckFiles(fileIds)\n\t\t\tawait this.removeFilesFromCollection({ collectionFileName: this.album.filename, fileIdsToRemove: fileIds })\n\t\t},\n\n\t\tasync handleDeleteAlbum() {\n\t\t\tawait this.deleteCollection({ collectionFileName: this.album.filename })\n\t\t\tthis.$router.push('/sharedalbums')\n\t\t},\n\n\t\tt: translate,\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.album {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t&__title {\n\t\twidth: 100%;\n\t}\n\n\t&__name {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&__location {\n\t\tmargin-left: -4px;\n\t\tdisplay: flex;\n\t\tcolor: var(--color-text-lighter);\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharedAlbumContent.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharedAlbumContent.vue?vue&type=script&lang=js\"","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharedAlbumContent.vue?vue&type=style&index=0&id=8d782e7e&prod&lang=scss&scoped=true\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SharedAlbumContent.vue?vue&type=style&index=0&id=8d782e7e&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./SharedAlbumContent.vue?vue&type=template&id=8d782e7e&scoped=true\"\nimport script from \"./SharedAlbumContent.vue?vue&type=script&lang=js\"\nexport * from \"./SharedAlbumContent.vue?vue&type=script&lang=js\"\nimport style0 from \"./SharedAlbumContent.vue?vue&type=style&index=0&id=8d782e7e&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"8d782e7e\",\n null\n \n)\n\nexport default component.exports"],"names":["name","data","fetchSemaphore","SemaphoreWithPriority","loadingCollection","loadingCollectionFiles","errorFetchingCollection","errorFetchingCollectionFiles","mixins","AbortControllerMixin","methods","mapActions","async","collectionFileName","extraProps","client","this","collection","fetchCollection","signal","abortController","addCollections","collections","error","_error$response","response","status","logger","showError","t","mappers","arguments","length","undefined","fetchSemaphoreSymbol","acquire","fetchedFiles","fetchCollectionFiles","fileIds","map","file","fileid","toString","forEach","mapper","appendFiles","$store","commit","_error$response2","release","___CSS_LOADER_EXPORT___","push","module","id","components","MapMarker","Plus","Close","Delete","ImagePlus","NcEmptyContent","NcActions","NcActionButton","NcActionSeparator","NcButton","NcUserBubble","CollectionContent","PhotosPicker","HeaderNavigation","FetchCollectionContentMixin","FetchFilesMixin","isMobile","props","albumName","type","String","default","showAddPhotosModal","loadingCount","loadingAddFilesToAlbum","collaboratorTypes","Type","computed","mapGetters","album","getters","getSharedAlbum","albumFileIds","getSharedAlbumFiles","albumOriginalName","replace","RegExp","concat","collaborators","albumFileName","getSharedAlbumName","fetchAlbum","fetchAlbumContent","addFilesToCollection","filename","fileIdsToAdd","$refs","collectionContent","onUncheckFiles","removeFilesFromCollection","fileIdsToRemove","deleteCollection","$router","translate","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","_c","_self","ref","attrs","scopedSlots","_u","key","fn","_ref","selectedFileIds","resetSelection","on","location","staticClass","slot","_v","_s","label","_e","proxy","nbItems","$event","SHARE_TYPE_USER","handleDeleteAlbum","handleRemoveFilesFromAlbum","basename","handleFilesPicked"],"sourceRoot":""} |