30
30
<HeaderNavigation key =" navigation"
31
31
slot =" header"
32
32
slot-scope =" {selectedFileIds, resetSelection}"
33
- :class =" {'photos-navigation--uploading': uploader.queue?.length > 0}"
34
33
:loading =" loadingCollectionFiles"
35
34
:params =" { albumName }"
36
35
:path =" '/' + albumName"
37
36
:title =" albumName"
38
37
@refresh =" fetchAlbumContent" >
39
- <div v-if =" album !== undefined && album.location !== ''" slot =" subtitle" class =" album__location" >
38
+ <div v-if =" album !== undefined && album.location !== ''"
39
+ slot =" subtitle"
40
+ class =" album__location" >
40
41
<MapMarker />{{ album.location }}
41
42
</div >
42
43
52
53
</template >
53
54
54
55
<template v-if =" album !== undefined " slot="right">
55
- <UploadPicker :accept = " allowedMimes "
56
- :context = " uploadContext "
57
- :destination = " albumAsFolder "
58
- :root = " uploadContext.root "
59
- :multiple = " true "
60
- @uploaded = " onUpload " / >
56
+ <NcButton @click = " showAddPhotosModal = true " >
57
+ < template # icon >
58
+ < Plus :size = " 20 " />
59
+ </ template >
60
+ {{ t('photos', 'Add photos to this album' ) }}
61
+ </ NcButton >
61
62
62
63
<NcButton v-if =" sharingEnabled"
63
64
type =" tertiary"
164
165
<script >
165
166
import { mapActions } from ' vuex'
166
167
167
- import { Folder , addNewFileMenuEntry , removeNewFileMenuEntry , davParsePermissions } from ' @nextcloud/files'
168
- import { getCurrentUser } from ' @nextcloud/auth'
169
168
import { NcActions , NcActionButton , NcButton , NcDialog , NcModal , NcEmptyContent , NcActionSeparator , NcLoadingIcon , isMobile } from ' @nextcloud/vue'
170
- import { UploadPicker , getUploader } from ' @nextcloud/upload'
171
169
import { translate } from ' @nextcloud/l10n'
172
- import debounce from ' debounce'
173
170
174
171
import Close from ' vue-material-design-icons/Close.vue'
175
172
import Delete from ' vue-material-design-icons/Delete.vue'
@@ -179,7 +176,6 @@ import ImagePlus from 'vue-material-design-icons/ImagePlus.vue'
179
176
import MapMarker from ' vue-material-design-icons/MapMarker.vue'
180
177
import Pencil from ' vue-material-design-icons/Pencil.vue'
181
178
import Plus from ' vue-material-design-icons/Plus.vue'
182
- import PlusSvg from ' @mdi/svg/svg/plus.svg'
183
179
import ShareVariant from ' vue-material-design-icons/ShareVariant.vue'
184
180
185
181
import FetchFilesMixin from ' ../mixins/FetchFilesMixin.js'
@@ -194,7 +190,6 @@ import CollectionContent from '../components/Collection/CollectionContent.vue'
194
190
import PhotosPicker from ' ../components/PhotosPicker.vue'
195
191
import HeaderNavigation from ' ../components/HeaderNavigation.vue'
196
192
197
- import allowedMimes from ' ../services/AllowedMimes.js'
198
193
import logger from ' ../services/logger.js'
199
194
200
195
export default {
@@ -224,7 +219,6 @@ export default {
224
219
Pencil,
225
220
Plus,
226
221
ShareVariant,
227
- UploadPicker,
228
222
},
229
223
230
224
mixins: [
@@ -243,26 +237,11 @@ export default {
243
237
244
238
data () {
245
239
return {
246
- allowedMimes,
247
-
248
240
showAddPhotosModal: false ,
249
241
showManageCollaboratorView: false ,
250
242
showEditAlbumForm: false ,
251
243
252
244
loadingAddCollaborators: false ,
253
-
254
- uploader: getUploader (),
255
-
256
- /** @type {import('@nextcloud/files').Entry} */
257
- newFileMenuEntry: {
258
- id: ' album-add' ,
259
- displayName: t (' photos' , ' Add photos to this album' ),
260
- enabled : (destination ) => destination .basename === this .$route .params .albumName ,
261
- /** Existing icon css class */
262
- iconSvgInline: PlusSvg,
263
- /** Function to be run after creation */
264
- handler : () => { this .showAddPhotosModal = true },
265
- },
266
245
}
267
246
},
268
247
@@ -288,47 +267,17 @@ export default {
288
267
return OC .Share !== undefined
289
268
},
290
269
291
- /**
292
- * The upload picker context
293
- * We're uploading to the album folder, and the backend handle
294
- * the writing to the default location as well as the album update.
295
- * The context is also used for the NewFileMenu.
296
- *
297
- * @return {Album&{route: string, root: string}}
298
- */
299
- uploadContext () {
300
- return {
301
- ... this .album ,
302
- route: this .$route .name ,
303
- root: ` dav/photos/${ getCurrentUser ()? .uid }/ albums` ,
304
- }
305
- },
306
-
307
270
/**
308
271
* @return {string} The album's filename based on its name. Useful to fetch the location information and content.
309
272
*/
310
273
albumFileName () {
311
274
return this .$store .getters .getAlbumName (this .albumName )
312
275
},
313
-
314
- albumAsFolder() {
315
- return new Folder({
316
- ...this.album,
317
- owner: getCurrentUser()?.uid ?? '',
318
- source: this.album?.source ?? '',
319
- permissions: davParsePermissions(this.album.permissions),
320
- })
321
- },
322
276
},
323
277
324
278
async mounted () {
325
279
this .fetchAlbum ()
326
280
this .fetchAlbumContent ()
327
- addNewFileMenuEntry(this.newFileMenuEntry)
328
- },
329
-
330
- destroyed() {
331
- removeNewFileMenuEntry(this.newFileMenuEntry)
332
281
},
333
282
334
283
methods: {
@@ -387,15 +336,6 @@ export default {
387
336
}
388
337
},
389
338
390
- /**
391
- * A new File has been uploaded, let's add it
392
- *
393
- * @param {Upload[]} uploads
394
- */
395
- onUpload: debounce(function() {
396
- this.fetchAlbumContent()
397
- }, 500),
398
-
399
339
t: translate,
400
340
},
401
341
}
@@ -426,26 +366,4 @@ export default {
426
366
color : var (--color-text-lighter );
427
367
}
428
368
}
429
-
430
- .photos-navigation {
431
- position: relative;
432
- // Add space at the bottom for the progress bar.
433
- &--uploading {
434
- margin-bottom: 30px;
435
- }
436
-
437
- :deep(.upload-picker) {
438
- .upload-picker__progress {
439
- position: absolute;
440
- bottom: -30px;
441
- left: 64px;
442
- margin: 0;
443
- }
444
- .upload-picker__cancel {
445
- position: absolute;
446
- bottom: -24px;
447
- right: 50px;
448
- }
449
- }
450
- }
451
369
</style >
0 commit comments