OPDS v2 fixes
This commit is contained in:
@@ -15,6 +15,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(opdsEnabledInterceptor)
|
||||
.addPathPatterns("/api/v1/opds/**");
|
||||
.addPathPatterns("/api/v1/opds/**", "/api/v2/opds/**");
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -56,7 +56,8 @@ public class SecurityConfig {
|
||||
};
|
||||
|
||||
private static final String[] COMMON_UNAUTHENTICATED_ENDPOINTS = {
|
||||
"/api/v1/opds/search.opds"
|
||||
"/api/v1/opds/search.opds",
|
||||
"/api/v2/opds/search.opds"
|
||||
};
|
||||
|
||||
@Bean
|
||||
@@ -69,7 +70,7 @@ public class SecurityConfig {
|
||||
public SecurityFilterChain opdsBasicAuthSecurityChain(HttpSecurity http) throws Exception {
|
||||
List<String> unauthenticatedEndpoints = new ArrayList<>(Arrays.asList(COMMON_UNAUTHENTICATED_ENDPOINTS));
|
||||
http
|
||||
.securityMatcher("/api/v1/opds/**")
|
||||
.securityMatcher("/api/v1/opds/**", "/api/v2/opds/**")
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
@@ -84,6 +85,7 @@ public class SecurityConfig {
|
||||
response.getWriter().write("HTTP Status 401 - " + authException.getMessage());
|
||||
})
|
||||
);
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -46,6 +46,7 @@ public class DualJwtAuthenticationFilter extends OncePerRequestFilter {
|
||||
|
||||
private static final List<String> WHITELISTED_PATHS = List.of(
|
||||
"/api/v1/opds/",
|
||||
"/api/v2/opds/",
|
||||
"/api/v1/auth/refresh",
|
||||
"/api/v1/setup/",
|
||||
"/api/kobo/"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/opds")
|
||||
@RequestMapping({"/api/v1/opds", "/api/v2/opds"})
|
||||
@RequiredArgsConstructor
|
||||
public class OpdsController {
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class GlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(DataIntegrityViolationException.class)
|
||||
public ResponseEntity<ErrorResponse> handleDataIntegrityViolation(DataIntegrityViolationException ex) {
|
||||
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.BAD_REQUEST.value(), "Data integrity violation: " + ex.getMessage());
|
||||
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.BAD_REQUEST.value(), ex.getMessage());
|
||||
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ public class OpdsEnabledInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
if (request.getRequestURI().startsWith("/api/v1/opds")) {
|
||||
String uri = request.getRequestURI();
|
||||
if (uri.startsWith("/api/v1/opds") || uri.startsWith("/api/v2/opds")) {
|
||||
if (!appSettingService.getAppSettings().isOpdsServerEnabled()) {
|
||||
response.sendError(HttpServletResponse.SC_FORBIDDEN, "OPDS Server is disabled.");
|
||||
return false;
|
||||
|
||||
+19
-8
@@ -10,6 +10,7 @@ import com.adityachandel.booklore.model.entity.OpdsUserV2Entity;
|
||||
import com.adityachandel.booklore.repository.OpdsUserV2Repository;
|
||||
import com.adityachandel.booklore.repository.UserRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
@@ -35,14 +36,24 @@ public class OpdsUserV2Service {
|
||||
}
|
||||
|
||||
public OpdsUserV2 createOpdsUser(OpdsUserV2CreateRequest request) {
|
||||
BookLoreUser bookLoreUser = authenticationService.getAuthenticatedUser();
|
||||
BookLoreUserEntity userEntity = userRepository.findById(bookLoreUser.getId()).orElseThrow(() -> new UsernameNotFoundException("User not found with ID: " + bookLoreUser.getId()));
|
||||
OpdsUserV2Entity opdsUserV2 = OpdsUserV2Entity.builder()
|
||||
.user(userEntity)
|
||||
.username(request.getUsername())
|
||||
.passwordHash(passwordEncoder.encode(request.getPassword()))
|
||||
.build();
|
||||
return mapper.toDto(opdsUserV2Repository.save(opdsUserV2));
|
||||
try {
|
||||
BookLoreUser bookLoreUser = authenticationService.getAuthenticatedUser();
|
||||
BookLoreUserEntity userEntity = userRepository.findById(bookLoreUser.getId())
|
||||
.orElseThrow(() -> new UsernameNotFoundException("User not found with ID: " + bookLoreUser.getId()));
|
||||
|
||||
OpdsUserV2Entity opdsUserV2 = OpdsUserV2Entity.builder()
|
||||
.user(userEntity)
|
||||
.username(request.getUsername())
|
||||
.passwordHash(passwordEncoder.encode(request.getPassword()))
|
||||
.build();
|
||||
|
||||
return mapper.toDto(opdsUserV2Repository.save(opdsUserV2));
|
||||
} catch (DataIntegrityViolationException e) {
|
||||
if (e.getMostSpecificCause().getMessage().contains("uq_username")) {
|
||||
throw new DataIntegrityViolationException("Username '" + request.getUsername() + "' is already taken");
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteOpdsUser(Long userId) {
|
||||
|
||||
+23
-13
@@ -33,7 +33,7 @@ public class OpdsService {
|
||||
String feedVersion = extractVersionFromAcceptHeader(request);
|
||||
return switch (feedVersion) {
|
||||
case "2.0" -> generateOpdsV2Feed(books);
|
||||
default -> generateOpdsV1Feed(books);
|
||||
default -> generateOpdsV1Feed(books, request);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class OpdsService {
|
||||
String feedVersion = extractVersionFromAcceptHeader(request);
|
||||
return switch (feedVersion) {
|
||||
case "2.0" -> generateOpdsV2Feed(books);
|
||||
default -> generateOpdsV1Feed(books);
|
||||
default -> generateOpdsV1Feed(books, request);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,29 +109,31 @@ public class OpdsService {
|
||||
""";
|
||||
}
|
||||
|
||||
private String generateOpdsV1Feed(List<Book> books) {
|
||||
private String generateOpdsV1Feed(List<Book> books, HttpServletRequest request) {
|
||||
String version = extractVersionFromRequest(request); // v1 or v2
|
||||
var feed = new StringBuilder("""
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/terms/">
|
||||
<title>Booklore Catalog</title>
|
||||
<id>urn:booklore:catalog</id>
|
||||
<updated>%s</updated>
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="Booklore Search" href="/api/v1/opds/search.opds"/>
|
||||
""".formatted(now()));
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="Booklore Search" href="/api/%s/opds/search.opds"/>
|
||||
""".formatted(now(), version));
|
||||
|
||||
books.forEach(book -> appendBookEntryV1(feed, book));
|
||||
books.forEach(book -> appendBookEntryV1(feed, book, version));
|
||||
|
||||
feed.append("</feed>");
|
||||
return feed.toString();
|
||||
}
|
||||
|
||||
private void appendBookEntryV1(StringBuilder feed, Book book) {
|
||||
private void appendBookEntryV1(StringBuilder feed, Book book, String version) {
|
||||
feed.append("""
|
||||
<entry>
|
||||
<title>%s</title>
|
||||
<id>urn:booklore:book:%d</id>
|
||||
<updated>%s</updated>
|
||||
""".formatted(escapeXml(book.getMetadata().getTitle()), book.getId(), book.getAddedOn() != null ? book.getAddedOn() : now()));
|
||||
""".formatted(escapeXml(book.getMetadata().getTitle()), book.getId(),
|
||||
book.getAddedOn() != null ? book.getAddedOn() : now()));
|
||||
|
||||
book.getMetadata().getAuthors().forEach(author -> feed.append("""
|
||||
<author>
|
||||
@@ -139,11 +141,13 @@ public class OpdsService {
|
||||
</author>
|
||||
""".formatted(escapeXml(author))));
|
||||
|
||||
appendOptionalTags(feed, book);
|
||||
appendOptionalTags(feed, book, version);
|
||||
feed.append(" </entry>");
|
||||
}
|
||||
|
||||
private void appendOptionalTags(StringBuilder feed, Book book) {
|
||||
private void appendOptionalTags(StringBuilder feed, Book book, String version) {
|
||||
String basePath = "/api/" + version + "/opds/";
|
||||
|
||||
if (book.getMetadata().getPublisher() != null) {
|
||||
feed.append("<dc:publisher>").append(escapeXml(book.getMetadata().getPublisher())).append("</dc:publisher>");
|
||||
}
|
||||
@@ -166,12 +170,14 @@ public class OpdsService {
|
||||
feed.append("<published>").append(book.getMetadata().getPublishedDate()).append("</published>");
|
||||
}
|
||||
|
||||
// download link
|
||||
feed.append("""
|
||||
<link href="/api/v1/opds/%d/download" rel="http://opds-spec.org/acquisition" type="application/%s"/>
|
||||
""".formatted(book.getId(), fileMimeType(book)));
|
||||
<link href="%s%d/download" rel="http://opds-spec.org/acquisition" type="application/%s"/>
|
||||
""".formatted(basePath, book.getId(), fileMimeType(book)));
|
||||
|
||||
// cover link
|
||||
if (book.getMetadata().getCoverUpdatedOn() != null) {
|
||||
String coverPath = "/api/v1/opds/" + book.getId() + "/cover?" + book.getMetadata().getCoverUpdatedOn();
|
||||
String coverPath = basePath + book.getId() + "/cover?" + book.getMetadata().getCoverUpdatedOn();
|
||||
feed.append("""
|
||||
<link rel="http://opds-spec.org/image" href="%s" type="image/jpeg"/>
|
||||
<link rel="http://opds-spec.org/image/thumbnail" href="%s" type="image/jpeg"/>
|
||||
@@ -217,4 +223,8 @@ public class OpdsService {
|
||||
.replace("\"", """)
|
||||
.replace("'", "'");
|
||||
}
|
||||
|
||||
private String extractVersionFromRequest(HttpServletRequest request) {
|
||||
return (request.getRequestURI() != null && request.getRequestURI().startsWith("/api/v2/opds")) ? "v2" : "v1";
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
ALTER TABLE opds_user_v2
|
||||
DROP FOREIGN KEY fk_opds_user;
|
||||
ALTER TABLE opds_user_v2
|
||||
DROP INDEX uq_userid_username;
|
||||
ALTER TABLE opds_user_v2
|
||||
ADD CONSTRAINT uq_username UNIQUE (username);
|
||||
ALTER TABLE opds_user_v2
|
||||
ADD CONSTRAINT fk_opds_user FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE;
|
||||
+48
-1
@@ -47,6 +47,7 @@ class OpdsServiceTest {
|
||||
when(details.getOpdsUser()).thenReturn(mock(OpdsUser.class));
|
||||
|
||||
when(request.getHeader("Accept")).thenReturn(null);
|
||||
when(request.getRequestURI()).thenReturn("/opds/catalog");
|
||||
when(bookQueryService.getAllBooks(true)).thenReturn(List.of()); // minimal stub
|
||||
|
||||
String feed = service.generateCatalogFeed(request);
|
||||
@@ -74,6 +75,7 @@ class OpdsServiceTest {
|
||||
|
||||
when(bookQueryService.searchBooksByMetadata("query")).thenReturn(List.of(book));
|
||||
when(request.getHeader("Accept")).thenReturn(null);
|
||||
when(request.getRequestURI()).thenReturn("/opds/search");
|
||||
|
||||
String feed = service.generateSearchResults(request, "query");
|
||||
|
||||
@@ -104,14 +106,51 @@ class OpdsServiceTest {
|
||||
when(userDto.getPermissions()).thenReturn(dtoPerms);
|
||||
when(bookLoreUserTransformer.toDTO(entity)).thenReturn(userDto);
|
||||
|
||||
// Accept header drives v2 selection; do not stub request.getRequestURI() (unused here)
|
||||
when(request.getHeader("Accept")).thenReturn("application/opds+json;version=2.0");
|
||||
// stub the backend call exercised by getAllowedBooks for admin + no query
|
||||
when(bookQueryService.getAllBooks(true)).thenReturn(List.of());
|
||||
|
||||
String feed = service.generateCatalogFeed(request);
|
||||
|
||||
assertEquals("OPDS v2.0 Feed is under construction", feed);
|
||||
verify(bookQueryService).getAllBooks(true);
|
||||
verify(userRepository).findById(9L);
|
||||
verify(bookQueryService).getAllBooks(true);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void generateSearchResults_opdsV2_callsSearch_and_returnsV2Placeholder() {
|
||||
// Setup v2 user (admin) so getAllowedBooks will call searchBooksByMetadata(query)
|
||||
OpdsUserDetails details = mock(OpdsUserDetails.class);
|
||||
when(authenticationService.getOpdsUser()).thenReturn(details);
|
||||
when(details.getOpdsUser()).thenReturn(null);
|
||||
|
||||
OpdsUserV2 opdsUserV2 = mock(OpdsUserV2.class);
|
||||
when(details.getOpdsUserV2()).thenReturn(opdsUserV2);
|
||||
when(opdsUserV2.getUserId()).thenReturn(9L);
|
||||
|
||||
BookLoreUserEntity entity = mock(BookLoreUserEntity.class, RETURNS_DEEP_STUBS);
|
||||
when(entity.getPermissions().isPermissionAccessOpds()).thenReturn(true);
|
||||
when(userRepository.findById(9L)).thenReturn(Optional.of(entity));
|
||||
|
||||
BookLoreUser userDto = mock(BookLoreUser.class);
|
||||
BookLoreUser.UserPermissions dtoPerms = mock(BookLoreUser.UserPermissions.class);
|
||||
when(dtoPerms.isAdmin()).thenReturn(true);
|
||||
when(userDto.getPermissions()).thenReturn(dtoPerms);
|
||||
when(bookLoreUserTransformer.toDTO(entity)).thenReturn(userDto);
|
||||
|
||||
// Accept header drives v2 selection; do not stub request.getRequestURI()
|
||||
when(request.getHeader("Accept")).thenReturn("application/opds+json;version=2.0");
|
||||
|
||||
// getAllowedBooks will invoke searchBooksByMetadata for admin + query
|
||||
when(bookQueryService.searchBooksByMetadata("query")).thenReturn(List.of(mock(Book.class)));
|
||||
|
||||
String feed = service.generateSearchResults(request, "query");
|
||||
|
||||
assertEquals("OPDS v2.0 Feed is under construction", feed);
|
||||
verify(userRepository).findById(9L);
|
||||
verify(bookQueryService).searchBooksByMetadata("query");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -141,6 +180,7 @@ class OpdsServiceTest {
|
||||
when(bookLoreUserTransformer.toDTO(entity)).thenReturn(userDto);
|
||||
|
||||
when(request.getHeader("Accept")).thenReturn(null); // v1 default; feed version not relevant for allowed-books logic
|
||||
when(request.getRequestURI()).thenReturn("/opds/catalog");
|
||||
when(bookQueryService.getAllBooksByLibraryIds(Set.of(7L), true)).thenReturn(List.of());
|
||||
|
||||
String feed = service.generateCatalogFeed(request);
|
||||
@@ -166,4 +206,11 @@ class OpdsServiceTest {
|
||||
assertTrue(ex.getMessage().contains("User not found"));
|
||||
verify(userRepository).findById(42L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateSearchDescription_opdsV2_returnsV2Placeholder() {
|
||||
when(request.getHeader("Accept")).thenReturn("application/opds+json;version=2.0");
|
||||
String desc = service.generateSearchDescription(request);
|
||||
assertEquals("OPDS v2.0 Feed is under construction", desc);
|
||||
}
|
||||
}
|
||||
+12
-8
@@ -13,7 +13,7 @@
|
||||
</i>
|
||||
</h2>
|
||||
<p class="settings-description">
|
||||
Configure KOReader integration to sync your reading progress and annotations between your device and Booklore library.
|
||||
Configure KOReader integration to sync your reading progress between your device and Booklore library.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</p-toggle-switch>
|
||||
</div>
|
||||
<p class="setting-description">
|
||||
Turn on synchronization to automatically sync your reading progress and annotations.
|
||||
Turn on synchronization to automatically sync your reading progress.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,9 +103,11 @@
|
||||
<p class="setting-description">
|
||||
Your username for authenticating with the KOReader sync service.
|
||||
</p>
|
||||
<small *ngIf="editMode && usernameModel.invalid && usernameModel.touched" class="error-message">
|
||||
Username is required.
|
||||
</small>
|
||||
@if (editMode && usernameModel.invalid && usernameModel.touched) {
|
||||
<small class="error-message">
|
||||
Username is required.
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -145,9 +147,11 @@
|
||||
<p class="setting-description">
|
||||
Your password for authenticating with the KOReader sync service.
|
||||
</p>
|
||||
<small *ngIf="editMode && passwordModel.invalid && passwordModel.touched" class="error-message">
|
||||
Password must be at least 6 characters.
|
||||
</small>
|
||||
@if (editMode && passwordModel.invalid && passwordModel.touched) {
|
||||
<small class="error-message">
|
||||
Password must be at least 6 characters.
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,32 +28,32 @@ import {Password} from 'primeng/password';
|
||||
TableModule,
|
||||
Password
|
||||
],
|
||||
providers: [ConfirmationService, MessageService],
|
||||
providers: [ConfirmationService],
|
||||
templateUrl: './opds-settings-v2.html',
|
||||
styleUrl: './opds-settings-v2.scss'
|
||||
})
|
||||
export class OpdsSettingsV2 implements OnInit, OnDestroy {
|
||||
|
||||
opdsEndpoint = `${API_CONFIG.BASE_URL}/api/v1/opds/catalog`;
|
||||
|
||||
|
||||
opdsEndpoint = `${API_CONFIG.BASE_URL}/api/v2/opds/catalog`;
|
||||
|
||||
private opdsService = inject(OpdsV2Service);
|
||||
private confirmationService = inject(ConfirmationService);
|
||||
private messageService = inject(MessageService);
|
||||
private userService = inject(UserService);
|
||||
|
||||
|
||||
users: OpdsUserV2[] = [];
|
||||
loading = false;
|
||||
showCreateUserDialog = false;
|
||||
newUser: OpdsUserV2CreateRequest = {username: '', password: ''};
|
||||
passwordVisibility: boolean[] = [];
|
||||
hasPermission = false;
|
||||
|
||||
|
||||
private readonly destroy$ = new Subject<void>();
|
||||
dummyPassword: string = "***********************";
|
||||
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loading = true;
|
||||
|
||||
|
||||
this.userService.userState$.pipe(
|
||||
filter(state => !!state?.user && state.loaded),
|
||||
takeUntil(this.destroy$),
|
||||
@@ -64,7 +64,7 @@ export class OpdsSettingsV2 implements OnInit, OnDestroy {
|
||||
tap(() => this.loadUsers())
|
||||
).subscribe();
|
||||
}
|
||||
|
||||
|
||||
private loadUsers(): void {
|
||||
this.opdsService.getUser().pipe(
|
||||
takeUntil(this.destroy$),
|
||||
@@ -79,25 +79,26 @@ export class OpdsSettingsV2 implements OnInit, OnDestroy {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createUser(): void {
|
||||
if (!this.newUser.username || !this.newUser.password) return;
|
||||
|
||||
|
||||
this.opdsService.createUser(this.newUser).pipe(
|
||||
takeUntil(this.destroy$),
|
||||
catchError(err => {
|
||||
takeUntil(this.destroy$)
|
||||
).subscribe({
|
||||
next: user => {
|
||||
this.users.push(user);
|
||||
this.resetCreateUserDialog();
|
||||
this.showMessage('success', 'Success', 'User created successfully');
|
||||
},
|
||||
error: err => {
|
||||
console.error('Error creating user:', err);
|
||||
this.showMessage('error', 'Error', 'Failed to create user');
|
||||
return of(null);
|
||||
})
|
||||
).subscribe(user => {
|
||||
if (!user) return;
|
||||
this.users.push(user);
|
||||
this.resetCreateUserDialog();
|
||||
this.showMessage('success', 'Success', 'User created successfully');
|
||||
const message = err?.error?.message || 'Failed to create user';
|
||||
this.showMessage('error', 'Error', message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
confirmDelete(user: OpdsUserV2): void {
|
||||
this.confirmationService.confirm({
|
||||
message: `Are you sure you want to delete user "${user.username}"?`,
|
||||
@@ -107,10 +108,10 @@ export class OpdsSettingsV2 implements OnInit, OnDestroy {
|
||||
accept: () => this.deleteUser(user)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
deleteUser(user: OpdsUserV2): void {
|
||||
if (!user.id) return;
|
||||
|
||||
|
||||
this.opdsService.deleteCredential(user.id).pipe(
|
||||
takeUntil(this.destroy$),
|
||||
catchError(err => {
|
||||
@@ -123,26 +124,26 @@ export class OpdsSettingsV2 implements OnInit, OnDestroy {
|
||||
this.showMessage('success', 'Success', 'User deleted successfully');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
cancelCreateUser(): void {
|
||||
this.resetCreateUserDialog();
|
||||
}
|
||||
|
||||
|
||||
copyEndpoint(): void {
|
||||
navigator.clipboard.writeText(this.opdsEndpoint).then(() => {
|
||||
this.showMessage('success', 'Copied', 'OPDS endpoint copied to clipboard');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private resetCreateUserDialog(): void {
|
||||
this.showCreateUserDialog = false;
|
||||
this.newUser = {username: '', password: ''};
|
||||
}
|
||||
|
||||
|
||||
private showMessage(severity: string, summary: string, detail: string): void {
|
||||
this.messageService.add({severity, summary, detail});
|
||||
}
|
||||
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.destroy$.next();
|
||||
this.destroy$.complete();
|
||||
|
||||
Reference in New Issue
Block a user