Compare commits

..

1 Commits

Author SHA1 Message Date
Daniel Dietzler bb58b3f518 fix: e2e version test 2026-07-01 10:41:18 +02:00
20 changed files with 10 additions and 337 deletions
+8 -6
View File
@@ -91,12 +91,14 @@ describe('/server', () => {
it('should respond with the server version', async () => {
const { status, body } = await request(app).get('/server/version');
expect(status).toBe(200);
expect(body).toEqual({
major: expect.any(Number),
minor: expect.any(Number),
patch: expect.any(Number),
prerelease: expect.anything(),
});
expect(body).toEqual(
expect.objectContaining({
major: expect.any(Number),
minor: expect.any(Number),
patch: expect.any(Number),
}),
);
expect(Object.keys(body)).toEqual(expect.arrayContaining(['major', 'minor', 'patch', 'prerelease']));
});
});
-3
View File
@@ -82,9 +82,6 @@ export const setupBaseMockApiRoutes = async (context: BrowserContext, adminUserI
cast: {
gCastEnabled: false,
},
recentlyAdded: {
sidebarWeb: false,
},
},
});
});
-1
View File
@@ -110,7 +110,6 @@ export async function enableTagsPreference(context: BrowserContext) {
download: { archiveSize: 4_294_967_296, includeEmbeddedVideos: false },
purchase: { showSupportBadge: true, hideBuyButtonUntil: '2100-02-12T00:00:00.000Z' },
cast: { gCastEnabled: false },
recentlyAdded: { sidebarWeb: false },
},
});
});
-1
View File
@@ -1718,7 +1718,6 @@
"recent_searches": "Recent searches",
"recently_added": "Recently added",
"recently_added_body": "Jump straight to everything you've added lately on a dedicated page.",
"recently_added_description": "Browse your assets sorted by when they were uploaded to Immich",
"recently_added_page_title": "Recently Added",
"recently_added_title": "Recently added",
"recently_taken": "Recently taken",
-1
View File
@@ -26,7 +26,6 @@ final Map<String, Map<String, Object?>> openApiPatches = {
'sharedLinks': SharedLinksResponse(enabled: true, sidebarWeb: false).toJson(),
'cast': CastResponse(gCastEnabled: false).toJson(),
'albums': {'defaultAssetOrder': 'desc'},
'recentlyAdded': RecentlyAddedResponse(sidebarWeb: false).toJson(),
},
'ServerConfigDto': {
'mapLightStyleUrl': 'https://tiles.immich.cloud/v1/style/light.json',
-2
View File
@@ -545,8 +545,6 @@ Class | Method | HTTP request | Description
- [RatingsUpdate](doc//RatingsUpdate.md)
- [ReactionLevel](doc//ReactionLevel.md)
- [ReactionType](doc//ReactionType.md)
- [RecentlyAddedResponse](doc//RecentlyAddedResponse.md)
- [RecentlyAddedUpdate](doc//RecentlyAddedUpdate.md)
- [ReleaseChannel](doc//ReleaseChannel.md)
- [ReleaseEventV1](doc//ReleaseEventV1.md)
- [ReleaseType](doc//ReleaseType.md)
-2
View File
@@ -266,8 +266,6 @@ part 'model/ratings_response.dart';
part 'model/ratings_update.dart';
part 'model/reaction_level.dart';
part 'model/reaction_type.dart';
part 'model/recently_added_response.dart';
part 'model/recently_added_update.dart';
part 'model/release_channel.dart';
part 'model/release_event_v1.dart';
part 'model/release_type.dart';
-4
View File
@@ -577,10 +577,6 @@ class ApiClient {
return ReactionLevelTypeTransformer().decode(value);
case 'ReactionType':
return ReactionTypeTypeTransformer().decode(value);
case 'RecentlyAddedResponse':
return RecentlyAddedResponse.fromJson(value);
case 'RecentlyAddedUpdate':
return RecentlyAddedUpdate.fromJson(value);
case 'ReleaseChannel':
return ReleaseChannelTypeTransformer().decode(value);
case 'ReleaseEventV1':
-100
View File
@@ -1,100 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class RecentlyAddedResponse {
/// Returns a new [RecentlyAddedResponse] instance.
RecentlyAddedResponse({
required this.sidebarWeb,
});
/// Whether the recently added page appears in the web sidebar
bool sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is RecentlyAddedResponse &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(sidebarWeb.hashCode);
@override
String toString() => 'RecentlyAddedResponse[sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'sidebarWeb'] = this.sidebarWeb;
return json;
}
/// Returns a new [RecentlyAddedResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RecentlyAddedResponse? fromJson(dynamic value) {
upgradeDto(value, "RecentlyAddedResponse");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RecentlyAddedResponse(
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb')!,
);
}
return null;
}
static List<RecentlyAddedResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RecentlyAddedResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RecentlyAddedResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RecentlyAddedResponse> mapFromJson(dynamic json) {
final map = <String, RecentlyAddedResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RecentlyAddedResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RecentlyAddedResponse-objects as value to a dart map
static Map<String, List<RecentlyAddedResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RecentlyAddedResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RecentlyAddedResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'sidebarWeb',
};
}
-108
View File
@@ -1,108 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class RecentlyAddedUpdate {
/// Returns a new [RecentlyAddedUpdate] instance.
RecentlyAddedUpdate({
this.sidebarWeb = const Optional.absent(),
});
/// Whether the recently added page appears in the web sidebar
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
Optional<bool?> sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is RecentlyAddedUpdate &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(sidebarWeb == null ? 0 : sidebarWeb!.hashCode);
@override
String toString() => 'RecentlyAddedUpdate[sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.sidebarWeb.isPresent) {
final value = this.sidebarWeb.value;
json[r'sidebarWeb'] = value;
}
return json;
}
/// Returns a new [RecentlyAddedUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RecentlyAddedUpdate? fromJson(dynamic value) {
upgradeDto(value, "RecentlyAddedUpdate");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RecentlyAddedUpdate(
sidebarWeb: json.containsKey(r'sidebarWeb') ? Optional.present(mapValueOfType<bool>(json, r'sidebarWeb')) : const Optional.absent(),
);
}
return null;
}
static List<RecentlyAddedUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RecentlyAddedUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RecentlyAddedUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RecentlyAddedUpdate> mapFromJson(dynamic json) {
final map = <String, RecentlyAddedUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RecentlyAddedUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RecentlyAddedUpdate-objects as value to a dart map
static Map<String, List<RecentlyAddedUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RecentlyAddedUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RecentlyAddedUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}
+1 -9
View File
@@ -22,7 +22,6 @@ class UserPreferencesResponseDto {
required this.people,
required this.purchase,
required this.ratings,
required this.recentlyAdded,
required this.sharedLinks,
required this.tags,
});
@@ -45,8 +44,6 @@ class UserPreferencesResponseDto {
RatingsResponse ratings;
RecentlyAddedResponse recentlyAdded;
SharedLinksResponse sharedLinks;
TagsResponse tags;
@@ -62,7 +59,6 @@ class UserPreferencesResponseDto {
other.people == people &&
other.purchase == purchase &&
other.ratings == ratings &&
other.recentlyAdded == recentlyAdded &&
other.sharedLinks == sharedLinks &&
other.tags == tags;
@@ -78,12 +74,11 @@ class UserPreferencesResponseDto {
(people.hashCode) +
(purchase.hashCode) +
(ratings.hashCode) +
(recentlyAdded.hashCode) +
(sharedLinks.hashCode) +
(tags.hashCode);
@override
String toString() => 'UserPreferencesResponseDto[albums=$albums, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, recentlyAdded=$recentlyAdded, sharedLinks=$sharedLinks, tags=$tags]';
String toString() => 'UserPreferencesResponseDto[albums=$albums, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -96,7 +91,6 @@ class UserPreferencesResponseDto {
json[r'people'] = this.people;
json[r'purchase'] = this.purchase;
json[r'ratings'] = this.ratings;
json[r'recentlyAdded'] = this.recentlyAdded;
json[r'sharedLinks'] = this.sharedLinks;
json[r'tags'] = this.tags;
return json;
@@ -120,7 +114,6 @@ class UserPreferencesResponseDto {
people: PeopleResponse.fromJson(json[r'people'])!,
purchase: PurchaseResponse.fromJson(json[r'purchase'])!,
ratings: RatingsResponse.fromJson(json[r'ratings'])!,
recentlyAdded: RecentlyAddedResponse.fromJson(json[r'recentlyAdded'])!,
sharedLinks: SharedLinksResponse.fromJson(json[r'sharedLinks'])!,
tags: TagsResponse.fromJson(json[r'tags'])!,
);
@@ -179,7 +172,6 @@ class UserPreferencesResponseDto {
'people',
'purchase',
'ratings',
'recentlyAdded',
'sharedLinks',
'tags',
};
+1 -17
View File
@@ -23,7 +23,6 @@ class UserPreferencesUpdateDto {
this.people = const Optional.absent(),
this.purchase = const Optional.absent(),
this.ratings = const Optional.absent(),
this.recentlyAdded = const Optional.absent(),
this.sharedLinks = const Optional.absent(),
this.tags = const Optional.absent(),
});
@@ -108,14 +107,6 @@ class UserPreferencesUpdateDto {
///
Optional<RatingsUpdate?> ratings;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
Optional<RecentlyAddedUpdate?> recentlyAdded;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@@ -144,7 +135,6 @@ class UserPreferencesUpdateDto {
other.people == people &&
other.purchase == purchase &&
other.ratings == ratings &&
other.recentlyAdded == recentlyAdded &&
other.sharedLinks == sharedLinks &&
other.tags == tags;
@@ -161,12 +151,11 @@ class UserPreferencesUpdateDto {
(people == null ? 0 : people!.hashCode) +
(purchase == null ? 0 : purchase!.hashCode) +
(ratings == null ? 0 : ratings!.hashCode) +
(recentlyAdded == null ? 0 : recentlyAdded!.hashCode) +
(sharedLinks == null ? 0 : sharedLinks!.hashCode) +
(tags == null ? 0 : tags!.hashCode);
@override
String toString() => 'UserPreferencesUpdateDto[albums=$albums, avatar=$avatar, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, recentlyAdded=$recentlyAdded, sharedLinks=$sharedLinks, tags=$tags]';
String toString() => 'UserPreferencesUpdateDto[albums=$albums, avatar=$avatar, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -210,10 +199,6 @@ class UserPreferencesUpdateDto {
final value = this.ratings.value;
json[r'ratings'] = value;
}
if (this.recentlyAdded.isPresent) {
final value = this.recentlyAdded.value;
json[r'recentlyAdded'] = value;
}
if (this.sharedLinks.isPresent) {
final value = this.sharedLinks.value;
json[r'sharedLinks'] = value;
@@ -244,7 +229,6 @@ class UserPreferencesUpdateDto {
people: json.containsKey(r'people') ? Optional.present(PeopleUpdate.fromJson(json[r'people'])) : const Optional.absent(),
purchase: json.containsKey(r'purchase') ? Optional.present(PurchaseUpdate.fromJson(json[r'purchase'])) : const Optional.absent(),
ratings: json.containsKey(r'ratings') ? Optional.present(RatingsUpdate.fromJson(json[r'ratings'])) : const Optional.absent(),
recentlyAdded: json.containsKey(r'recentlyAdded') ? Optional.present(RecentlyAddedUpdate.fromJson(json[r'recentlyAdded'])) : const Optional.absent(),
sharedLinks: json.containsKey(r'sharedLinks') ? Optional.present(SharedLinksUpdate.fromJson(json[r'sharedLinks'])) : const Optional.absent(),
tags: json.containsKey(r'tags') ? Optional.present(TagsUpdate.fromJson(json[r'tags'])) : const Optional.absent(),
);
-28
View File
@@ -21991,27 +21991,6 @@
],
"type": "string"
},
"RecentlyAddedResponse": {
"properties": {
"sidebarWeb": {
"description": "Whether the recently added page appears in the web sidebar",
"type": "boolean"
}
},
"required": [
"sidebarWeb"
],
"type": "object"
},
"RecentlyAddedUpdate": {
"properties": {
"sidebarWeb": {
"description": "Whether the recently added page appears in the web sidebar",
"type": "boolean"
}
},
"type": "object"
},
"ReleaseChannel": {
"description": "Release channel",
"enum": [
@@ -27546,9 +27525,6 @@
"ratings": {
"$ref": "#/components/schemas/RatingsResponse"
},
"recentlyAdded": {
"$ref": "#/components/schemas/RecentlyAddedResponse"
},
"sharedLinks": {
"$ref": "#/components/schemas/SharedLinksResponse"
},
@@ -27566,7 +27542,6 @@
"people",
"purchase",
"ratings",
"recentlyAdded",
"sharedLinks",
"tags"
],
@@ -27604,9 +27579,6 @@
"ratings": {
"$ref": "#/components/schemas/RatingsUpdate"
},
"recentlyAdded": {
"$ref": "#/components/schemas/RecentlyAddedUpdate"
},
"sharedLinks": {
"$ref": "#/components/schemas/SharedLinksUpdate"
},
-10
View File
@@ -342,10 +342,6 @@ export type RatingsResponse = {
/** Whether ratings are enabled */
enabled: boolean;
};
export type RecentlyAddedResponse = {
/** Whether the recently added page appears in the web sidebar */
sidebarWeb: boolean;
};
export type SharedLinksResponse = {
/** Whether shared links are enabled */
enabled: boolean;
@@ -368,7 +364,6 @@ export type UserPreferencesResponseDto = {
people: PeopleResponse;
purchase: PurchaseResponse;
ratings: RatingsResponse;
recentlyAdded: RecentlyAddedResponse;
sharedLinks: SharedLinksResponse;
tags: TagsResponse;
};
@@ -426,10 +421,6 @@ export type RatingsUpdate = {
/** Whether ratings are enabled */
enabled?: boolean;
};
export type RecentlyAddedUpdate = {
/** Whether the recently added page appears in the web sidebar */
sidebarWeb?: boolean;
};
export type SharedLinksUpdate = {
/** Whether shared links are enabled */
enabled?: boolean;
@@ -453,7 +444,6 @@ export type UserPreferencesUpdateDto = {
people?: PeopleUpdate;
purchase?: PurchaseUpdate;
ratings?: RatingsUpdate;
recentlyAdded?: RecentlyAddedUpdate;
sharedLinks?: SharedLinksUpdate;
tags?: TagsUpdate;
};
-15
View File
@@ -98,13 +98,6 @@ const CastUpdateSchema = z
.optional()
.meta({ id: 'CastUpdate' });
const RecentlyAddedUpdateSchema = z
.object({
sidebarWeb: z.boolean().optional().describe('Whether the recently added page appears in the web sidebar'),
})
.optional()
.meta({ id: 'RecentlyAddedUpdate' });
const UserPreferencesUpdateSchema = z
.object({
albums: AlbumsUpdateSchema,
@@ -119,7 +112,6 @@ const UserPreferencesUpdateSchema = z
ratings: RatingsUpdateSchema,
sharedLinks: SharedLinksUpdateSchema,
tags: TagsUpdateSchema,
recentlyAdded: RecentlyAddedUpdateSchema,
})
.meta({ id: 'UserPreferencesUpdateDto' });
@@ -199,12 +191,6 @@ const CastResponseSchema = z
})
.meta({ id: 'CastResponse' });
const RecentlyAddedResponseSchema = z
.object({
sidebarWeb: z.boolean().describe('Whether the recently added page appears in the web sidebar'),
})
.meta({ id: 'RecentlyAddedResponse' });
const UserPreferencesResponseSchema = z
.object({
albums: AlbumsResponseSchema,
@@ -218,7 +204,6 @@ const UserPreferencesResponseSchema = z
download: DownloadResponseSchema,
purchase: PurchaseResponseSchema,
cast: CastResponseSchema,
recentlyAdded: RecentlyAddedResponseSchema,
})
.meta({ id: 'UserPreferencesResponseDto' });
-3
View File
@@ -619,9 +619,6 @@ export type UserPreferences = {
cast: {
gCastEnabled: boolean;
};
recentlyAdded: {
sidebarWeb: boolean;
};
};
export type UserMetadataItem<T extends keyof UserMetadata = UserMetadataKey> = {
-3
View File
@@ -50,9 +50,6 @@ const getDefaultPreferences = (): UserPreferences => {
cast: {
gCastEnabled: false,
},
recentlyAdded: {
sidebarWeb: false,
},
};
};
@@ -31,7 +31,6 @@
mdiToolboxOutline,
mdiTrashCan,
mdiTrashCanOutline,
mdiUploadOutline,
} from '@mdi/js';
import { t } from 'svelte-i18n';
import { fly } from 'svelte/transition';
@@ -84,14 +83,6 @@
<NavbarItem title={$t('tags')} href={Route.tags()} icon={{ icon: mdiTagMultipleOutline, flipped: true }} />
{/if}
{#if authManager.preferences.recentlyAdded.sidebarWeb}
<NavbarItem
title={$t('recently_added')}
href={Route.recentlyAdded()}
icon={{ icon: mdiUploadOutline, flipped: true }}
/>
{/if}
{#if authManager.preferences.folders.enabled && authManager.preferences.folders.sidebarWeb}
<NavbarItem title={$t('folders')} href={Route.folders()} icon={{ icon: mdiFolderOutline, flipped: true }} />
{/if}
@@ -38,9 +38,6 @@
// Cast
let gCastEnabled = $state(authManager.preferences.cast?.gCastEnabled ?? false);
// Recently added
let recentlyAddedSidebar = $state(authManager.preferences.recentlyAdded?.sidebarWeb ?? false);
const handleSave = async () => {
try {
const response = await updateMyPreferences({
@@ -53,7 +50,6 @@
sharedLinks: { enabled: sharedLinksEnabled, sidebarWeb: sharedLinkSidebar },
tags: { enabled: tagsEnabled, sidebarWeb: tagsSidebar },
cast: { gCastEnabled },
recentlyAdded: { sidebarWeb: recentlyAddedSidebar },
},
});
@@ -174,14 +170,6 @@
</div>
</SettingAccordion>
<SettingAccordion key="recentlyAdded" title={$t('recently_added')} subtitle={$t('recently_added_description')}>
<div class="mt-4 flex flex-col gap-4 sm:ms-4">
<Field label={$t('sidebar')} description={$t('sidebar_display_description')}>
<Switch bind:checked={recentlyAddedSidebar} />
</Field>
</div>
</SettingAccordion>
<div class="mt-4 flex justify-end">
<Button shape="round" type="submit" size="small" onclick={() => handleSave()}>{$t('save')}</Button>
</div>
@@ -44,7 +44,4 @@ export const preferencesFactory = Sync.makeFactory<UserPreferencesResponseDto>({
enabled: false,
sidebarWeb: false,
},
recentlyAdded: {
sidebarWeb: false,
},
});