Move repository dialogs to separate shared component

Signed-off-by: Trivernis <trivernis@protonmail.com>
pull/4/head
Trivernis 3 years ago
parent c1d25dd13b
commit 25786f9d3c

@ -33,24 +33,18 @@ import {ReactiveFormsModule} from "@angular/forms";
import { import {
RepositoryCardComponent RepositoryCardComponent
} from "./repositories-tab/repository-card/repository-card.component"; } from "./repositories-tab/repository-card/repository-card.component";
import {
AddRepositoryDialogComponent
} from "./repositories-tab/add-repository-dialog/add-repository-dialog.component";
import {MatCardModule} from "@angular/material/card"; import {MatCardModule} from "@angular/material/card";
import {MatListModule} from "@angular/material/list"; import {MatListModule} from "@angular/material/list";
import {MatDialogModule} from "@angular/material/dialog"; import {MatDialogModule} from "@angular/material/dialog";
import {MatTooltipModule} from "@angular/material/tooltip"; import {MatTooltipModule} from "@angular/material/tooltip";
import {MatInputModule} from "@angular/material/input"; import {MatInputModule} from "@angular/material/input";
import {TagModule} from "../shared/tag/tag.module"; import {TagModule} from "../shared/tag/tag.module";
import {
RepositoryFormComponent
} from "./repositories-tab/repository-form/repository-form.component";
import {
EditRepositoryDialogComponent
} from "./repositories-tab/edit-repository-dialog/edit-repository-dialog.component";
import { import {
DownloadDaemonDialogComponent DownloadDaemonDialogComponent
} from "./repositories-tab/download-daemon-dialog/download-daemon-dialog.component"; } from "./repositories-tab/download-daemon-dialog/download-daemon-dialog.component";
import {
RepositoryModule
} from "../shared/repository/repository/repository.module";
@NgModule({ @NgModule({
@ -62,9 +56,6 @@ import {
ImportTabComponent, ImportTabComponent,
ImportTabSidebarComponent, ImportTabSidebarComponent,
RepositoryCardComponent, RepositoryCardComponent,
AddRepositoryDialogComponent,
RepositoryFormComponent,
EditRepositoryDialogComponent,
DownloadDaemonDialogComponent, DownloadDaemonDialogComponent,
], ],
exports: [ exports: [
@ -96,6 +87,7 @@ import {
MatTooltipModule, MatTooltipModule,
MatInputModule, MatInputModule,
TagModule, TagModule,
RepositoryModule,
] ]
}) })
export class CoreModule { export class CoreModule {

@ -4,12 +4,12 @@ import {
RepositoryService RepositoryService
} from "../../../services/repository/repository.service"; } from "../../../services/repository/repository.service";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";
import {
AddRepositoryDialogComponent
} from "./add-repository-dialog/add-repository-dialog.component";
import { import {
DownloadDaemonDialogComponent DownloadDaemonDialogComponent
} from "./download-daemon-dialog/download-daemon-dialog.component"; } from "./download-daemon-dialog/download-daemon-dialog.component";
import {
AddRepositoryDialogComponent
} from "../../shared/repository/repository/add-repository-dialog/add-repository-dialog.component";
@Component({ @Component({
selector: "app-repositories-tab", selector: "app-repositories-tab",

@ -15,7 +15,7 @@ import {
} from "../../../shared/app-common/busy-indicator/busy-indicator.component"; } from "../../../shared/app-common/busy-indicator/busy-indicator.component";
import { import {
EditRepositoryDialogComponent EditRepositoryDialogComponent
} from "../edit-repository-dialog/edit-repository-dialog.component"; } from "../../../shared/repository/repository/edit-repository-dialog/edit-repository-dialog.component";
@Component({ @Component({
selector: "app-repository-card", selector: "app-repository-card",

@ -1,14 +1,14 @@
import {Component, Inject, ViewChild} from "@angular/core"; import {Component, Inject, ViewChild} from "@angular/core";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {
RepositoryFormComponent
} from "../repository-form/repository-form.component";
import { import {
RepositoryService RepositoryService
} from "../../../../services/repository/repository.service"; } from "../../../../../services/repository/repository.service";
import { import {
ErrorBrokerService ErrorBrokerService
} from "../../../../services/error-broker/error-broker.service"; } from "../../../../../services/error-broker/error-broker.service";
import {
RepositoryFormComponent
} from "../repository-form/repository-form.component";
@Component({ @Component({
selector: "app-add-repository-dialog", selector: "app-add-repository-dialog",

@ -4,15 +4,12 @@ import {
} from "../repository-form/repository-form.component"; } from "../repository-form/repository-form.component";
import { import {
RepositoryService RepositoryService
} from "../../../../services/repository/repository.service"; } from "../../../../../services/repository/repository.service";
import { import {
ErrorBrokerService ErrorBrokerService
} from "../../../../services/error-broker/error-broker.service"; } from "../../../../../services/error-broker/error-broker.service";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import { import {Repository} from "../../../../../models/Repository";
AddRepositoryDialogComponent
} from "../add-repository-dialog/add-repository-dialog.component";
import {Repository} from "../../../../models/Repository";
@Component({ @Component({
selector: "app-edit-repository-dialog", selector: "app-edit-repository-dialog",
@ -29,7 +26,7 @@ export class EditRepositoryDialogComponent {
constructor( constructor(
public repoService: RepositoryService, public repoService: RepositoryService,
public errorBroker: ErrorBrokerService, public errorBroker: ErrorBrokerService,
public dialogRef: MatDialogRef<AddRepositoryDialogComponent>, public dialogRef: MatDialogRef<EditRepositoryDialogComponent>,
@Inject(MAT_DIALOG_DATA) data: any) { @Inject(MAT_DIALOG_DATA) data: any) {
this.selectedRepository = data.repository; this.selectedRepository = data.repository;
this.originalName = this.selectedRepository.name; this.originalName = this.selectedRepository.name;

@ -6,10 +6,10 @@ import {
ValidationErrors, ValidationErrors,
Validators Validators
} from "@angular/forms"; } from "@angular/forms";
import {Repository} from "../../../../models/Repository"; import {Repository} from "../../../../../models/Repository";
import { import {
RepositoryService RepositoryService
} from "../../../../services/repository/repository.service"; } from "../../../../../services/repository/repository.service";
import {dialog} from "@tauri-apps/api"; import {dialog} from "@tauri-apps/api";
import {MatDialog} from "@angular/material/dialog"; import {MatDialog} from "@angular/material/dialog";

@ -0,0 +1,44 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {
AddRepositoryDialogComponent
} from "./add-repository-dialog/add-repository-dialog.component";
import {
RepositoryFormComponent
} from "./repository-form/repository-form.component";
import {
EditRepositoryDialogComponent
} from "./edit-repository-dialog/edit-repository-dialog.component";
import {MatDialogModule} from "@angular/material/dialog";
import {MatButtonModule} from "@angular/material/button";
import {MatTooltipModule} from "@angular/material/tooltip";
import {MatSelectModule} from "@angular/material/select";
import {MatInputModule} from "@angular/material/input";
import {ReactiveFormsModule} from "@angular/forms";
import {NgIconsModule} from "@ng-icons/core";
import {MatFolder} from "@ng-icons/material-icons"
@NgModule({
declarations: [
AddRepositoryDialogComponent,
EditRepositoryDialogComponent,
RepositoryFormComponent
],
exports: [
AddRepositoryDialogComponent,
EditRepositoryDialogComponent,
],
imports: [
CommonModule,
MatDialogModule,
MatButtonModule,
MatTooltipModule,
MatSelectModule,
MatInputModule,
ReactiveFormsModule,
NgIconsModule.withIcons({MatFolder})
]
})
export class RepositoryModule {
}
Loading…
Cancel
Save