diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index f259c06..c1cb18a 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -437,11 +437,11 @@ export const appRoutes: Route[] = [ ).then((m: any) => m.SessioninOverlapModule), }, { - path: 'sessionin-admin', + path: 'admin-session', loadChildren: () => import( - 'app/modules/admin/report/sessionin-admin/sessionin-admin.module' - ).then((m: any) => m.SessioninAdminModule), + 'app/modules/admin/report/admin-session/admin-session.module' + ).then((m: any) => m.AdminSessionModule), }, { path: 'excel-log', diff --git a/src/app/mock-api/apps/report/sessionin-admin/api.ts b/src/app/mock-api/apps/report/admin-session/api.ts similarity index 64% rename from src/app/mock-api/apps/report/sessionin-admin/api.ts rename to src/app/mock-api/apps/report/admin-session/api.ts index dbab087..859f579 100644 --- a/src/app/mock-api/apps/report/sessionin-admin/api.ts +++ b/src/app/mock-api/apps/report/admin-session/api.ts @@ -1,13 +1,13 @@ import { Injectable } from '@angular/core'; import { assign, cloneDeep } from 'lodash-es'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; -import { sessioninAdmins as sessioninAdminsData } from './data'; +import { adminSessions as adminSessionsData } from './data'; @Injectable({ providedIn: 'root', }) -export class ReportSessioninAdminMockApi { - private _sessioninAdmins: any[] = sessioninAdminsData; +export class ReportAdminSessionMockApi { + private _adminSessions: any[] = adminSessionsData; /** * Constructor @@ -26,10 +26,10 @@ export class ReportSessioninAdminMockApi { */ registerHandlers(): void { // ----------------------------------------------------------------------------------------------------- - // @ SessioninAdmins - GET + // @ AdminSessions - GET // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onGet('api/apps/report/sessionin-admin/sessionin-admins', 300) + .onGet('api/apps/report/admin-session/admin-sessions', 300) .reply(({ request }) => { // Get available queries const search = request.params.get('search'); @@ -38,12 +38,12 @@ export class ReportSessioninAdminMockApi { const page = parseInt(request.params.get('page') ?? '1', 10); const size = parseInt(request.params.get('size') ?? '10', 10); - // Clone the sessioninAdmins - let sessioninAdmins: any[] | null = cloneDeep(this._sessioninAdmins); + // Clone the adminSessions + let adminSessions: any[] | null = cloneDeep(this._adminSessions); - // Sort the sessioninAdmins + // Sort the adminSessions // if (sort === 'sku' || sort === 'name' || sort === 'active') { - // sessioninAdmins.sort((a, b) => { + // adminSessions.sort((a, b) => { // const fieldA = a[sort].toString().toUpperCase(); // const fieldB = b[sort].toString().toUpperCase(); // return order === 'asc' @@ -51,15 +51,15 @@ export class ReportSessioninAdminMockApi { // : fieldB.localeCompare(fieldA); // }); // } else { - // sessioninAdmins.sort((a, b) => + // adminSessions.sort((a, b) => // order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] // ); // } // If search exists... if (search) { - // Filter the sessioninAdmins - sessioninAdmins = sessioninAdmins.filter( + // Filter the adminSessions + adminSessions = adminSessions.filter( (contact: any) => contact.name && contact.name.toLowerCase().includes(search.toLowerCase()) @@ -67,32 +67,32 @@ export class ReportSessioninAdminMockApi { } // Paginate - Start - const sessioninAdminsLength = sessioninAdmins.length; + const adminSessionsLength = adminSessions.length; // Calculate pagination details const begin = page * size; - const end = Math.min(size * (page + 1), sessioninAdminsLength); - const lastPage = Math.max(Math.ceil(sessioninAdminsLength / size), 1); + const end = Math.min(size * (page + 1), adminSessionsLength); + const lastPage = Math.max(Math.ceil(adminSessionsLength / size), 1); // Prepare the pagination object let pagination = {}; // If the requested page number is bigger than // the last possible page number, return null for - // sessioninAdmins but also send the last possible page so + // adminSessions but also send the last possible page so // the app can navigate to there if (page > lastPage) { - sessioninAdmins = null; + adminSessions = null; pagination = { lastPage, }; } else { // Paginate the results by size - sessioninAdmins = sessioninAdmins.slice(begin, end); + adminSessions = adminSessions.slice(begin, end); // Prepare the pagination mock-api pagination = { - length: sessioninAdminsLength, + length: adminSessionsLength, size: size, page: page, lastPage: lastPage, @@ -105,41 +105,39 @@ export class ReportSessioninAdminMockApi { return [ 200, { - sessioninAdmins, + adminSessions, pagination, }, ]; }); // ----------------------------------------------------------------------------------------------------- - // @ SessioninAdmin - GET + // @ AdminSession - GET // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onGet('api/apps/report/sessionin-admin/sessionin-admin') + .onGet('api/apps/report/admin-session/admin-session') .reply(({ request }) => { // Get the id from the params const id = request.params.get('id'); - // Clone the sessioninAdmins - const sessioninAdmins = cloneDeep(this._sessioninAdmins); + // Clone the adminSessions + const adminSessions = cloneDeep(this._adminSessions); - // Find the sessioninAdmin - const sessioninAdmin = sessioninAdmins.find( - (item: any) => item.id === id - ); + // Find the adminSession + const adminSession = adminSessions.find((item: any) => item.id === id); // Return the response - return [200, sessioninAdmin]; + return [200, adminSession]; }); // ----------------------------------------------------------------------------------------------------- - // @ SessioninAdmin - POST + // @ AdminSession - POST // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onPost('api/apps/report/sessionin-admin/sessionin-admin') + .onPost('api/apps/report/admin-session/admin-session') .reply(() => { - // Generate a new sessioninAdmin - const newSessioninAdmin = { + // Generate a new adminSession + const newAdminSession = { id: FuseMockApiUtils.guid(), category: '', name: 'A New User', @@ -161,58 +159,58 @@ export class ReportSessioninAdminMockApi { active: false, }; - // Unshift the new sessioninAdmin - this._sessioninAdmins.unshift(newSessioninAdmin); + // Unshift the new adminSession + this._adminSessions.unshift(newAdminSession); // Return the response - return [200, newSessioninAdmin]; + return [200, newAdminSession]; }); // ----------------------------------------------------------------------------------------------------- - // @ SessioninAdmin - PATCH + // @ AdminSession - PATCH // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onPatch('api/apps/report/sessionin-admin/sessionin-admin') + .onPatch('api/apps/report/admin-session/admin-session') .reply(({ request }) => { - // Get the id and sessioninAdmin + // Get the id and adminSession const id = request.body.id; - const sessioninAdmin = cloneDeep(request.body.sessioninAdmin); + const adminSession = cloneDeep(request.body.adminSession); - // Prepare the updated sessioninAdmin - let updatedSessioninAdmin = null; + // Prepare the updated adminSession + let updatedAdminSession = null; - // Find the sessioninAdmin and update it - this._sessioninAdmins.forEach((item, index, sessioninAdmins) => { + // Find the adminSession and update it + this._adminSessions.forEach((item, index, adminSessions) => { if (item.id === id) { - // Update the sessioninAdmin - sessioninAdmins[index] = assign( + // Update the adminSession + adminSessions[index] = assign( {}, - sessioninAdmins[index], - sessioninAdmin + adminSessions[index], + adminSession ); - // Store the updated sessioninAdmin - updatedSessioninAdmin = sessioninAdmins[index]; + // Store the updated adminSession + updatedAdminSession = adminSessions[index]; } }); // Return the response - return [200, updatedSessioninAdmin]; + return [200, updatedAdminSession]; }); // ----------------------------------------------------------------------------------------------------- - // @ SessioninAdmin - DELETE + // @ AdminSession - DELETE // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onDelete('api/apps/report/sessionin-admin/sessionin-admin') + .onDelete('api/apps/report/admin-session/admin-session') .reply(({ request }) => { // Get the id const id = request.params.get('id'); - // Find the sessioninAdmin and delete it - this._sessioninAdmins.forEach((item, index) => { + // Find the adminSession and delete it + this._adminSessions.forEach((item, index) => { if (item.id === id) { - this._sessioninAdmins.splice(index, 1); + this._adminSessions.splice(index, 1); } }); diff --git a/src/app/mock-api/apps/report/sessionin-admin/data.ts b/src/app/mock-api/apps/report/admin-session/data.ts similarity index 97% rename from src/app/mock-api/apps/report/sessionin-admin/data.ts rename to src/app/mock-api/apps/report/admin-session/data.ts index 28bd243..c8320da 100644 --- a/src/app/mock-api/apps/report/sessionin-admin/data.ts +++ b/src/app/mock-api/apps/report/admin-session/data.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -export const sessioninAdmins = [ +export const adminSessions = [ { id: '1', rank: '본사', diff --git a/src/app/mock-api/common/navigation/data.ts b/src/app/mock-api/common/navigation/data.ts index 4654cbc..1e4f359 100644 --- a/src/app/mock-api/common/navigation/data.ts +++ b/src/app/mock-api/common/navigation/data.ts @@ -329,11 +329,11 @@ export const defaultNavigation: FuseNavigationItem[] = [ link: '/report/sessionin-overlap', }, { - id: 'report.sessionin-admin', - title: 'Sessionin Admin', + id: 'report.admin-session', + title: 'Admin Session', type: 'basic', icon: 'heroicons_outline:academic-cap', - link: '/report/sessionin-admin', + link: '/report/admin-session', }, { id: 'report.excel-log', diff --git a/src/app/mock-api/index.ts b/src/app/mock-api/index.ts index 60ef8ad..ed07b09 100644 --- a/src/app/mock-api/index.ts +++ b/src/app/mock-api/index.ts @@ -60,7 +60,7 @@ import { ReportModificationLogMockApi } from './apps/report/modification-log/api import { ReportPaymentLogMockApi } from './apps/report/payment-log/api'; import { ReportSessioninInfoMockApi } from './apps/report/sessionin-info/api'; import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api'; -import { ReportSessioninAdminMockApi } from './apps/report/sessionin-admin/api'; +import { ReportAdminSessionMockApi } from './apps/report/admin-session/api'; import { ReportExcelLogMockApi } from './apps/report/excel-log/api'; import { ReportLoosingMockApi } from './apps/report/loosing/api'; import { BoardNoticeMockApi } from './apps/board/notice/api'; @@ -133,7 +133,7 @@ export const mockApiServices = [ ReportPaymentLogMockApi, ReportSessioninInfoMockApi, ReportSessioninOverlapMockApi, - ReportSessioninAdminMockApi, + ReportAdminSessionMockApi, ReportExcelLogMockApi, ReportLoosingMockApi, BoardNoticeMockApi, diff --git a/src/app/modules/admin/report/sessionin-admin/sessionin-admin.module.ts b/src/app/modules/admin/report/admin-session/admin-session.module.ts similarity index 91% rename from src/app/modules/admin/report/sessionin-admin/sessionin-admin.module.ts rename to src/app/modules/admin/report/admin-session/admin-session.module.ts index e22d1e3..b086e24 100644 --- a/src/app/modules/admin/report/sessionin-admin/sessionin-admin.module.ts +++ b/src/app/modules/admin/report/admin-session/admin-session.module.ts @@ -24,14 +24,14 @@ import { SharedModule } from 'app/shared/shared.module'; import { COMPONENTS } from './components'; -import { sessioninAdminRoutes } from './sessionin-admin.routing'; +import { adminSessionRoutes } from './admin-session.routing'; @NgModule({ declarations: [COMPONENTS], imports: [ TranslocoModule, SharedModule, - RouterModule.forChild(sessioninAdminRoutes), + RouterModule.forChild(adminSessionRoutes), MatButtonModule, MatFormFieldModule, @@ -51,4 +51,4 @@ import { sessioninAdminRoutes } from './sessionin-admin.routing'; MatMomentDateModule, ], }) -export class SessioninAdminModule {} +export class AdminSessionModule {} diff --git a/src/app/modules/admin/report/sessionin-admin/sessionin-admin.routing.ts b/src/app/modules/admin/report/admin-session/admin-session.routing.ts similarity index 71% rename from src/app/modules/admin/report/sessionin-admin/sessionin-admin.routing.ts rename to src/app/modules/admin/report/admin-session/admin-session.routing.ts index 493ade7..1ca274b 100644 --- a/src/app/modules/admin/report/sessionin-admin/sessionin-admin.routing.ts +++ b/src/app/modules/admin/report/admin-session/admin-session.routing.ts @@ -3,15 +3,15 @@ import { Route } from '@angular/router'; import { ListComponent } from './components/list.component'; import { ViewComponent } from '../../member/user/components/view.component'; -import { SessioninAdminsResolver } from './resolvers/sessionin-admin.resolver'; +import { AdminSessionsResolver } from './resolvers/admin-session.resolver'; import { UserResolver } from '../../member/user/resolvers/user.resolver'; -export const sessioninAdminRoutes: Route[] = [ +export const adminSessionRoutes: Route[] = [ { path: '', component: ListComponent, resolve: { - sessioninAdmins: SessioninAdminsResolver, + adminSessions: AdminSessionsResolver, }, }, { diff --git a/src/app/modules/admin/report/sessionin-admin/components/index.ts b/src/app/modules/admin/report/admin-session/components/index.ts similarity index 100% rename from src/app/modules/admin/report/sessionin-admin/components/index.ts rename to src/app/modules/admin/report/admin-session/components/index.ts diff --git a/src/app/modules/admin/report/sessionin-admin/components/list.component.html b/src/app/modules/admin/report/admin-session/components/list.component.html similarity index 96% rename from src/app/modules/admin/report/sessionin-admin/components/list.component.html rename to src/app/modules/admin/report/admin-session/components/list.component.html index 9e8098a..6eb58fd 100644 --- a/src/app/modules/admin/report/sessionin-admin/components/list.component.html +++ b/src/app/modules/admin/report/admin-session/components/list.component.html @@ -99,8 +99,8 @@