From 0f9d7148d9bcc6d97e86c7fdd94630c54f41a710 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Sun, 17 Jul 2022 05:00:07 +0000 Subject: [PATCH] bug fix --- src/app/mock-api/apps/board/notice/api.ts | 2 +- src/app/mock-api/apps/board/notice/data.ts | 13 +- .../notice/components/list.component.html | 61 ++++-- .../board/notice/components/list.component.ts | 2 +- .../components/registration.component.html | 2 - .../components/registration.component.ts | 183 ------------------ .../notice/components/view.component.html | 2 +- .../admin/board/notice/models/notice.ts | 1 + .../board/notice/resolvers/notice.resolver.ts | 4 +- .../{service => services}/notice.service.ts | 10 +- .../popup/components/list.component.html | 12 +- .../popup/components/view.component.html | 2 +- 12 files changed, 68 insertions(+), 226 deletions(-) delete mode 100644 src/app/modules/admin/board/notice/components/registration.component.html delete mode 100644 src/app/modules/admin/board/notice/components/registration.component.ts rename src/app/modules/admin/board/notice/{service => services}/notice.service.ts (92%) diff --git a/src/app/mock-api/apps/board/notice/api.ts b/src/app/mock-api/apps/board/notice/api.ts index af86cb9..5974981 100644 --- a/src/app/mock-api/apps/board/notice/api.ts +++ b/src/app/mock-api/apps/board/notice/api.ts @@ -185,7 +185,7 @@ export class BoardNoticeMockApi { // Update the notice notices[index] = assign({}, notices[index], notice); - // Store the updated notice + // Store the updated Notice updatedNotice = notices[index]; } }); diff --git a/src/app/mock-api/apps/board/notice/data.ts b/src/app/mock-api/apps/board/notice/data.ts index 599fae5..f416a0e 100644 --- a/src/app/mock-api/apps/board/notice/data.ts +++ b/src/app/mock-api/apps/board/notice/data.ts @@ -5,19 +5,10 @@ export const notices = [ idx: 80, site: '', title: - '**게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전,후 확인사항 대한 공지사항**', + '게임멈춤,튕기는 현상및 계좌문의시 확인및 입금전후 확인사항 대한 공지사항', writer: '관리자', writeDate: '2021-10-25 02:25', - views: 135, - state: '노출', - }, - { - idx: 99, - site: 'All', - title: '-계좌등록안내-', - writer: '관리자', - writeDate: '2021-06-08 00:46', - views: 7, + views: 136, state: '노출', }, ]; diff --git a/src/app/modules/admin/board/notice/components/list.component.html b/src/app/modules/admin/board/notice/components/list.component.html index d857c70..d6f8e43 100644 --- a/src/app/modules/admin/board/notice/components/list.component.html +++ b/src/app/modules/admin/board/notice/components/list.component.html @@ -36,6 +36,43 @@ --> + 작성자 @@ -139,7 +176,7 @@ > - - - - - - - - diff --git a/src/app/modules/admin/board/notice/components/list.component.ts b/src/app/modules/admin/board/notice/components/list.component.ts index 017ac03..812f993 100644 --- a/src/app/modules/admin/board/notice/components/list.component.ts +++ b/src/app/modules/admin/board/notice/components/list.component.ts @@ -32,7 +32,7 @@ import { FuseConfirmationService } from '@fuse/services/confirmation'; import { User } from '../../../member/user/models/user'; import { Notice } from '../models/notice'; import { NoticePagination } from '../models/notice-pagination'; -import { NoticeService } from '../service/notice.service'; +import { NoticeService } from '../services/notice.service'; import { Router } from '@angular/router'; @Component({ diff --git a/src/app/modules/admin/board/notice/components/registration.component.html b/src/app/modules/admin/board/notice/components/registration.component.html deleted file mode 100644 index e13f190..0000000 --- a/src/app/modules/admin/board/notice/components/registration.component.html +++ /dev/null @@ -1,2 +0,0 @@ - -
공지사항 등록
diff --git a/src/app/modules/admin/board/notice/components/registration.component.ts b/src/app/modules/admin/board/notice/components/registration.component.ts deleted file mode 100644 index a6c0c0c..0000000 --- a/src/app/modules/admin/board/notice/components/registration.component.ts +++ /dev/null @@ -1,183 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - ViewChild, - ViewEncapsulation, -} from '@angular/core'; -import { - FormBuilder, - FormControl, - FormGroup, - Validators, -} from '@angular/forms'; -import { MatCheckboxChange } from '@angular/material/checkbox'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { - debounceTime, - map, - merge, - Observable, - Subject, - switchMap, - takeUntil, -} from 'rxjs'; -import { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { User } from 'app/modules/admin/member/user/models/user'; -import { UserService } from 'app/modules/admin/member/user/services/user.service'; - -@Component({ - selector: 'notice-registration', - templateUrl: './registration.component.html', - styles: [ - /* language=SCSS */ - ` - .inventory-grid { - grid-template-columns: 48px auto 40px; - - @screen sm { - grid-template-columns: 48px auto 112px 72px; - } - - @screen md { - grid-template-columns: 48px 112px auto 112px 72px; - } - - @screen lg { - grid-template-columns: 48px 112px auto 112px 96px 96px 72px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - isLoading = false; - searchInputControl = new FormControl(); - selectedProductForm!: FormGroup; - selectedUser?: User; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _userService: UserService - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - this.selectedProductForm = this._formBuilder.group({ - id: [''], - signinId: [{ value: '', disabled: true }], - signinPw: [{ value: '' }], - exchangePw: [''], - description: [''], - tags: [[]], - nickname: [{ value: '', disabled: true }], - ownCash: [''], - phoneNumber: [''], - level: [''], - status: [''], - isExcahngeMoney: [''], - bankname: [''], - accountNumber: [''], - accountHolder: [''], - comp: [''], - coupon: [''], - recommender: [{ value: '', disabled: true }], - changeSite: [''], - recommendCount: [''], - hodingGameMoney: [{ value: '0', disabled: true }], - memo: [''], - bacaraRate: [], - rulletRate: [], - dragonRate: [], - etcRate: [], - slotRate: [], - casinoRusingRate: [], - slotRusingRate: [], - }); - - // Get the User - this._userService.user$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((user: User | undefined) => { - if (!user) { - return; - } - this.selectedUser = user; - - this.selectedProductForm.patchValue(user); - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - /* this.user$ = this._userService.user$; */ - } - - /** - * After view init - */ - ngAfterViewInit(): void {} - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - // ----------------------------------------------------------------------------------------------------- - // @ Private methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Create product - */ - __createProduct(): void {} - - /** - * Toggle product details - * - * @param productId - */ - __toggleDetails(productId: string): void {} - - /** - * Track by function for ngFor loops - * - * @param index - * @param item - */ - __trackByFn(index: number, item: any): any { - return item.id || index; - } -} diff --git a/src/app/modules/admin/board/notice/components/view.component.html b/src/app/modules/admin/board/notice/components/view.component.html index 4e4f148..07b309a 100644 --- a/src/app/modules/admin/board/notice/components/view.component.html +++ b/src/app/modules/admin/board/notice/components/view.component.html @@ -1,2 +1,2 @@ -
팝업-상세page
+
고객센터-상세page
diff --git a/src/app/modules/admin/board/notice/models/notice.ts b/src/app/modules/admin/board/notice/models/notice.ts index c405749..c322533 100644 --- a/src/app/modules/admin/board/notice/models/notice.ts +++ b/src/app/modules/admin/board/notice/models/notice.ts @@ -1,4 +1,5 @@ export interface Notice { + id?: string; idx?: number; site?: string; title?: string; diff --git a/src/app/modules/admin/board/notice/resolvers/notice.resolver.ts b/src/app/modules/admin/board/notice/resolvers/notice.resolver.ts index 02c519f..fb5b3b5 100644 --- a/src/app/modules/admin/board/notice/resolvers/notice.resolver.ts +++ b/src/app/modules/admin/board/notice/resolvers/notice.resolver.ts @@ -9,7 +9,7 @@ import { catchError, Observable, throwError } from 'rxjs'; import { Notice } from '../models/notice'; import { NoticePagination } from '../models/notice-pagination'; -import { NoticeService } from '../service/notice.service'; +import { NoticeService } from '../services/notice.service'; @Injectable({ providedIn: 'root', @@ -34,7 +34,7 @@ export class NoticeResolver implements Resolve { route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Observable { - return this._noticeService.getNoticeById(route.paramMap.get('title')).pipe( + return this._noticeService.getNoticeById(route.paramMap.get('id')).pipe( // Error here means the requested product is not available catchError((error) => { // Log the error diff --git a/src/app/modules/admin/board/notice/service/notice.service.ts b/src/app/modules/admin/board/notice/services/notice.service.ts similarity index 92% rename from src/app/modules/admin/board/notice/service/notice.service.ts rename to src/app/modules/admin/board/notice/services/notice.service.ts index b873a5a..a8a52a8 100644 --- a/src/app/modules/admin/board/notice/service/notice.service.ts +++ b/src/app/modules/admin/board/notice/services/notice.service.ts @@ -104,14 +104,12 @@ export class NoticeService { /** * Get product by id */ - getNoticeById(title: string | null): Observable { + getNoticeById(id: string | null): Observable { return this.__notices.pipe( take(1), map((notices) => { // Find the product - const notice = - notices?.find((item) => !!item && !!item.title === !!title) || - undefined; + const notice = notices?.find((item) => item.id === id) || undefined; // Update the product this.__notice.next(notice); @@ -121,9 +119,7 @@ export class NoticeService { }), switchMap((product) => { if (!product) { - return throwError( - 'Could not found product with id of ' + title + '!' - ); + return throwError('Could not found product with id of ' + id + '!'); } return of(product); diff --git a/src/app/modules/admin/board/popup/components/list.component.html b/src/app/modules/admin/board/popup/components/list.component.html index 68c5687..af2d2b2 100644 --- a/src/app/modules/admin/board/popup/components/list.component.html +++ b/src/app/modules/admin/board/popup/components/list.component.html @@ -15,19 +15,19 @@
-
공지사항-상세page
+
팝업-상세page