Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes in preparation of 30 #2514

Merged
merged 15 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/photos-dashboard.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-dashboard.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-sidebar.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_components_Albums_AlbumForm_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_components_Albums_AlbumForm_vue.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_Albums_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_Albums_vue.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_Folders_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_Folders_vue.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_SharedAlbumContent_vue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/photos-src_views_SharedAlbumContent_vue.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@nextcloud/logger": "^2.5.0",
"@nextcloud/moment": "^1.2.1",
"@nextcloud/paths": "^2.1.0",
"@nextcloud/router": "^3.0.0",
"@nextcloud/router": "^3.0.1",
"@nextcloud/sharing": "^0.1.0",
"@nextcloud/upload": "^1.0.4",
"@nextcloud/vue": "^8.8.1",
Expand Down
6 changes: 6 additions & 0 deletions src/components/Albums/AlbumForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import { NcButton, NcLoadingIcon, NcTextField } from '@nextcloud/vue'
import moment from '@nextcloud/moment'
import { translate } from '@nextcloud/l10n'
import { generateRemoteUrl } from '@nextcloud/router'

import CollaboratorsSelectionForm from './CollaboratorsSelectionForm.vue'

Expand Down Expand Up @@ -158,7 +159,7 @@
methods: {
...mapActions(['createCollection', 'renameCollection', 'updateCollection']),

/** @param {import('../../store/albums.js').Collaborator[]} collaborators */

Check warning on line 162 in src/components/Albums/AlbumForm.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "collaborators" description
submit(collaborators = []) {
if (this.albumName === '' || this.loading) {
return
Expand All @@ -171,7 +172,7 @@
}
},

/** @param {import('../../store/albums.js').Collaborator[]} collaborators */

Check warning on line 175 in src/components/Albums/AlbumForm.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "collaborators" description
async handleCreateAlbum(collaborators = []) {
try {
this.loading = true
Expand All @@ -184,9 +185,14 @@
lastPhoto: -1,
date: moment().format('MMMM YYYY'),
collaborators,
source: generateRemoteUrl(`dav/${this.albumFileName}`),
},
})

if (album === undefined) {
return
}

if (this.albumLocation !== '' || collaborators.length !== 0) {
album = await this.updateCollection(
{
Expand Down
4 changes: 1 addition & 3 deletions src/components/Albums/CollaboratorsSelectionForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
{{ t('photos', 'Add collaborators') }}
</h2>

<label class="manage-collaborators__subtitle" for="sharing-search-input">
{{ t('photos', 'Add people or groups who can edit your album') }}
</label>
<form class="manage-collaborators__form" @submit.prevent>
<NcSelect v-model="searchText"
input-id="sharing-search-input"
:input-label="t('photos', 'Add people or groups who can edit your album')"
:loading="loadingCollaborators"
label="label"
:filterable="false"
Expand Down Expand Up @@ -117,7 +115,7 @@

/**
* @typedef {Collaborator} SearchResult
* @property {string} key

Check warning on line 118 in src/components/Albums/CollaboratorsSelectionForm.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @Property "key" description
* @property {string} displayName - The label of the collaborator for display.
* @property {Element} [iconSvg] - An icon to differentiate the collaborator type.
*/
Expand Down Expand Up @@ -249,7 +247,7 @@
/**
* Fetch possible collaborators.
*
* @param {string} query

Check warning on line 250 in src/components/Albums/CollaboratorsSelectionForm.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "query" description
*/
async searchCollaborators(query) {
if (query === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/CollectionContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<slot v-if="sortedCollectionFileIds.length === 0 && !loading" name="empty-content" />

<!-- Media list -->
<FilesListViewer v-if="collection !== undefined"
<FilesListViewer v-if="collection !== undefined && sortedCollectionFileIds.length > 0 "
:container-element="appContent"
class="collection__media"
:file-ids="sortedCollectionFileIds"
Expand Down
28 changes: 17 additions & 11 deletions src/components/File.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,19 @@ export default {
},

watch: {
file() {
async file() {
this.initialized = false
this.loadedSmall = false
this.errorSmall = false
this.loadedLarge = false
this.errorLarge = false

await this.init()
},
},

async mounted() {
[this.loadedSmall, this.loadedLarge] = await Promise.all([
await isCachedPreview(this.srcSmall),
await isCachedPreview(this.srcLarge),
])

this.initialized = true

await this.$nextTick() // Wait for next tick to have the canvas in the DOM

this.drawBlurhash()
await this.init()
},

beforeDestroy() {
Expand All @@ -179,6 +172,19 @@ export default {
},

methods: {
async init() {
[this.loadedSmall, this.loadedLarge] = await Promise.all([
await isCachedPreview(this.srcSmall),
await isCachedPreview(this.srcLarge),
])

this.initialized = true

await this.$nextTick() // Wait for next tick to have the canvas in the DOM

this.drawBlurhash()
},

emitClick() {
this.$emit('click', this.file.fileid)
},
Expand Down
7 changes: 4 additions & 3 deletions src/components/PhotosPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export default defineComponent({
...mapGetters([
'files',
]),

photosLocationFolder() {
return this.$store.state.userConfig.photosLocationFolder
},
},

watch: {
Expand Down Expand Up @@ -223,9 +227,6 @@ export default defineComponent({
}
return moment(date, 'YYYYMM').format('MMMM YYYY')
},
photosLocationFolder() {
return this.$store.state.userConfig.photosLocationFolder
},
},
})
</script>
Expand Down
6 changes: 3 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const router = new Router({
{
path: '/albums/:albumName*',
component: AlbumContent,
name: 'albums',
name: 'albumsContent',
props: route => ({
albumName: route.params.albumName,
}),
Expand All @@ -133,7 +133,7 @@ const router = new Router({
{
path: '/sharedalbums/:albumName*',
component: SharedAlbumContent,
name: 'sharedAlbums',
name: 'sharedAlbumsContent',
props: route => ({
albumName: route.params.albumName,
}),
Expand Down Expand Up @@ -164,7 +164,7 @@ const router = new Router({
{
path: '/places/:placeName*',
component: PlaceContent,
name: 'places',
name: 'placesContent',
props: route => ({
placeName: route.params.placeName,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/store/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const getters = {
collectionsFiles: state => state.collectionsFiles,
collectionsWithPrefix: state => function(prefix) {
return Object.values(state.collections)
.filter(collections => collections.filename.startsWith(prefix))
.filter(collection => collection.filename.startsWith(prefix))
.reduce((collections, collection) => ({ ...collections, [collection.filename]: collection }), {})
},
}
Expand Down
Loading
Loading