1313 <HeaderNavigation key =" navigation"
1414 slot =" header"
1515 slot-scope =" {selectedFileIds, resetSelection}"
16- :class =" {'photos-navigation--uploading': uploader.queue?.length > 0}"
1716 :loading =" loadingCollectionFiles"
1817 :params =" { albumName }"
1918 :path =" '/' + albumName"
2019 :title =" albumName"
2120 @refresh =" fetchAlbumContent" >
22- <div v-if =" album !== undefined && album.location !== ''" slot =" subtitle" class =" album__location" >
21+ <div v-if =" album !== undefined && album.location !== ''"
22+ slot =" subtitle"
23+ class =" album__location" >
2324 <MapMarker />{{ album.location }}
2425 </div >
2526
3536 </template >
3637
3738 <template v-if =" album !== undefined " slot="right">
38- <UploadPicker :accept = " allowedMimes "
39- :context = " uploadContext "
40- :destination = " albumAsFolder "
41- :root = " uploadContext.root "
42- :multiple = " true "
43- @uploaded = " onUpload " / >
39+ <NcButton @click = " showAddPhotosModal = true " >
40+ < template # icon >
41+ < Plus :size = " 20 " />
42+ </ template >
43+ {{ t('photos', 'Add photos to this album' ) }}
44+ </ NcButton >
4445
4546 <NcButton v-if =" sharingEnabled"
4647 type =" tertiary"
147148<script >
148149import { mapActions } from ' vuex'
149150
150- import { Folder , addNewFileMenuEntry , removeNewFileMenuEntry , davParsePermissions } from ' @nextcloud/files'
151- import { getCurrentUser } from ' @nextcloud/auth'
152151import { NcActions , NcActionButton , NcButton , NcDialog , NcModal , NcEmptyContent , NcActionSeparator , NcLoadingIcon , isMobile } from ' @nextcloud/vue'
153- import { UploadPicker , getUploader } from ' @nextcloud/upload'
154152import { translate } from ' @nextcloud/l10n'
155- import debounce from ' debounce'
156153
157154import Close from ' vue-material-design-icons/Close.vue'
158155import Delete from ' vue-material-design-icons/Delete.vue'
@@ -162,7 +159,6 @@ import ImagePlus from 'vue-material-design-icons/ImagePlus.vue'
162159import MapMarker from ' vue-material-design-icons/MapMarker.vue'
163160import Pencil from ' vue-material-design-icons/Pencil.vue'
164161import Plus from ' vue-material-design-icons/Plus.vue'
165- import PlusSvg from ' @mdi/svg/svg/plus.svg'
166162import ShareVariant from ' vue-material-design-icons/ShareVariant.vue'
167163
168164import FetchFilesMixin from ' ../mixins/FetchFilesMixin.js'
@@ -176,7 +172,6 @@ import CollectionContent from '../components/Collection/CollectionContent.vue'
176172import PhotosPicker from ' ../components/PhotosPicker.vue'
177173import HeaderNavigation from ' ../components/HeaderNavigation.vue'
178174
179- import allowedMimes from ' ../services/AllowedMimes.js'
180175import logger from ' ../services/logger.js'
181176
182177export default {
@@ -206,7 +201,6 @@ export default {
206201 Pencil,
207202 Plus,
208203 ShareVariant,
209- UploadPicker,
210204 },
211205
212206 mixins: [
@@ -224,26 +218,11 @@ export default {
224218
225219 data () {
226220 return {
227- allowedMimes,
228-
229221 showAddPhotosModal: false ,
230222 showManageCollaboratorView: false ,
231223 showEditAlbumForm: false ,
232224
233225 loadingAddCollaborators: false ,
234-
235- uploader: getUploader (),
236-
237- /** @type {import('@nextcloud/files').Entry} */
238- newFileMenuEntry: {
239- id: ' album-add' ,
240- displayName: t (' photos' , ' Add photos to this album' ),
241- enabled : (destination ) => destination .basename === this .$route .params .albumName ,
242- /** Existing icon css class */
243- iconSvgInline: PlusSvg,
244- /** Function to be run after creation */
245- handler : () => { this .showAddPhotosModal = true },
246- },
247226 }
248227 },
249228
@@ -269,47 +248,17 @@ export default {
269248 return OC .Share !== undefined
270249 },
271250
272- /**
273- * The upload picker context
274- * We're uploading to the album folder, and the backend handle
275- * the writing to the default location as well as the album update.
276- * The context is also used for the NewFileMenu.
277- *
278- * @return {Album&{route: string, root: string}}
279- */
280- uploadContext () {
281- return {
282- ... this .album ,
283- route: this .$route .name ,
284- root: ` dav/photos/${ getCurrentUser ()? .uid }/ albums` ,
285- }
286- },
287-
288251 /**
289252 * @return {string} The album's filename based on its name. Useful to fetch the location information and content.
290253 */
291254 albumFileName () {
292255 return this .$store .getters .getAlbumName (this .albumName )
293256 },
294-
295- albumAsFolder() {
296- return new Folder({
297- ...this.album,
298- owner: getCurrentUser()?.uid ?? '',
299- source: this.album?.source ?? '',
300- permissions: davParsePermissions(this.album.permissions),
301- })
302- },
303257 },
304258
305259 async mounted () {
306260 this .fetchAlbum ()
307261 this .fetchAlbumContent ()
308- addNewFileMenuEntry(this.newFileMenuEntry)
309- },
310-
311- destroyed() {
312- removeNewFileMenuEntry(this.newFileMenuEntry)
313262 },
314263
315264 methods: {
@@ -368,15 +317,6 @@ export default {
368317 }
369318 },
370319
371- /**
372- * A new File has been uploaded, let's add it
373- *
374- * @param {Upload[]} uploads
375- */
376- onUpload: debounce(function() {
377- this.fetchAlbumContent()
378- }, 500),
379-
380320 t: translate,
381321 },
382322}
@@ -407,26 +347,4 @@ export default {
407347 color : var (--color-text-lighter );
408348 }
409349}
410-
411- .photos-navigation {
412- position: relative;
413- // Add space at the bottom for the progress bar.
414- &--uploading {
415- margin-bottom: 30px;
416- }
417-
418- :deep(.upload-picker) {
419- .upload-picker__progress {
420- position: absolute;
421- bottom: -30px;
422- left: 64px;
423- margin: 0;
424- }
425- .upload-picker__cancel {
426- position: absolute;
427- bottom: -24px;
428- right: 50px;
429- }
430- }
431- }
432350 </style >
0 commit comments