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 {
RepositoryCardComponent
} 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 {MatListModule} from "@angular/material/list";
import {MatDialogModule} from "@angular/material/dialog";
import {MatTooltipModule} from "@angular/material/tooltip";
import {MatInputModule} from "@angular/material/input";
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 {
DownloadDaemonDialogComponent
} from "./repositories-tab/download-daemon-dialog/download-daemon-dialog.component";
import {
RepositoryModule
} from "../shared/repository/repository/repository.module";
@NgModule({
@ -62,9 +56,6 @@ import {
ImportTabComponent,
ImportTabSidebarComponent,
RepositoryCardComponent,
AddRepositoryDialogComponent,
RepositoryFormComponent,
EditRepositoryDialogComponent,
DownloadDaemonDialogComponent,
],
exports: [
@ -96,6 +87,7 @@ import {
MatTooltipModule,
MatInputModule,
TagModule,
RepositoryModule,
]
})
export class CoreModule {

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

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

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

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

@ -6,10 +6,10 @@ import {
ValidationErrors,
Validators
} from "@angular/forms";
import {Repository} from "../../../../models/Repository";
import {Repository} from "../../../../../models/Repository";
import {
RepositoryService
} from "../../../../services/repository/repository.service";
} from "../../../../../services/repository/repository.service";
import {dialog} from "@tauri-apps/api";
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