mirror of
https://github.com/booklore-app/booklore.git
synced 2026-02-18 00:17:53 +01:00
feat(sort): replace compound sort options with atomic fields and multi-sort support (#2686)
* fix(sidebar): replace routerLinkActive with getter-based route matching to prevent stale highlights * feat(sort): replace compound sort options with atomic fields and add 6 new sort criteria
This commit is contained in:
@@ -61,6 +61,8 @@ public class BookLoreUserTransformer {
|
||||
case DASHBOARD_CONFIG -> userSettings.setDashboardConfig(objectMapper.readValue(value, BookLoreUser.UserSettings.DashboardConfig.class));
|
||||
case VISIBLE_FILTERS -> userSettings.setVisibleFilters(objectMapper.readValue(value, new TypeReference<>() {
|
||||
}));
|
||||
case VISIBLE_SORT_FIELDS -> userSettings.setVisibleSortFields(objectMapper.readValue(value, new TypeReference<>() {
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
switch (settingKey) {
|
||||
|
||||
@@ -78,6 +78,7 @@ public class BookLoreUser {
|
||||
public boolean enableSeriesView;
|
||||
public boolean autoSaveMetadata;
|
||||
public List<String> visibleFilters;
|
||||
public List<String> visibleSortFields;
|
||||
public DashboardConfig dashboardConfig;
|
||||
|
||||
@Data
|
||||
@@ -107,6 +108,7 @@ public class BookLoreUser {
|
||||
public static class GlobalPreferences {
|
||||
private String sortKey;
|
||||
private String sortDir;
|
||||
private List<SortCriterion> sortCriteria;
|
||||
private String view;
|
||||
private Float coverSize;
|
||||
@JsonAlias("seriesCollapse")
|
||||
@@ -131,10 +133,21 @@ public class BookLoreUser {
|
||||
public static class OverrideDetails {
|
||||
private String sortKey;
|
||||
private String sortDir;
|
||||
private List<SortCriterion> sortCriteria;
|
||||
private String view;
|
||||
@JsonAlias("seriesCollapse")
|
||||
private Boolean seriesCollapsed;
|
||||
private Boolean overlayBookType;
|
||||
private Float coverSize;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class SortCriterion {
|
||||
private String field;
|
||||
private String direction;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -23,7 +23,8 @@ public enum UserSettingKey {
|
||||
HARDCOVER_API_KEY("hardcoverApiKey", false),
|
||||
HARDCOVER_SYNC_ENABLED("hardcoverSyncEnabled", false),
|
||||
AUTO_SAVE_METADATA("autoSaveMetadata", false),
|
||||
VISIBLE_FILTERS("visibleFilters", true);
|
||||
VISIBLE_FILTERS("visibleFilters", true),
|
||||
VISIBLE_SORT_FIELDS("visibleSortFields", true);
|
||||
|
||||
|
||||
private final String dbKey;
|
||||
|
||||
Reference in New Issue
Block a user