Skip to content

Commit

Permalink
Chore: Move synchronization to its own module (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage authored Sep 13, 2023
1 parent 4ac75bf commit c6e3660
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const routes: Routes = [
path: 'hesitations',
loadChildren: () => import('./hesitations/hesitations.module').then(m => m.HesitationsModule),
},
{
path: 'synchronize',
loadChildren: () => import('./synchronization/synchronization.module').then(m => m.SynchronizationModule),
},
{
path: 'glossary',
loadChildren: () => import('./glossary/glossary.module').then(m => m.GlossaryModule),
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</a>
</li>
<li class="nav-item" *ngIf="software === 'lemmy'">
<a routerLink="/censures/synchronize/lemmy" class="nav-link">
<a routerLink="/synchronize/lemmy" class="nav-link">
<i class="nav-icon fas fa-sync"></i>
<p>
{{ "Synchronize" }}
Expand Down
8 changes: 1 addition & 7 deletions src/app/censures/censures.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MyCensuresComponent } from './pages/my-censures/my-censures.component';
import { CensureInstanceComponent } from './pages/censure-instance/censure-instance.component';
import {ReactiveFormsModule} from "@angular/forms";
import {SharedModule} from "../shared/shared.module";
import { SynchronizeLemmyComponent } from './pages/synchronize-lemmy/synchronize-lemmy.component';
import { SynchronizeLemmyComponent } from '../synchronization/pages/synchronize-lemmy/synchronize-lemmy.component';
import {Guards} from "../guards/guards";
import { EditCensureReasonsComponent } from './pages/edit-censure-reasons/edit-censure-reasons.component';

Expand All @@ -20,11 +20,6 @@ const routes: Routes = [
component: CensureInstanceComponent,
canActivate: [Guards.isLoggedIn()]
},
{
path: 'synchronize/lemmy',
component: SynchronizeLemmyComponent,
canActivate: [Guards.isLoggedIn()]
},
{
path: 'my/edit/:instance',
component: EditCensureReasonsComponent,
Expand All @@ -36,7 +31,6 @@ const routes: Routes = [
declarations: [
MyCensuresComponent,
CensureInstanceComponent,
SynchronizeLemmyComponent,
EditCensureReasonsComponent
],
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h3 class="card-title">Censures that {{instance.name}} <strong>has given</strong
<div class="card-body">
<p *ngIf="software === 'lemmy'">
You can easily synchronize your blacklist to your Lemmy instance defederations from the
<a routerLink="/censures/synchronize/lemmy">Synchronize page</a>.
<a routerLink="/synchronize/lemmy">Synchronize page</a>.
</p>
<table class="table table-bordered">
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h3 class="card-title">Hesitations that {{instance.name}} <strong>has given</str
<p>See what exactly hesitations mean in the <a routerLink="/glossary" fragment="hesitations">Glossary</a>.</p>
<p *ngIf="software === 'lemmy'">
You can easily synchronize your censures and hesitations to your Lemmy instance defederations from the
<a routerLink="/censures/synchronize/lemmy">Synchronize page</a>.
<a routerLink="/synchronize/lemmy">Synchronize page</a>.
</p>
<table class="table table-bordered">
<thead>
Expand Down
28 changes: 28 additions & 0 deletions src/app/synchronization/synchronization.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {SynchronizeLemmyComponent} from "./pages/synchronize-lemmy/synchronize-lemmy.component";
import {RouterModule, Routes} from "@angular/router";
import {Guards} from "../guards/guards";
import {ReactiveFormsModule} from "@angular/forms";
import {SharedModule} from "../shared/shared.module";

const routes: Routes = [
{
path: 'lemmy',
component: SynchronizeLemmyComponent,
canActivate: [Guards.isLoggedIn()]
},
];

@NgModule({
declarations: [
SynchronizeLemmyComponent,
],
imports: [
CommonModule,
RouterModule.forChild(routes),
ReactiveFormsModule,
SharedModule,
]
})
export class SynchronizationModule { }

0 comments on commit c6e3660

Please sign in to comment.