Skip to content

Commit

Permalink
#1704 added directions wrapper with tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii Ivasyshyn committed Oct 13, 2022
1 parent 9186f2b commit 0c50fcf
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/app/shell/admin-tools/admin-tools.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h1 class="title">АДМІНІСТРУВАННЯ</h1>
<nav class="nav" mat-tab-nav-bar>
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./platform/'">ПОРТАЛ</a>
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="['./data/admins']">АДМІНІСТРАТОРИ</a>
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="['./data/directions']">НАПРЯМКИ</a>
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="['./data/directions-wrapper']">НАПРЯМКИ</a>
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="'./data/provider-list'">ЗАКЛАДИ</a>
<a mat-tab-link [routerLinkActive]="['active']" [routerLink]="['./data/users']">КОРИСТУВАЧІ</a>
<a mat-tab-link [routerLinkActive]="['active']">ЗАЯВИ</a>
Expand Down
6 changes: 4 additions & 2 deletions src/app/shell/admin-tools/data/data-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import { AdminsComponent } from './admins/admins.component';
import { ProviderListComponent } from './provider-list/provider-list.component';
import { UsersComponent } from './users/users.component';
import { HistoryLogComponent } from './history-log/history-log.component';
import { DirectionsComponent } from './directions/directions.component';
import { CreateDirectionComponent } from './directions/create-direction/create-direction.component';
import { DirectionsComponent } from './directions-wrapper/directions/directions.component';
import { CreateDirectionComponent } from './directions-wrapper/directions/create-direction/create-direction.component';
import { DirectionsWrapperComponent } from './directions-wrapper/directions-wrapper.component';

