Skip to content

Commit eb57af8

Browse files
authored
Fix showstopper bugs in v1.18.0 (#2399)
- Fix issue with hardcover toggle not being selectable - Resolve syncing problem with Booklore toggle - Address CSS warnings for cleaner styling Co-authored-by: acx10 <acx10@users.noreply.github.com>
1 parent d137055 commit eb57af8

File tree

16 files changed

+40
-54
lines changed

16 files changed

+40
-54
lines changed

.github/workflows/draft-release.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

booklore-api/src/main/java/com/adityachandel/booklore/model/dto/KoreaderUser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ public class KoreaderUser {
1212
private String password;
1313
private String passwordMD5;
1414
private boolean syncEnabled;
15+
private boolean syncWithBookloreReader;
1516
}

booklore-api/src/test/java/com/adityachandel/booklore/controller/KoreaderUserControllerTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
import com.adityachandel.booklore.service.koreader.KoreaderUserService;
55
import org.junit.jupiter.api.BeforeEach;
66
import org.junit.jupiter.api.Test;
7-
import org.mockito.*;
7+
import org.mockito.InjectMocks;
8+
import org.mockito.Mock;
9+
import org.mockito.MockitoAnnotations;
810
import org.springframework.http.HttpStatus;
911
import org.springframework.http.ResponseEntity;
1012

1113
import java.util.Map;
1214

13-
import static org.junit.jupiter.api.Assertions.*;
14-
import static org.mockito.Mockito.*;
15+
import static org.junit.jupiter.api.Assertions.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertNull;
17+
import static org.mockito.Mockito.doNothing;
18+
import static org.mockito.Mockito.when;
1519

1620
class KoreaderUserControllerTest {
1721

@@ -26,7 +30,7 @@ class KoreaderUserControllerTest {
2630
@BeforeEach
2731
void setUp() {
2832
try (AutoCloseable mocks = MockitoAnnotations.openMocks(this)) {
29-
user = new KoreaderUser(1L, "testuser", "pass", "md5", true);
33+
user = new KoreaderUser(1L, "testuser", "pass", "md5", true, true);
3034
} catch (Exception e) {
3135
throw new RuntimeException(e);
3236
}

booklore-api/src/test/java/com/adityachandel/booklore/service/KoreaderUserServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void init() {
5353
entity.setBookLoreUser(ownerEntity);
5454
entity.setUsername("kvUser");
5555

56-
dto = new KoreaderUser(10L, "kvUser", null, null, false);
56+
dto = new KoreaderUser(10L, "kvUser", null, null, false, true);
5757
when(koreaderUserMapper.toDto(any(KoreaderUserEntity.class))).thenReturn(dto);
5858
}
5959

@@ -69,7 +69,7 @@ void upsertUser_createsNew_whenAbsent() {
6969

7070
when(koreaderUserMapper.toDto(any(KoreaderUserEntity.class))).thenAnswer(invocation -> {
7171
KoreaderUserEntity u = invocation.getArgument(0);
72-
return new KoreaderUser(u.getId(), u.getUsername(), u.getPassword(), u.getPasswordMD5(), u.isSyncEnabled());
72+
return new KoreaderUser(u.getId(), u.getUsername(), u.getPassword(), u.getPasswordMD5(), u.isSyncEnabled(), u.isSyncWithBookloreReader());
7373
});
7474

7575
KoreaderUser result = service.upsertUser("userA", "passA");

booklore-ui/src/app/features/readers/cbx-reader/layout/footer/cbx-footer.component.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:color';
2+
13
// Variables
24
$footer-bg: #1a1a1a;
35
$text-primary: rgba(255, 255, 255, 0.95);
@@ -95,7 +97,7 @@ $transition-fast: 150ms ease;
9597
}
9698

9799
&:hover:not(:disabled) {
98-
background: darken($active-color, 10%);
100+
background: color.adjust($active-color, $lightness: -10%);
99101
}
100102

101103
&:disabled {
@@ -289,7 +291,7 @@ $transition-fast: 150ms ease;
289291
transition: all 0.2s ease;
290292

291293
&:hover:not(:disabled) {
292-
background: darken($active-color, 10%);
294+
background: color.adjust($active-color, $lightness: -10%);
293295
}
294296

295297
&:disabled {

booklore-ui/src/app/features/readers/cbx-reader/layout/quick-settings/cbx-quick-settings.component.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:color';
2+
13
// Variables
24
$panel-bg: #1a1a1a;
35
$text-primary: rgba(255, 255, 255, 0.95);
@@ -134,7 +136,7 @@ $transition-normal: 200ms ease;
134136
background: rgba(255, 255, 255, 0.2);
135137

136138
&.active {
137-
background: lighten($active-color, 5%);
139+
background: color.adjust($active-color, $lightness: 5%);
138140
}
139141
}
140142
}

booklore-ui/src/app/features/settings/global-preferences/metadata-provider-settings/metadata-provider-settings.component.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,21 @@ <h4 class="provider-group-title">Providers with Configuration</h4>
7777
</p-toggleswitch>
7878
<label class="setting-label">Hardcover</label>
7979
</div>
80-
@if (hardcoverEnabled) {
81-
<div class="setting-options">
82-
<div class="config-field">
83-
<div class="config-label-row">
84-
<label class="config-label">API Token</label>
85-
<app-external-doc-link docType="hardcover"></app-external-doc-link>
86-
</div>
87-
<input
88-
type="text"
89-
pInputText
90-
placeholder="Enter Hardcover API token"
91-
[(ngModel)]="hardcoverToken"
92-
(ngModelChange)="onTokenChange($event)"
93-
class="config-input"/>
80+
<div class="setting-options">
81+
<div class="config-field">
82+
<div class="config-label-row">
83+
<label class="config-label">API Token</label>
84+
<app-external-doc-link docType="hardcover"></app-external-doc-link>
9485
</div>
86+
<input
87+
type="text"
88+
pInputText
89+
placeholder="Enter Hardcover API token"
90+
[(ngModel)]="hardcoverToken"
91+
(ngModelChange)="onTokenChange($event)"
92+
class="config-input"/>
9593
</div>
96-
}
94+
</div>
9795
</div>
9896

9997
<div class="setting-item">

booklore-ui/src/app/features/stats/component/library-stats/charts/author-universe-chart/author-universe-chart.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../_chart-shared';
1+
@use '../../../_chart-shared';
22

33
.author-universe-container {
44
width: 100%;

booklore-ui/src/app/features/stats/component/library-stats/charts/book-formats-chart/book-formats-chart.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../_chart-shared';
1+
@use '../../../_chart-shared';
22

33
.book-formats-container {
44
width: 100%;

booklore-ui/src/app/features/stats/component/library-stats/charts/language-chart/language-chart.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../_chart-shared';
1+
@use '../../../_chart-shared';
22

33
.language-chart-container {
44
width: 100%;

0 commit comments

Comments
 (0)