Skip to content

Commit

Permalink
Merge branch 'master' into fix-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Dec 3, 2024
2 parents 87cc813 + 72ecd9a commit 79edc1d
Show file tree
Hide file tree
Showing 10 changed files with 299 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php_no_legacy_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:

- name: SonarCloud Scan
if: ${{ env.SONAR_TOKEN }}
uses: SonarSource/sonarcloud-github-action@9f9bba2c7aaf7a55eac26abbac906c3021d211b2 # master
uses: SonarSource/sonarcloud-github-action@982992a35a56c6bebd7c76c65e5c3e4c18e634c8 # master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/php_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:

- name: SonarCloud Scan
if: ${{ env.SONAR_TOKEN }}
uses: SonarSource/sonarcloud-github-action@9f9bba2c7aaf7a55eac26abbac906c3021d211b2 # master
uses: SonarSource/sonarcloud-github-action@982992a35a56c6bebd7c76c65e5c3e4c18e634c8 # master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
410 changes: 207 additions & 203 deletions composer.lock

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/leaflet-rotatedmarker": "^0.2.5",
"@types/leaflet.markercluster": "^1.5.5",
"@types/mousetrap": "^1.6.15",
"@types/node": "^22.9.0",
"@types/node": "^22.10.1",
"@types/photoswipe": "^4.1.6",
"@types/qrcode": "^1.5.5",
"@types/sprintf-js": "^1.1.4",
Expand All @@ -42,11 +42,11 @@
"leaflet-gpx": "^2.1.2",
"leaflet-rotatedmarker": "^0.2.0",
"leaflet.markercluster": "^1.5.3",
"pinia": "^2.1.7",
"pinia": "^2.2.8",
"postcss": "^8.4.49",
"prettier": "^3.2.4",
"prettier": "^3.4.1",
"primeicons": "^7.0.0",
"primevue": "^4.2.3",
"primevue": "^4.2.4",
"qrcode": "^1.5.3",
"sprintf-js": "^1.1.3",
"tailwindcss": "^3.4.15",
Expand All @@ -58,7 +58,7 @@
"vite-plugin-commonjs": "^0.10.4",
"vue": "^3.5.13",
"vue-collapsed": "^1.3.3",
"vue-i18n": "^10.0.4",
"vue-i18n": "^10.0.5",
"vue-router": "^4.5.0"
},
"browserslist": [
Expand Down
7 changes: 7 additions & 0 deletions resources/js/composables/album/albumRefresher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { computed, Ref, ref } from "vue";

export function useAlbumRefresher(albumId: Ref<string>, auth: AuthStore, isLoginOpen: Ref<boolean>, nsfw_consented: Ref<string[]>) {
const isPasswordProtected = ref(false);
const isLoading = ref(false);
const user = ref<App.Http.Resources.Models.UserResource | undefined>(undefined);
const modelAlbum = ref<App.Http.Resources.Models.AlbumResource | undefined>(undefined);
const tagAlbum = ref<App.Http.Resources.Models.TagAlbumResource | undefined>(undefined);
Expand All @@ -23,6 +24,8 @@ export function useAlbumRefresher(albumId: Ref<string>, auth: AuthStore, isLogin
}

function loadAlbum(): Promise<void> {
isLoading.value = true;

return AlbumService.get(albumId.value)
.then((data) => {
isPasswordProtected.value = false;
Expand Down Expand Up @@ -50,6 +53,9 @@ export function useAlbumRefresher(albumId: Ref<string>, auth: AuthStore, isLogin
} else {
console.error(error);
}
})
.finally(() => {
isLoading.value = false;
});
}

Expand All @@ -60,6 +66,7 @@ export function useAlbumRefresher(albumId: Ref<string>, auth: AuthStore, isLogin
return {
isAlbumConsented,
isPasswordProtected,
isLoading,
albumId,
user,
modelAlbum,
Expand Down
14 changes: 11 additions & 3 deletions resources/js/composables/album/albumsRefresher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ export function useAlbumsRefresher(auth: AuthStore, lycheeStore: LycheeStateStor
const { spliter } = useSplitter();
const user = ref<App.Http.Resources.Models.UserResource | undefined>(undefined);
const isKeybindingsHelpOpen = ref(false);
const isLoading = ref(false);
const smartAlbums = ref<App.Http.Resources.Models.ThumbAlbumResource[]>([]);
const albums = ref<App.Http.Resources.Models.ThumbAlbumResource[]>([]);
const sharedAlbums = ref<SplitData<App.Http.Resources.Models.ThumbAlbumResource>[]>([]);
const rootConfig = ref<App.Http.Resources.GalleryConfigs.RootConfig | undefined>(undefined);
const rootRights = ref<App.Http.Resources.Rights.RootAlbumRightsResource | undefined>(undefined);
const selectableAlbums = computed(() => albums.value.concat(sharedAlbums.value.map((album) => album.data).flat()));

function refresh(): Promise<void> {
auth.getUser().then((data) => {
function refresh(): Promise<[void, void]> {
isLoading.value = true;

const getUser = auth.getUser().then((data) => {
user.value = data;

const body_width = document.body.scrollWidth;
Expand All @@ -26,7 +29,7 @@ export function useAlbumsRefresher(auth: AuthStore, lycheeStore: LycheeStateStor
}
});

return AlbumService.getAll()
const getAlbums = AlbumService.getAll()
.then((data) => {
smartAlbums.value = (data.data.smart_albums as App.Http.Resources.Models.ThumbAlbumResource[]) ?? [];
albums.value = data.data.albums as App.Http.Resources.Models.ThumbAlbumResource[];
Expand Down Expand Up @@ -54,11 +57,16 @@ export function useAlbumsRefresher(auth: AuthStore, lycheeStore: LycheeStateStor
console.error(error);
}
});

return Promise.all([getUser, getAlbums]).finally(() => {
isLoading.value = false;
});
}

return {
user,
isKeybindingsHelpOpen,
isLoading,
smartAlbums,
albums,
sharedAlbums,
Expand Down
4 changes: 2 additions & 2 deletions resources/js/layouts/PhotoLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export function useGetLayoutConfig() {
const layoutConfig = ref(null) as Ref<null | App.Http.Resources.GalleryConfigs.PhotoLayoutConfig>;
const layout = ref("square") as Ref<App.Enum.PhotoLayoutType>;

function loadLayoutConfig() {
AlbumService.getLayout().then((data) => {
function loadLayoutConfig(): Promise<void> {
return AlbumService.getLayout().then((data) => {
layoutConfig.value = data.data;
});
}
Expand Down
Loading

0 comments on commit 79edc1d

Please sign in to comment.