const routes: Routes = [
{ path: 'provider-list', component: ProviderListComponent},
{ path: 'users', component: UsersComponent},
{ path: 'admins', component: AdminsComponent},
{ path: 'history-log', component: HistoryLogComponent},
{ path: 'directions', component: DirectionsComponent},
{ path: 'directions-wrapper', component: DirectionsWrapperComponent},
{ path: 'directions/create/:param', component: CreateDirectionComponent}
];
@NgModule({
Expand Down
8 changes: 5 additions & 3 deletions src/app/shell/admin-tools/data/data.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { HistoryLogTableComponent } from './history-log/history-log-table/histor
import { HistoryLogFiltersComponent } from './history-log/history-log-filters/history-log-filters.component';
import { SharedModule } from '../../../shared/shared.module';
import { MaterialModule } from '../../../shared/modules/material.module';
import { DirectionsComponent } from './directions/directions.component';
import { CreateDirectionComponent } from './directions/create-direction/create-direction.component';
import { DirectionsComponent } from './directions-wrapper/directions/directions.component';
import { CreateDirectionComponent } from './directions-wrapper/directions/create-direction/create-direction.component';
import { DirectionsWrapperComponent } from './directions-wrapper/directions-wrapper.component';

@NgModule({
declarations: [
Expand All @@ -26,7 +27,8 @@ import { CreateDirectionComponent } from './directions/create-direction/create-d
HistoryLogTableComponent,
HistoryLogFiltersComponent,
DirectionsComponent,
CreateDirectionComponent
CreateDirectionComponent,
DirectionsWrapperComponent
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="tabs-container">
<mat-tab-group>
<mat-tab label="Напрямки для користувача">
<app-directions></app-directions>
</mat-tab>
<mat-tab label="МОН">
</mat-tab>
<mat-tab label="МКІП">
</mat-tab>
<mat-tab label="Мінспорт">
</mat-tab>
<mat-tab label="Інші">
</mat-tab>
</mat-tab-group>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "src/app/shared/styles/navigation-tabs.scss";
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DirectionsWrapperComponent } from './directions-wrapper.component';

describe('DirectionsWrapperComponent', () => {
let component: DirectionsWrapperComponent;
let fixture: ComponentFixture<DirectionsWrapperComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DirectionsWrapperComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(DirectionsWrapperComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-directions-wrapper',
templateUrl: './directions-wrapper.component.html',
styleUrls: ['./directions-wrapper.component.scss']
})
export class DirectionsWrapperComponent implements OnInit {

constructor() { }

ngOnInit(): void {
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CreateDirection, GetDirectionById, UpdateDirection } from './../../../../../shared/store/admin.actions';
import { CreateDirection, GetDirectionById, UpdateDirection } from './../../../../../../shared/store/admin.actions';
import { takeUntil, filter } from 'rxjs/operators';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { Component, OnDestroy, OnInit } from '@angular/core';
Expand All @@ -8,15 +8,15 @@ import { Observable } from 'rxjs';
import { Location } from '@angular/common';
import { FormGroup, FormBuilder, FormControl, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ConfirmationModalWindowComponent } from '../../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component';
import { Constants } from '../../../../../shared/constants/constants';
import { ModalConfirmationType } from '../../../../../shared/enum/modal-confirmation';
import { NavBarName } from '../../../../../shared/enum/navigation-bar';
import { Direction } from '../../../../../shared/models/category.model';
import { NavigationBarService } from '../../../../../shared/services/navigation-bar/navigation-bar.service';
import { AdminState } from '../../../../../shared/store/admin.state';
import { AddNavPath } from '../../../../../shared/store/navigation.actions';
import { CreateFormComponent } from '../../../../personal-cabinet/shared-cabinet/create-form/create-form.component';
import { ConfirmationModalWindowComponent } from '../../../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component';
import { Constants } from '../../../../../../shared/constants/constants';
import { ModalConfirmationType } from '../../../../../../shared/enum/modal-confirmation';
import { NavBarName } from '../../../../../../shared/enum/navigation-bar';
import { Direction } from '../../../../../../shared/models/category.model';
import { NavigationBarService } from '../../../../../../shared/services/navigation-bar/navigation-bar.service';
import { AdminState } from '../../../../../../shared/store/admin.state';
import { AddNavPath } from '../../../../../../shared/store/navigation.actions';
import { CreateFormComponent } from '../../../../../personal-cabinet/shared-cabinet/create-form/create-form.component';


@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@

<ng-template #isEmptyList>
<app-no-result-card [title]="noDirections"></app-no-result-card>
</ng-template>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { MatStepperModule } from '@angular/material/stepper';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { NgxsModule } from '@ngxs/store';
import { Direction } from '../../../../shared/models/category.model';
import { PaginationElement } from '../../../../shared/models/paginationElement.model';
import { Direction } from '../../../../../shared/models/category.model';
import { PaginationElement } from '../../../../../shared/models/paginationElement.model';
import { DirectionsComponent } from './directions.component';

describe('DirectionsComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import { MatDialog } from '@angular/material/dialog';
import { Select, Store } from '@ngxs/store';
import { Observable, Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged, map, skip, startWith, takeUntil } from 'rxjs/operators';
import { SearchResponse } from '../../../../shared/models/search.model';
import { ConfirmationModalWindowComponent } from '../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component';
import { PaginationConstants, Constants } from '../../../../shared/constants/constants';
import { ModalConfirmationType } from '../../../../shared/enum/modal-confirmation';
import { NoResultsTitle } from '../../../../shared/enum/no-results';
import { Direction } from '../../../../shared/models/category.model';
import { PaginationElement } from '../../../../shared/models/paginationElement.model';
import { GetFilteredDirections, DeleteDirectionById } from '../../../../shared/store/admin.actions';
import { AdminState } from '../../../../shared/store/admin.state';
import { PopNavPath } from '../../../../shared/store/navigation.actions';
import { OnPageChangeDirections, SetDirectionsPerPage } from '../../../../shared/store/paginator.actions';
import { PaginatorState } from '../../../../shared/store/paginator.state';
import { SearchResponse } from '../../../../../shared/models/search.model';
import { ConfirmationModalWindowComponent } from '../../../../../shared/components/confirmation-modal-window/confirmation-modal-window.component';
import { PaginationConstants, Constants } from '../../../../../shared/constants/constants';
import { ModalConfirmationType } from '../../../../../shared/enum/modal-confirmation';
import { NoResultsTitle } from '../../../../../shared/enum/no-results';
import { Direction } from '../../../../../shared/models/category.model';
import { PaginationElement } from '../../../../../shared/models/paginationElement.model';
import { GetFilteredDirections, DeleteDirectionById } from '../../../../../shared/store/admin.actions';
import { AdminState } from '../../../../../shared/store/admin.state';
import { PopNavPath } from '../../../../../shared/store/navigation.actions';
import { OnPageChangeDirections, SetDirectionsPerPage } from '../../../../../shared/store/paginator.actions';
import { PaginatorState } from '../../../../../shared/store/paginator.state';

@Component({
selector: 'app-directions',
Expand Down
2 changes: 1 addition & 1 deletion src/app/shell/shell-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { DetailsComponent } from './details/details.component';
import { CreateAchievementComponent } from './personal-cabinet/provider/create-achievement/create-achievement.component';
import { ErrorPageComponent } from '../shared/components/error-page/error-page.component';
import { CreateAdminComponent } from './admin-tools/data/admins/create-admin/create-admin.component';
import { CreateDirectionComponent } from './admin-tools/data/directions/create-direction/create-direction.component';
import { CreateDirectionComponent } from './admin-tools/data/directions-wrapper/directions/create-direction/create-direction.component';

const routes: Routes = [
{ path: '', component: MainComponent },
Expand Down

0 comments on commit 0c50fcf

Please sign in to comment.