Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed importing to use a dialog for loading files [#632]
* Moved all import-related features to the comic-file module. * Divided the importing feature into action-specific features.
- Loading branch information
Showing
72 changed files
with
1,672 additions
and
907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
comixed-web/src/app/comic-file/actions/comic-import.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2020, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { createAction, props } from '@ngrx/store'; | ||
|
||
export const setImportingComicsState = createAction( | ||
'[Comic Import] Explicitly sets the importing state', | ||
props<{ importing: boolean }>() | ||
); |
37 changes: 37 additions & 0 deletions
37
comixed-web/src/app/comic-file/actions/import-comic-files.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2021, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { createAction, props } from '@ngrx/store'; | ||
import { ComicFile } from '@app/comic-file'; | ||
|
||
export const sendComicFiles = createAction( | ||
'[Import Comic Files] Begin importing the selected comic files', | ||
props<{ | ||
files: ComicFile[]; | ||
ignoreMetadata: boolean; | ||
deleteBlockedPages: boolean; | ||
}>() | ||
); | ||
|
||
export const comicFilesSent = createAction( | ||
'[Import Comic Files] Importing comic files has started' | ||
); | ||
|
||
export const sendComicFilesFailed = createAction( | ||
'[Import Comic Files] Failed to begin importing comic files' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2021, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { API_ROOT_URL } from '../core'; | ||
|
||
export const LOAD_COMIC_FILES_URL = `${API_ROOT_URL}/files/contents`; | ||
export const SEND_COMIC_FILES_URL = `${API_ROOT_URL}/files/import`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2021, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { ComicFile } from './models/comic-file'; | ||
|
||
export const ROOT_DIRECTORY = '/home/comixedadmin/Documents/comics'; | ||
|
||
export const COMIC_FILE_1: ComicFile = { | ||
id: 1, | ||
filename: '/Users/comixed/Documents/comics/existing-comic-file.cbz', | ||
baseFilename: 'existing-comic-file', | ||
size: 65535 | ||
}; | ||
|
||
export const COMIC_FILE_2: ComicFile = { | ||
id: 2, | ||
filename: '/Users/comixed/Documents/comics/another-comic-file.cbz', | ||
baseFilename: 'another-comic-file', | ||
size: 32767 | ||
}; | ||
|
||
export const COMIC_FILE_3: ComicFile = { | ||
id: 3, | ||
filename: '/Users/comixed/Documents/comics/this-comic-file.cbz', | ||
baseFilename: 'this-comic-file', | ||
size: 46787 | ||
}; | ||
|
||
export const COMIC_FILE_4: ComicFile = { | ||
id: 4, | ||
filename: '/Users/comixed/Documents/comics/that-comic-file.cbz', | ||
baseFilename: 'that-comic-file', | ||
size: 56213 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2021, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
export { ComicFile } from './models/comic-file'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2021, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { ImportComicsPageComponent } from './pages/import-comics-page/import-comics-page.component'; | ||
import { ComicFileToolbarComponent } from './components/comic-file-toolbar/comic-file-toolbar.component'; | ||
import { ComicFileListComponent } from './components/comic-file-list/comic-file-list.component'; | ||
import { ComicFileDetailsComponent } from './components/comic-file-details/comic-file-details.component'; | ||
import { ComicFileCoverUrlPipe } from './pipes/comic-file-cover-url.pipe'; | ||
import { ComicFileRouting } from './comic-file.routing'; | ||
import { StoreModule } from '@ngrx/store'; | ||
import { | ||
COMIC_IMPORT_FEATURE_KEY, | ||
reducer as comicImportReducer | ||
} from './reducers/comic-import.reducer'; | ||
import { EffectsModule } from '@ngrx/effects'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { MatToolbarModule } from '@angular/material/toolbar'; | ||
import { MatTableModule } from '@angular/material/table'; | ||
import { MatFormFieldModule } from '@angular/material/form-field'; | ||
import { MatSelectModule } from '@angular/material/select'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
import { MatInputModule } from '@angular/material/input'; | ||
import { ComicFileListEffects } from '@app/comic-file/effects/comic-file-list.effects'; | ||
import { ImportComicFilesEffects } from '@app/comic-file/effects/import-comic-files.effects'; | ||
import { | ||
IMPORT_COMIC_FILES_FEATURE_KEY, | ||
reducer as importComicFilesReducer | ||
} from '@app/comic-file/reducers/import-comic-files.reducer'; | ||
import { | ||
COMIC_FILE_LIST_FEATURE_KEY, | ||
reducer as comicFileListReducer | ||
} from '@app/comic-file/reducers/comic-file-list.reducer'; | ||
import { ComicFileLookupComponent } from './components/comic-file-lookup/comic-file-lookup.component'; | ||
import { MatTooltipModule } from '@angular/material/tooltip'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatCheckboxModule } from '@angular/material/checkbox'; | ||
import { MatSortModule } from '@angular/material/sort'; | ||
import { MatCardModule } from '@angular/material/card'; | ||
import { LibraryModule } from '@app/library/library.module'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
ImportComicsPageComponent, | ||
ComicFileToolbarComponent, | ||
ComicFileListComponent, | ||
ComicFileDetailsComponent, | ||
ComicFileCoverUrlPipe, | ||
ComicFileLookupComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
ComicFileRouting, | ||
TranslateModule.forRoot(), | ||
StoreModule.forFeature(COMIC_FILE_LIST_FEATURE_KEY, comicFileListReducer), | ||
StoreModule.forFeature( | ||
IMPORT_COMIC_FILES_FEATURE_KEY, | ||
importComicFilesReducer | ||
), | ||
StoreModule.forFeature(COMIC_IMPORT_FEATURE_KEY, comicImportReducer), | ||
StoreModule.forFeature(COMIC_IMPORT_FEATURE_KEY, comicImportReducer), | ||
EffectsModule.forFeature([ComicFileListEffects, ImportComicFilesEffects]), | ||
MatToolbarModule, | ||
MatTableModule, | ||
MatFormFieldModule, | ||
MatSelectModule, | ||
MatIconModule, | ||
MatInputModule, | ||
MatTooltipModule, | ||
MatButtonModule, | ||
MatCheckboxModule, | ||
MatSortModule, | ||
MatCardModule, | ||
LibraryModule | ||
], | ||
exports: [CommonModule] | ||
}) | ||
export class ComicFileModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* ComiXed - A digital comic book library management application. | ||
* Copyright (C) 2021, The ComiXed Project | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses> | ||
*/ | ||
|
||
import { ImportComicsPageComponent } from './pages/import-comics-page/import-comics-page.component'; | ||
import { AdminGuard } from '../user'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'library/import', | ||
component: ImportComicsPageComponent, | ||
canActivate: [AdminGuard] | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class ComicFileRouting {} |
Oops, something went wrong.