폴더명 수정

This commit is contained in:
이담 정 2022-08-04 09:30:09 +00:00
parent f5de3d038c
commit c9a6fa01f7
17 changed files with 157 additions and 151 deletions

View File

@ -430,11 +430,11 @@ export const appRoutes: Route[] = [
).then((m: any) => m.UserSessionModule), ).then((m: any) => m.UserSessionModule),
}, },
{ {
path: 'sessionin-overlap', path: 'duplicated-session',
loadChildren: () => loadChildren: () =>
import( import(
'app/modules/admin/report/sessionin-overlap/sessionin-overlap.module' 'app/modules/admin/report/duplicated-session/duplicated-session.module'
).then((m: any) => m.SessioninOverlapModule), ).then((m: any) => m.DuplicatedSessionModule),
}, },
{ {
path: 'admin-session', path: 'admin-session',

View File

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { assign, cloneDeep } from 'lodash-es'; import { assign, cloneDeep } from 'lodash-es';
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
import { sessioninOverlaps as sessioninOverlapsData } from './data'; import { duplicatedSessions as duplicatedSessionsData } from './data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class ReportSessioninOverlapMockApi { export class ReportDuplicatedSessionMockApi {
private _sessioninOverlaps: any[] = sessioninOverlapsData; private _duplicatedSessions: any[] = duplicatedSessionsData;
/** /**
* Constructor * Constructor
@ -26,26 +26,26 @@ export class ReportSessioninOverlapMockApi {
*/ */
registerHandlers(): void { registerHandlers(): void {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlaps - GET // @ DuplicatedSessions - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-overlap/sessionin-overlaps', 300) .onGet('api/apps/report/duplicated-session/duplicated-sessions', 300)
.reply(({ request }) => { .reply(({ request }) => {
// Get available queries // Get available queries
const search = request.params.get('search'); const search = request.params.get('search');
const sort = request.params.get('sort') || 'name'; const sort = request.params.get('sort') || 'overlapCount';
const order = request.params.get('order') || 'asc'; const order = request.params.get('order') || 'asc';
const page = parseInt(request.params.get('page') ?? '1', 10); const page = parseInt(request.params.get('page') ?? '1', 10);
const size = parseInt(request.params.get('size') ?? '10', 10); const size = parseInt(request.params.get('size') ?? '10', 10);
// Clone the sessioninoverlaps // Clone the duplicatedSessions
let sessioninOverlaps: any[] | null = cloneDeep( let duplicatedSessions: any[] | null = cloneDeep(
this._sessioninOverlaps this._duplicatedSessions
); );
// Sort the sessioninOverlaps // Sort the duplicatedSessions
if (sort === 'overlapCount') { if (sort === 'overlapCount') {
sessioninOverlaps.sort((a, b) => { duplicatedSessions.sort((a, b) => {
const fieldA = a[sort].toString().toUpperCase(); const fieldA = a[sort].toString().toUpperCase();
const fieldB = b[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase();
return order === 'asc' return order === 'asc'
@ -53,15 +53,15 @@ export class ReportSessioninOverlapMockApi {
: fieldB.localeCompare(fieldA); : fieldB.localeCompare(fieldA);
}); });
} else { } else {
sessioninOverlaps.sort((a, b) => duplicatedSessions.sort((a, b) =>
order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
); );
} }
// If search exists... // If search exists...
if (search) { if (search) {
// Filter the sessioninOverlaps // Filter the duplicatedSessions
sessioninOverlaps = sessioninOverlaps.filter( duplicatedSessions = duplicatedSessions.filter(
(contact: any) => (contact: any) =>
contact.name && contact.name &&
contact.name.toLowerCase().includes(search.toLowerCase()) contact.name.toLowerCase().includes(search.toLowerCase())
@ -69,32 +69,35 @@ export class ReportSessioninOverlapMockApi {
} }
// Paginate - Start // Paginate - Start
const sessioninOverlapsLength = sessioninOverlaps.length; const duplicatedSessionsLength = duplicatedSessions.length;
// Calculate pagination details // Calculate pagination details
const begin = page * size; const begin = page * size;
const end = Math.min(size * (page + 1), sessioninOverlapsLength); const end = Math.min(size * (page + 1), duplicatedSessionsLength);
const lastPage = Math.max(Math.ceil(sessioninOverlapsLength / size), 1); const lastPage = Math.max(
Math.ceil(duplicatedSessionsLength / size),
1
);
// Prepare the pagination object // Prepare the pagination object
let pagination = {}; let pagination = {};
// If the requested page number is bigger than // If the requested page number is bigger than
// the last possible page number, return null for // the last possible page number, return null for
// sessioninOverlaps but also send the last possible page so // duplicatedSessions but also send the last possible page so
// the app can navigate to there // the app can navigate to there
if (page > lastPage) { if (page > lastPage) {
sessioninOverlaps = null; duplicatedSessions = null;
pagination = { pagination = {
lastPage, lastPage,
}; };
} else { } else {
// Paginate the results by size // Paginate the results by size
sessioninOverlaps = sessioninOverlaps.slice(begin, end); duplicatedSessions = duplicatedSessions.slice(begin, end);
// Prepare the pagination mock-api // Prepare the pagination mock-api
pagination = { pagination = {
length: sessioninOverlapsLength, length: duplicatedSessionsLength,
size: size, size: size,
page: page, page: page,
lastPage: lastPage, lastPage: lastPage,
@ -107,41 +110,41 @@ export class ReportSessioninOverlapMockApi {
return [ return [
200, 200,
{ {
sessioninOverlaps, duplicatedSessions,
pagination, pagination,
}, },
]; ];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - GET // @ DuplicatedSession - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-overlap/sessionin-overlap') .onGet('api/apps/report/duplicated-session/duplicated-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id from the params // Get the id from the params
const id = request.params.get('id'); const id = request.params.get('id');
// Clone the sessioninOverlaps // Clone the duplicatedSessions
const sessioninOverlaps = cloneDeep(this._sessioninOverlaps); const duplicatedSessions = cloneDeep(this._duplicatedSessions);
// Find the sessioninOverlap // Find the duplicatedSession
const sessioninOverlap = sessioninOverlaps.find( const duplicatedSession = duplicatedSessions.find(
(item: any) => item.id === id (item: any) => item.id === id
); );
// Return the response // Return the response
return [200, sessioninOverlap]; return [200, duplicatedSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - POST // @ DuplicatedSession - POST
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPost('api/apps/report/sessionin-overlap/sessionin-overlap') .onPost('api/apps/report/duplicated-session/duplicated-session')
.reply(() => { .reply(() => {
// Generate a new sessioninOverlap // Generate a new duplicatedSession
const newSessioninOverlap = { const newDuplicatedSession = {
id: FuseMockApiUtils.guid(), id: FuseMockApiUtils.guid(),
category: '', category: '',
name: 'A New User', name: 'A New User',
@ -163,58 +166,58 @@ export class ReportSessioninOverlapMockApi {
active: false, active: false,
}; };
// Unshift the new sessioninOverlap // Unshift the new duplicatedSession
this._sessioninOverlaps.unshift(newSessioninOverlap); this._duplicatedSessions.unshift(newDuplicatedSession);
// Return the response // Return the response
return [200, newSessioninOverlap]; return [200, newDuplicatedSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - PATCH // @ DuplicatedSession - PATCH
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPatch('api/apps/report/sessionin-overlap/sessionin-overlap') .onPatch('api/apps/report/duplicated-session/duplicated-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id and sessioninOverlap // Get the id and duplicatedSession
const id = request.body.id; const id = request.body.id;
const sessioninOverlap = cloneDeep(request.body.sessioninOverlap); const duplicatedSession = cloneDeep(request.body.duplicatedSession);
// Prepare the updated sessioninOverlap // Prepare the updated duplicatedSession
let updatedSessioninOverlap = null; let updatedDuplicatedSession = null;
// Find the sessioninOverlap and update it // Find the duplicatedSession and update it
this._sessioninOverlaps.forEach((item, index, sessioninOverlaps) => { this._duplicatedSessions.forEach((item, index, duplicatedSessions) => {
if (item.id === id) { if (item.id === id) {
// Update the sessioninOverlap // Update the duplicatedSession
sessioninOverlaps[index] = assign( duplicatedSessions[index] = assign(
{}, {},
sessioninOverlaps[index], duplicatedSessions[index],
sessioninOverlap duplicatedSession
); );
// Store the updated sessioninOverlap // Store the updated duplicatedSession
updatedSessioninOverlap = sessioninOverlaps[index]; updatedDuplicatedSession = duplicatedSessions[index];
} }
}); });
// Return the response // Return the response
return [200, updatedSessioninOverlap]; return [200, updatedDuplicatedSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - DELETE // @ DuplicatedSession - DELETE
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onDelete('api/apps/report/sessionin-overlap/sessionin-overlap') .onDelete('api/apps/report/duplicated-session/duplicated-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id // Get the id
const id = request.params.get('id'); const id = request.params.get('id');
// Find the sessioninOverlap and delete it // Find the duplicatedSession and delete it
this._sessioninOverlaps.forEach((item, index) => { this._duplicatedSessions.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
this._sessioninOverlaps.splice(index, 1); this._duplicatedSessions.splice(index, 1);
} }
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
export const sessioninOverlaps = [ export const duplicatedSessions = [
{ {
id: '1', id: '1',
overlapCount: '3', overlapCount: '3',

View File

@ -322,11 +322,11 @@ export const defaultNavigation: FuseNavigationItem[] = [
link: '/report/user-session', link: '/report/user-session',
}, },
{ {
id: 'report.sessionin-overlap', id: 'report.duplicated-session',
title: 'Sessionin Overlap', title: 'Duplicated Session',
type: 'basic', type: 'basic',
icon: 'heroicons_outline:academic-cap', icon: 'heroicons_outline:academic-cap',
link: '/report/sessionin-overlap', link: '/report/duplicated-session',
}, },
{ {
id: 'report.admin-session', id: 'report.admin-session',

View File

@ -59,7 +59,7 @@ import { ReportCompLogMockApi } from './apps/report/comp-log/api';
import { ReportModificationLogMockApi } from './apps/report/modification-log/api'; import { ReportModificationLogMockApi } from './apps/report/modification-log/api';
import { ReportPaymentLogMockApi } from './apps/report/payment-log/api'; import { ReportPaymentLogMockApi } from './apps/report/payment-log/api';
import { ReportUserSessionMockApi } from './apps/report/user-session/api'; import { ReportUserSessionMockApi } from './apps/report/user-session/api';
import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api'; import { ReportDuplicatedSessionMockApi } from './apps/report/duplicated-session/api';
import { ReportAdminSessionMockApi } from './apps/report/admin-session/api'; import { ReportAdminSessionMockApi } from './apps/report/admin-session/api';
import { ReportExcelLogMockApi } from './apps/report/excel-log/api'; import { ReportExcelLogMockApi } from './apps/report/excel-log/api';
import { ReportLoosingMockApi } from './apps/report/loosing/api'; import { ReportLoosingMockApi } from './apps/report/loosing/api';
@ -132,7 +132,7 @@ export const mockApiServices = [
ReportModificationLogMockApi, ReportModificationLogMockApi,
ReportPaymentLogMockApi, ReportPaymentLogMockApi,
ReportUserSessionMockApi, ReportUserSessionMockApi,
ReportSessioninOverlapMockApi, ReportDuplicatedSessionMockApi,
ReportAdminSessionMockApi, ReportAdminSessionMockApi,
ReportExcelLogMockApi, ReportExcelLogMockApi,
ReportLoosingMockApi, ReportLoosingMockApi,

View File

@ -65,8 +65,10 @@
<div <div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
> >
<ng-container *ngIf="sessioninOverlaps$ | async as sessioninOverlaps"> <ng-container *ngIf="duplicatedSessions$ | async as duplicatedSessions">
<ng-container *ngIf="sessioninOverlaps.length > 0; else noUser"> <ng-container
*ngIf="duplicatedSessions.length > 0; else noDuplicatedSession"
>
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -79,11 +81,11 @@
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container <ng-container
*ngIf="sessioninOverlaps$ | async as sessioninOverlaps" *ngIf="duplicatedSessions$ | async as duplicatedSessions"
> >
<ng-container <ng-container
*ngFor=" *ngFor="
let info of sessioninOverlaps; let info of duplicatedSessions;
let i = index; let i = index;
trackBy: __trackByFn trackBy: __trackByFn
" "
@ -130,7 +132,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-template #noUser> <ng-template #noDuplicatedSession>
<div <div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center" class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
> >

View File

@ -30,13 +30,13 @@ import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { User } from '../../../member/user/models/user'; import { User } from '../../../member/user/models/user';
import { SessioninOverlap } from '../models/sessionin-overlap'; import { DuplicatedSession } from '../models/duplicated-session';
import { SessioninOverlapPagination } from '../models/sessionin-Overlap-pagination'; import { DuplicatedSessionPagination } from '../models/duplicated-session-pagination';
import { SessioninOverlapService } from '../services/sessionin-overlap.service'; import { DuplicatedSessionService } from '../services/duplicated-session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'sessionin-overlap-list', selector: 'duplicated-session-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */
@ -66,13 +66,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort; @ViewChild(MatSort) private _sort!: MatSort;
sessioninOverlaps$!: Observable<SessioninOverlap[] | undefined>; duplicatedSessions$!: Observable<DuplicatedSession[] | undefined>;
users$!: Observable<User[] | undefined>; users$!: Observable<User[] | undefined>;
isLoading = false; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedSessioninOverlap?: SessioninOverlap; selectedDuplicatedSession?: DuplicatedSession;
pagination?: SessioninOverlapPagination; pagination?: DuplicatedSessionPagination;
__isSearchOpened = false; __isSearchOpened = false;
@ -85,7 +85,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef, private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _sessioninOverlapService: SessioninOverlapService, private _duplicatedSessionService: DuplicatedSessionService,
private router: Router private router: Router
) {} ) {}
@ -98,9 +98,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the pagination // Get the pagination
this._sessioninOverlapService.pagination$ this._duplicatedSessionService.pagination$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe((pagination: SessioninOverlapPagination | undefined) => { .subscribe((pagination: DuplicatedSessionPagination | undefined) => {
// Update the pagination // Update the pagination
this.pagination = pagination; this.pagination = pagination;
@ -109,7 +109,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.sessioninOverlaps$ = this._sessioninOverlapService.sessioninOverlaps$; this.duplicatedSessions$ =
this._duplicatedSessionService.duplicatedSessions$;
} }
/** /**
@ -119,7 +120,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
if (this._sort && this._paginator) { if (this._sort && this._paginator) {
// Set the initial sort // Set the initial sort
this._sort.sort({ this._sort.sort({
id: 'name', id: 'overlapCount',
start: 'asc', start: 'asc',
disableClear: true, disableClear: true,
}); });
@ -127,7 +128,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
// If the sessioninOverlap changes the sort order... // If the duplicatedSession changes the sort order...
this._sort.sortChange this._sort.sortChange
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => { .subscribe(() => {
@ -140,7 +141,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
.pipe( .pipe(
switchMap(() => { switchMap(() => {
this.isLoading = true; this.isLoading = true;
return this._sessioninOverlapService.getSessioninOverlaps( return this._duplicatedSessionService.getDuplicatedSessions(
this._paginator.pageIndex, this._paginator.pageIndex,
this._paginator.pageSize, this._paginator.pageSize,
this._sort.active, this._sort.active,

View File

@ -22,14 +22,14 @@ import { SharedModule } from 'app/shared/shared.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { sessioninOverlapRoutes } from './sessionin-overlap.routing'; import { duplicatedSessionRoutes } from './duplicated-session.routing';
@NgModule({ @NgModule({
declarations: [COMPONENTS], declarations: [COMPONENTS],
imports: [ imports: [
TranslocoModule, TranslocoModule,
SharedModule, SharedModule,
RouterModule.forChild(sessioninOverlapRoutes), RouterModule.forChild(duplicatedSessionRoutes),
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
@ -47,4 +47,4 @@ import { sessioninOverlapRoutes } from './sessionin-overlap.routing';
MatCheckboxModule, MatCheckboxModule,
], ],
}) })
export class SessioninOverlapModule {} export class DuplicatedSessionModule {}

View File

@ -3,15 +3,15 @@ import { Route } from '@angular/router';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { ViewComponent } from '../../member/user/components/view.component'; import { ViewComponent } from '../../member/user/components/view.component';
import { SessioninOverlapsResolver } from './resolvers/sessionin-overlap.resolver'; import { DuplicatedSessionsResolver } from './resolvers/duplicated-session.resolver';
import { UserResolver } from '../../member/user/resolvers/user.resolver'; import { UserResolver } from '../../member/user/resolvers/user.resolver';
export const sessioninOverlapRoutes: Route[] = [ export const duplicatedSessionRoutes: Route[] = [
{ {
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
sessioninOverlaps: SessioninOverlapsResolver, duplicatedSessions: DuplicatedSessionsResolver,
}, },
}, },
{ {

View File

@ -1,4 +1,4 @@
export interface SessioninOverlapPagination { export interface DuplicatedSessionPagination {
length: number; length: number;
size: number; size: number;
page: number; page: number;

View File

@ -1,4 +1,4 @@
export interface SessioninOverlap { export interface DuplicatedSession {
id?: string; id?: string;
overlapCount?: string; overlapCount?: string;
ip?: string; ip?: string;

View File

@ -7,19 +7,19 @@ import {
} from '@angular/router'; } from '@angular/router';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { SessioninOverlap } from '../models/sessionin-overlap'; import { DuplicatedSession } from '../models/duplicated-session';
import { SessioninOverlapPagination } from '../models/sessionin-Overlap-pagination'; import { DuplicatedSessionPagination } from '../models/duplicated-session-pagination';
import { SessioninOverlapService } from '../services/sessionin-overlap.service'; import { DuplicatedSessionService } from '../services/duplicated-session.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninOverlapResolver implements Resolve<any> { export class DuplicatedSessionResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor( constructor(
private _sessioninOverlapService: SessioninOverlapService, private _duplicatedSessionService: DuplicatedSessionService,
private _router: Router private _router: Router
) {} ) {}
@ -36,9 +36,9 @@ export class SessioninOverlapResolver implements Resolve<any> {
resolve( resolve(
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<SessioninOverlap | undefined> { ): Observable<DuplicatedSession | undefined> {
return this._sessioninOverlapService return this._duplicatedSessionService
.getSessioninOverlapById(route.paramMap.get('id')) .getDuplicatedSessionById(route.paramMap.get('id'))
.pipe( .pipe(
// Error here means the requested product is not available // Error here means the requested product is not available
catchError((error) => { catchError((error) => {
@ -61,11 +61,11 @@ export class SessioninOverlapResolver implements Resolve<any> {
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninOverlapsResolver implements Resolve<any> { export class DuplicatedSessionsResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor(private _sessioninOverlapService: SessioninOverlapService) {} constructor(private _duplicatedSessionService: DuplicatedSessionService) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ Public methods // @ Public methods
@ -81,9 +81,9 @@ export class SessioninOverlapsResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<{ ): Observable<{
pagination: SessioninOverlapPagination; pagination: DuplicatedSessionPagination;
sessioninOverlaps: SessioninOverlap[]; duplicatedSessions: DuplicatedSession[];
}> { }> {
return this._sessioninOverlapService.getSessioninOverlaps(); return this._duplicatedSessionService.getDuplicatedSessions();
} }
} }

View File

@ -12,22 +12,22 @@ import {
throwError, throwError,
} from 'rxjs'; } from 'rxjs';
import { SessioninOverlap } from '../models/sessionin-overlap'; import { DuplicatedSession } from '../models/duplicated-session';
import { SessioninOverlapPagination } from '../models/sessionin-Overlap-pagination'; import { DuplicatedSessionPagination } from '../models/duplicated-session-pagination';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninOverlapService { export class DuplicatedSessionService {
// Private // Private
private __pagination = new BehaviorSubject< private __pagination = new BehaviorSubject<
SessioninOverlapPagination | undefined DuplicatedSessionPagination | undefined
>(undefined); >(undefined);
private __sessioninOverlap = new BehaviorSubject< private __duplicatedSession = new BehaviorSubject<
SessioninOverlap | undefined DuplicatedSession | undefined
>(undefined); >(undefined);
private __sessioninOverlaps = new BehaviorSubject< private __duplicatedSessions = new BehaviorSubject<
SessioninOverlap[] | undefined DuplicatedSession[] | undefined
>(undefined); >(undefined);
/** /**
@ -42,22 +42,22 @@ export class SessioninOverlapService {
/** /**
* Getter for pagination * Getter for pagination
*/ */
get pagination$(): Observable<SessioninOverlapPagination | undefined> { get pagination$(): Observable<DuplicatedSessionPagination | undefined> {
return this.__pagination.asObservable(); return this.__pagination.asObservable();
} }
/** /**
* Getter for sessioninOverlap * Getter for duplicatedSession
*/ */
get sessioninOverlap$(): Observable<SessioninOverlap | undefined> { get duplicatedSession$(): Observable<DuplicatedSession | undefined> {
return this.__sessioninOverlap.asObservable(); return this.__duplicatedSession.asObservable();
} }
/** /**
* Getter for sessioninOverlaps * Getter for duplicatedSessions
*/ */
get sessioninOverlaps$(): Observable<SessioninOverlap[] | undefined> { get duplicatedSessions$(): Observable<DuplicatedSession[] | undefined> {
return this.__sessioninOverlaps.asObservable(); return this.__duplicatedSessions.asObservable();
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -65,7 +65,7 @@ export class SessioninOverlapService {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
/** /**
* Get SessioninOverlaps * Get DuplicatedSessions
* *
* *
* @param page * @param page
@ -74,21 +74,21 @@ export class SessioninOverlapService {
* @param order * @param order
* @param search * @param search
*/ */
getSessioninOverlaps( getDuplicatedSessions(
page: number = 0, page: number = 0,
size: number = 10, size: number = 10,
sort: string = 'name', sort: string = 'signinId',
order: 'asc' | 'desc' | '' = 'asc', order: 'asc' | 'desc' | '' = 'asc',
search: string = '' search: string = ''
): Observable<{ ): Observable<{
pagination: SessioninOverlapPagination; pagination: DuplicatedSessionPagination;
sessioninOverlaps: SessioninOverlap[]; duplicatedSessions: DuplicatedSession[];
}> { }> {
return this._httpClient return this._httpClient
.get<{ .get<{
pagination: SessioninOverlapPagination; pagination: DuplicatedSessionPagination;
sessioninOverlaps: SessioninOverlap[]; duplicatedSessions: DuplicatedSession[];
}>('api/apps/report/sessionin-overlap/sessionin-overlaps', { }>('api/apps/report/duplicated-session/duplicated-sessions', {
params: { params: {
page: '' + page, page: '' + page,
size: '' + size, size: '' + size,
@ -100,7 +100,7 @@ export class SessioninOverlapService {
.pipe( .pipe(
tap((response) => { tap((response) => {
this.__pagination.next(response.pagination); this.__pagination.next(response.pagination);
this.__sessioninOverlaps.next(response.sessioninOverlaps); this.__duplicatedSessions.next(response.duplicatedSessions);
}) })
); );
} }
@ -108,19 +108,19 @@ export class SessioninOverlapService {
/** /**
* Get product by id * Get product by id
*/ */
getSessioninOverlapById(id: string | null): Observable<SessioninOverlap> { getDuplicatedSessionById(id: string | null): Observable<DuplicatedSession> {
return this.__sessioninOverlaps.pipe( return this.__duplicatedSessions.pipe(
take(1), take(1),
map((sessioninOverlaps) => { map((duplicatedSessions) => {
// Find the product // Find the product
const sessioninOverlap = const duplicatedSession =
sessioninOverlaps?.find((item) => item.id === id) || undefined; duplicatedSessions?.find((item) => item.id === id) || undefined;
// Update the product // Update the product
this.__sessioninOverlap.next(sessioninOverlap); this.__duplicatedSession.next(duplicatedSession);
// Return the product // Return the product
return sessioninOverlap; return duplicatedSession;
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
@ -135,27 +135,27 @@ export class SessioninOverlapService {
/** /**
* Create product * Create product
*/ */
createSessioninOverlap(): Observable<SessioninOverlap> { createDuplicatedSession(): Observable<DuplicatedSession> {
return this.sessioninOverlaps$.pipe( return this.duplicatedSessions$.pipe(
take(1), take(1),
switchMap((sessioninOverlaps) => switchMap((duplicatedSessions) =>
this._httpClient this._httpClient
.post<SessioninOverlap>( .post<DuplicatedSession>(
'api/apps/report/sessionin-overlap/product', 'api/apps/report/duplicated-session/product',
{} {}
) )
.pipe( .pipe(
map((newSessioninOverlap) => { map((newDuplicatedSession) => {
// Update the sessioninOverlaps with the new product // Update the duplicatedSessions with the new product
if (!!sessioninOverlaps) { if (!!duplicatedSessions) {
this.__sessioninOverlaps.next([ this.__duplicatedSessions.next([
newSessioninOverlap, newDuplicatedSession,
...sessioninOverlaps, ...duplicatedSessions,
]); ]);
} }
// Return the new product // Return the new product
return newSessioninOverlap; return newDuplicatedSession;
}) })
) )
) )

View File

@ -36,7 +36,7 @@ import { UserSessionService } from '../services/user-session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'sessionin-info-list', selector: 'user-session-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */

View File

@ -39,7 +39,7 @@
"Payment Log": "Manual Payment Logs", "Payment Log": "Manual Payment Logs",
"User Session": "User Session", "User Session": "User Session",
"Admin Session": "Admin Session", "Admin Session": "Admin Session",
"Sessionin Overlap": "Sessionin Overlap", "Duplicated Session": "Duplicated Session",
"Excel Log": "Excel Download Logs", "Excel Log": "Excel Download Logs",
"Loosing": "Loosing Management", "Loosing": "Loosing Management",
"Notice": "Notice", "Notice": "Notice",

View File

@ -46,7 +46,7 @@
"Modification Log": "회원수정 로그", "Modification Log": "회원수정 로그",
"Payment Log": "수동지급/회수 로그", "Payment Log": "수동지급/회수 로그",
"User Session": "로그인정보", "User Session": "로그인정보",
"Sessionin Overlap": "중복로그인", "Duplicated Session": "중복로그인",
"Admin Session": "관리자 로그인정보", "Admin Session": "관리자 로그인정보",
"Excel Log": "엑셀다운 로그", "Excel Log": "엑셀다운 로그",
"Loosing": "루징관리", "Loosing": "루징관리",