forked from Archives/Athou_commafeed
add button in the header to star entry (#1025)
This commit is contained in:
@@ -39,6 +39,10 @@ public class UserSettings extends AbstractModel {
|
||||
always, never, if_needed
|
||||
}
|
||||
|
||||
public enum IconDisplayMode {
|
||||
always, never, on_desktop, on_mobile
|
||||
}
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "user_id", nullable = false, unique = true)
|
||||
private User user;
|
||||
@@ -74,6 +78,14 @@ public class UserSettings extends AbstractModel {
|
||||
@Column(nullable = false)
|
||||
private ScrollMode scrollMode;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(nullable = false)
|
||||
private IconDisplayMode starIconDisplayMode;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(nullable = false)
|
||||
private IconDisplayMode externalLinkIconDisplayMode;
|
||||
|
||||
private boolean markAllAsReadConfirmation;
|
||||
private boolean customContextMenu;
|
||||
private boolean mobileFooter;
|
||||
|
||||
@@ -47,6 +47,18 @@ public class Settings implements Serializable {
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private String scrollMode;
|
||||
|
||||
@Schema(
|
||||
description = "whether to show the star icon in the header of entries",
|
||||
allowableValues = "always,never,on_desktop,on_mobile",
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private String starIconDisplayMode;
|
||||
|
||||
@Schema(
|
||||
description = "whether to show the external link icon in the header of entries",
|
||||
allowableValues = "always,never,on_desktop,on_mobile",
|
||||
requiredMode = RequiredMode.REQUIRED)
|
||||
private String externalLinkIconDisplayMode;
|
||||
|
||||
@Schema(description = "ask for confirmation when marking all entries as read", requiredMode = RequiredMode.REQUIRED)
|
||||
private boolean markAllAsReadConfirmation;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.commafeed.backend.model.User;
|
||||
import com.commafeed.backend.model.UserRole;
|
||||
import com.commafeed.backend.model.UserRole.Role;
|
||||
import com.commafeed.backend.model.UserSettings;
|
||||
import com.commafeed.backend.model.UserSettings.IconDisplayMode;
|
||||
import com.commafeed.backend.model.UserSettings.ReadingMode;
|
||||
import com.commafeed.backend.model.UserSettings.ReadingOrder;
|
||||
import com.commafeed.backend.model.UserSettings.ScrollMode;
|
||||
@@ -110,6 +111,8 @@ public class UserREST {
|
||||
s.setLanguage(settings.getLanguage());
|
||||
s.setScrollSpeed(settings.getScrollSpeed());
|
||||
s.setScrollMode(settings.getScrollMode().name());
|
||||
s.setStarIconDisplayMode(settings.getStarIconDisplayMode().name());
|
||||
s.setExternalLinkIconDisplayMode(settings.getExternalLinkIconDisplayMode().name());
|
||||
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
||||
s.setCustomContextMenu(settings.isCustomContextMenu());
|
||||
s.setMobileFooter(settings.isMobileFooter());
|
||||
@@ -131,6 +134,8 @@ public class UserREST {
|
||||
s.setLanguage("en");
|
||||
s.setScrollSpeed(400);
|
||||
s.setScrollMode(ScrollMode.if_needed.name());
|
||||
s.setStarIconDisplayMode(IconDisplayMode.always.name());
|
||||
s.setExternalLinkIconDisplayMode(IconDisplayMode.always.name());
|
||||
s.setMarkAllAsReadConfirmation(true);
|
||||
s.setCustomContextMenu(true);
|
||||
s.setMobileFooter(false);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
|
||||
|
||||
<changeSet id="add-icon-display-modes" author="athou">
|
||||
<addColumn tableName="USERSETTINGS">
|
||||
<column name="starIconDisplayMode" type="VARCHAR(32)" value="always">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
<column name="externalLinkIconDisplayMode" type="VARCHAR(32)" value="always">
|
||||
<constraints nullable="false" />
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -30,5 +30,6 @@
|
||||
<include file="changelogs/db.changelog-4.1.xml" />
|
||||
<include file="changelogs/db.changelog-4.2.xml" />
|
||||
<include file="changelogs/db.changelog-4.3.xml" />
|
||||
<include file="changelogs/db.changelog-4.4.xml" />
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user