Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
80a7bd1
add: set .gitignore and eslint
sunhpark42 Dec 9, 2020
6776e4a
docs: create README.md
sunhpark42 Dec 9, 2020
39bae59
docs: update README.md
sunhpark42 Dec 9, 2020
1820754
docs: update README.md
sunhpark42 Dec 9, 2020
cfda41c
docs: update README.md
sunhpark42 Dec 9, 2020
98d46b3
feat: create MenuView module
sunhpark42 Dec 9, 2020
fc816c4
feat: add Menu Buttons on top
sunhpark42 Dec 9, 2020
7f57434
feat: add div in MenuBottonList for subview
sunhpark42 Dec 9, 2020
85f2737
feat: add Station Manager subView
sunhpark42 Dec 9, 2020
d78a2f2
feat: add placeholder to Station Name Input Form
sunhpark42 Dec 9, 2020
caf32b9
feat: add LineMangerView
sunhpark42 Dec 9, 2020
4e90040
feat: add selectBox for North, South bound lane to LineManagerView
sunhpark42 Dec 9, 2020
544b08d
feat: add SectionManagerView method
sunhpark42 Dec 9, 2020
421d183
feat: add MapPrintManagerView method
sunhpark42 Dec 9, 2020
c31e5c4
feat: create MenuController for Menu Button Click events
sunhpark42 Dec 9, 2020
efec48c
docs: update README.md
sunhpark42 Dec 9, 2020
b22c5c4
docs: update README.md
sunhpark42 Dec 9, 2020
c1741d0
feat, refactor: use LocalStorage value to draw StationMangerView
sunhpark42 Dec 9, 2020
efb5656
fix: delete id in add button in LineMangerView
sunhpark42 Dec 9, 2020
8ca1238
docs: update README.md
sunhpark42 Dec 9, 2020
859c08e
feat, refactor: use LocalStorage value to draw LineMangerView
sunhpark42 Dec 10, 2020
538e3d3
feat, refactor: use LocalStorage value to draw SectionMangerView
sunhpark42 Dec 10, 2020
30feeba
feat, refactor: use LocalStorage value to draw MapPrintManagerView
sunhpark42 Dec 10, 2020
ec4961e
docs: update README.md
sunhpark42 Dec 10, 2020
0d06efa
feat, refactor: create StationManagerView module
sunhpark42 Dec 10, 2020
bf7f042
feat: add EventListener to StationMangerController
sunhpark42 Dec 10, 2020
c94229c
feat: check Station Name
sunhpark42 Dec 11, 2020
83586d6
feat: add id and class name to input and button
sunhpark42 Dec 11, 2020
0ef952a
docs: update README.md
sunhpark42 Dec 11, 2020
28f4e2f
feat: request Alert and Update Input View if Invalid Name
sunhpark42 Dec 11, 2020
153c878
docs: update README.md
sunhpark42 Dec 11, 2020
2c8064b
feat: alert Invalid Station Name
sunhpark42 Dec 11, 2020
6c990bb
feat: add Station to Station List
sunhpark42 Dec 11, 2020
4c51e68
docs: update README.md
sunhpark42 Dec 11, 2020
4060eea
feat: check station in Stations for delete
sunhpark42 Dec 11, 2020
6cfd37f
feat: delete Station from Stations
sunhpark42 Dec 11, 2020
cf677e9
docs: update README.md
sunhpark42 Dec 11, 2020
121041f
feat: confirm delete action
sunhpark42 Dec 11, 2020
d1ad95c
feat: delete or not by User's Choice
sunhpark42 Dec 11, 2020
ea1b80d
docs: update README.md
sunhpark42 Dec 11, 2020
f282608
style: change method name initial from upper-case to lower-case
sunhpark42 Dec 11, 2020
55b6354
feat: delete Action when Delete Canceled
sunhpark42 Dec 11, 2020
d4f14ca
fix: correct Name Error
sunhpark42 Dec 11, 2020
43764c3
fix: create LineManagerView
sunhpark42 Dec 11, 2020
5cdd2fb
feat: add dataset to line-delete-button
sunhpark42 Dec 11, 2020
8027615
feat: add Event Handler
sunhpark42 Dec 11, 2020
0c93f1d
feat: check Line Name is Valid
sunhpark42 Dec 11, 2020
4d30ac8
feat: alert and reload input view if input error
sunhpark42 Dec 11, 2020
a70cef1
fix: edit RegExp of is SingleKoreanAlpabet as number included string …
sunhpark42 Dec 11, 2020
ff0294f
feat: check input-line-start is same with input-line-end
sunhpark42 Dec 11, 2020
0a81f85
feat: add new Line to Lines
sunhpark42 Dec 11, 2020
dbe2605
feat: set localStorage 'Lines' by new Json
sunhpark42 Dec 11, 2020
e271efa
feat: alert error and if not call add, reload function
sunhpark42 Dec 11, 2020
004507c
docs: update README.md
sunhpark42 Dec 11, 2020
110178f
feat: delete line from lines when button clicked
sunhpark42 Dec 11, 2020
ef32cc0
feat: add Confirm delete message
sunhpark42 Dec 11, 2020
8849798
feat: add Alert message for name input error
sunhpark42 Dec 11, 2020
65824cb
docs: update README.md
sunhpark42 Dec 11, 2020
3301029
feat: create SectionMangerView and import to MenuView
sunhpark42 Dec 11, 2020
7ff5cbd
feat: add Alert Message and Confirm Message
sunhpark42 Dec 11, 2020
dc4154b
feat: add Id and Class Name into Tag
sunhpark42 Dec 11, 2020
9c0876f
feat: add EventListener to SectionMangerController
sunhpark42 Dec 11, 2020
6cc6cb0
feat: show each Section Info when Section Menu Button Clicked
sunhpark42 Dec 11, 2020
141294d
feat: check Index is Valid
sunhpark42 Dec 11, 2020
d5553ff
feat: add station to line
sunhpark42 Dec 11, 2020
50133e7
feat: delete station from lines only when lines' elements number is m…
sunhpark42 Dec 11, 2020
26273f7
faet: create MapPrintManger and import to MenuView
sunhpark42 Dec 11, 2020
38cc3a5
docs: update README.md
sunhpark42 Dec 11, 2020
42fc65f
docs: update README.md
sunhpark42 Dec 11, 2020
e62d826
feat: link Modules for complete Service
sunhpark42 Dec 12, 2020
434fec7
docs: update README.md
sunhpark42 Dec 12, 2020
76dce36
feat: set default value of Lines and Stations in Local Storage
sunhpark42 Dec 14, 2020
3b72c09
docs: update README.md
sunhpark42 Dec 14, 2020
2ad26ff
docs: update README.md
sunhpark42 Dec 14, 2020
f5f725e
feat: set Default Value and change Data Structure of Staions and Lines
sunhpark42 Dec 14, 2020
445cf5c
feat: edit StationManger Code by changed Data Structure
sunhpark42 Dec 14, 2020
6dec8a6
feat: edit LineManger Code by changed Data Structure
sunhpark42 Dec 14, 2020
7c6e5fd
fix: 이벤트 리스너가 중복되어 액션이 여러번 발생하는 문제 해결
sunhpark42 Dec 14, 2020
ae0bbc5
feat: edit MapPrintManager Code by changed Data Structure
sunhpark42 Dec 14, 2020
dce0e47
feat: edit SectionManager Code by changed Data Structure
sunhpark42 Dec 14, 2020
49fcb3e
feat: check each Line has 2 more stations if delete
sunhpark42 Dec 14, 2020
a47ce3f
docs: update README.md
sunhpark42 Dec 14, 2020
3df7164
fix: 역 추가 및 삭제시 정보 반영 안되는 문제 해결
sunhpark42 Dec 14, 2020
ec002a0
feat: add Error Msg for StationManager
sunhpark42 Dec 14, 2020
6b65539
feat: show Error Msg for each Error
sunhpark42 Dec 14, 2020
9ddf96b
feat: add Error Msg for Line Input Error
sunhpark42 Dec 15, 2020
33831da
feat: add Error Msg for Delete Cancel
sunhpark42 Dec 15, 2020
3d4710a
feat: add Errom Msg for SectionManager
sunhpark42 Dec 15, 2020
10b7f12
feat: delete unnecessary module import
sunhpark42 Dec 15, 2020
84984d1
docs: update README.md
sunhpark42 Dec 15, 2020
db447b8
feat: add only Number Error of Station Input
sunhpark42 Dec 15, 2020
97d6398
fix: load Stations Data on Station Delete Function
sunhpark42 Dec 15, 2020
3306ff3
feat: add Error when Station Name consists of only Number
sunhpark42 Dec 15, 2020
7749ccf
feat: add Error when Line Name consists of only Number
sunhpark42 Dec 15, 2020
69a9391
feat: delete always init local value code
sunhpark42 Dec 15, 2020
bc4e30a
refactor: 메서드 이름 수정 및 메서드 간 순서 조정
sunhpark42 Dec 15, 2020
968bac6
refactor: 메서드 이름 수정 및 메서드 간 순서 조정
sunhpark42 Dec 15, 2020
c84bd05
refactor: 메서드 이름 수정 및 메서드 간 순서 조정
sunhpark42 Dec 15, 2020
9593031
refactor: 메서드 이름 수정 및 메서드 간 순서 조정
sunhpark42 Dec 15, 2020
de514f0
refactor: 메서드 이름 수정 및 메서드 간 순서 조정
sunhpark42 Dec 15, 2020
0673d1d
feat: 로컬 스토리지에 저장된 값이 {} (빈배열)일 때 Default 설정
sunhpark42 Dec 15, 2020
9ff2aa0
Merge pull request #1 from sunhpark42/feature/refactor
sunhpark42 Dec 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'airbnb-base',
],
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
},
};
151 changes: 151 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,node,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,node,vscode

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env*.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# End of https://www.toptal.com/developers/gitignore/api/macos,node,vscode
142 changes: 142 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# 🚇 지하철 노선도 미션

## 📄 미션 소개
지하철 역, 노선, 구간을 관리 하고 조회하는 서비스

## ⚙️ 실행 방법
```
git clone https://github.com/sunhpark42/javascript-subway-map-precourse.git; cd javascript-subway-map-precourse; git checkout sunhpark42; npx http-server
```
* 만약 http-server 가 없다면 `npm install http-server`를 설치하고 재 시행.

## 💻 개발
### 개발기간
* 2020.12.09 - 2020.12.15
### 사용 언어
<p align="left">
<img src="https://img.shields.io/badge/html-HTML5-orange?logo=HTML5"/>
<img src="https://img.shields.io/badge/javascript-ES6+-yellow?logo=javascript"/>
</p>

## ⚒ 기능 명세
### 메뉴
1. 이벤트 관리
- [x] '1. 역 관리' 버튼을 클릭하면 역 관리 뷰를 요청한다.
- [x] '2. 노선 관리' 버튼을 클릭하면 노선 관리 뷰를 요청한다.
- [x] '3. 구간 관리' 버튼을 클릭하면 구간 관리 뷰를 요청한다.
- [x] '4. 지하철 노선도 출력' 버튼을 클릭하면 지하철 노선도 출력 뷰를 요청한다.
2. 화면 표시
- [x] 역 관리 뷰를 표시한다.
- [x] 노선 관리 뷰를 표시한다.
- [x] 구간 관리 뷰를 표시한다.
- [x] 지하철 노선도 출력 뷰를 표시한다.

### 지하철 역 관리 기능
1. 이벤트 관리 (Controller)
- [x] '역 추가' 버튼을 클릭하면 역 목록 추가와, 역 목록 화면 갱신을 요청한다.
- [x] 예외 사항에 해당하는 경우, 에러메세지 출력 및 역 입력 화면 갱신을 요청하고, 추가 및 목록 갱신은 하지 않는다.
- [x] '삭제' 버튼을 클릭하면 삭제 여부를 확인하는 창을 요청한다.
- [x] 삭제 여부를 확인하는 창에서 '확인' 버튼을 누르면 역 목록에서 해당 역 삭제와, 역 목록 화면 갱신을 요청한다.
- [x] 삭제 여부를 확인하는 창에서 '취소' 버튼을 누르면 아무것도 하지않는다.
2. 화면 표시 (View)
- [x] 전체 화면을 표시한다 (역 입력 및 역 목록)
- [x] 역 입력 화면을 갱신한다.
- [x] 역 목록 화면을 갱신한다.
- [x] 입력된 값이 잘못되었음을 경고하는 창을 띄운다.
- [x] 삭제 여부를 확인하는 창을 띄운다.
- [x] 확인 및 취소 버튼
3. 주요 기능 (Model)
- [x] 사용자가 입력한 역 이름이 유효한지 확인한다.
- [x] 예외 처리
1. 역 이름이 2자 미만인 경우 예외처리.
2. 역 이름에 공백이 있는 경우 예외처리
3. 역 이름에 모음이나 자음만으로 이루어져 있는 부분이 있을 경우 예외처리.
4. 역 이름에 영문이 있는 경우 예외처리(한국 지하철로 가정함)
5. 역 이름에 특수 문자가 있는 경우 예외처리
- [x] 기존 역 목록에 중복된 이름이 있는지 확인한다.
- [x] 사용자가 삭제하기로 선택한 역이 노선에 있는지 확인한다.
- [x] 역을 역 목록에 추가한다.
- [x] 해당 역이 포함된 노선이 최소 역 조건 (2개 이상)을 만족하는지 확인
- [x] 역을 역 목록에서 삭제한다.
- [x] 역을 해당 역이 포함된 노선에서 삭제한다.
- [x] 고려해야 할 사항
- 만약, 역이 하나도 없다면 어떻게 할 것인지?
- 최소 역의 개수를 지정할 것인지
- 삭제했을 때 각 노선에 2개 이하가 되는 곳이 있으면 삭제를 하지 않을 것인지. => 채택
- 삭제가 되지 않는 경우 경고 창을 띄울 것인지? => 채택

### 지하철 노선 관리 기능
1. 이벤트 관리 (Controller)
- [x] '노선 추가' 버튼을 클릭하면 노선 목록 추가와, 노선 목록 화면 갱신을 요청한다.
- [x] '삭제' 버튼을 클릭하면 삭제 여부를 확인하는 창을 요청한다.
- [x] 삭제 여부를 확인하는 창에서 '확인' 버튼을 누르면 노선 목록에서 해당 노선 삭제와, 노선 목록 화면 갱신을 요청한다.
- [x] 삭제 여부를 확인하는 창에서 '취소' 버튼을 누르면 아무것도 하지 않는다.
2. 화면 표시 (View)
- [x] 전체 화면을 표시한다. (노선 입력 및 노선 목록)
- [x] 노선 입력 화면을 갱신한다.
- [x] 노선 목록 화면을 갱신한다.
- [x] 입력된 값이 잘못되었음을 경고하는 창을 띄운다.
- [x] 삭제 여부를 확인하는 창을 띄운다.
* 확인 및 취소 버튼
3. 주요 기능 (Model)
- [x] 사용자가 입력한 노선 이름이 유효한지 확인한다.
- [x] 예외 처리
1. 노선 이름이 2자 미만인 경우 예외처리
2. 노선 이름에 공백이 있는 경우 예외처리
3. 노선 이름에 모음이나 자음만으로 이루어져 있는 부분이 있을 경우 예외처리
4. 노선 이름에 영문이 있는 경우 예외처리 (한국 지하철로 가정함)
5. 노선 이름에 특수 문자가 있는 경우 예외처리
- [x] 예외 사항에 해당하는 경우 역 입력 화면 갱신을 요청하고, 추가 및 목록 갱신은 하지 않는다.
- [x] 기존 노선 목록에 중복된 이름이 있는지 확인한다.
- [x] 상행 종점역과 하행 종점역이 같은 경우 예외처리 한다. (노선에 역이 하나뿐인 경우 예외처리)
- [x] 노선을 노선 목록에 추가한다.
- [x] 노선을 노선 목록에서 삭제한다.
- [x] 해당 노선에 대한 정보를 해당 노선에 포함되어 있던 역의 정보에서 삭제한다.

### 지하철 구간 관리 기능
1. 이벤트 관리 (Controller)
- [x] 각 '노선' 버튼을 클릭하면 해당 노선 관리 화면을 띄워줄 것을 요청한다.
- [x] 노선 관리 화면에서 '등록' 버튼을 클릭할 경우 구간 목록 추가와, 구간 목록 화면 갱신을 요청한다.
- [x] 노선 관리 화면에서 '노선에서 제거' 버튼을 클릭할 경우 삭제 여부를 확인하는 창을 요청한다.
- [x] 삭제 여부를 확인하는 창에서 '확인' 버튼을 누르면 노선 목록에서 해당 구간 삭제와, 구간 목록 화면 갱신을 요청한다.
- [x] 삭제 여부를 확인하는 창에서 '취소' 버튼을 누르면 구간 입력 화면 갱신을 요청한다.
2. 화면 표시 (View)
- [x] 수정할 노선 화면을 표시한다.
- [x] 노선 관리 화면을 표시한다.
- [x] 노선 관리 화면을 갱신한다.
- [x] 입력된 값이 잘못되었음을 경고하는 창을 띄운다.
- [x] 삭제 여부를 확인하는 창을 띄운다.
* 확인 및 취소 버튼 추가
3. 주요 기능 (Model)
- [x] 사용자가 입력한 순서 값이 유효한지 확인한다.
- [x] 예외 처리
1. 순서가 음수인 경우 예외처리
2. 순서가 숫자가 아닌 경우 예외처리
3. 순서가 범위를 벗어나는 경우 예외처리 (예. 2까지 있는데 4에 추가하는 경우)
- [x] 기존 노선에 중복된 이름이 있는지 확인한다.(중복된 이름이 있는 경우 예외처리)
- [x] 노선에 포함된 역이 두개 이하인지 확인한다.
- [x] 노선에 역을 추가한다.
- [x] 노선에서 역을 삭제한다.

### 지하철 노선도 관리 기능
1. 화면표시 (View)
- [x] 역 목록을 출력한다.

### 기능 연결
- [x] 기능 연결

### 기타
- [x] 로컬 스토리지에 값이 없는 경우 default 값 삽입, 있는 경우 기존의 스토리지 값을 이용.
- 이경우 둘 중 하나에 값이 없는 경우에 모두 디폴트 값으로 설정하도록 함.
- 역, 노선 내의 역 목록간의 연결성 유지를 위함.
- [x] 역 - 노선 간 의존성 추가하기
- [x] 역이 삭제될 경우 해당 역이 포함된 노선에서 역 삭제
- [x] 각 상황별 에러 메세지 추가

## ✔️ 커밋 규칙
* feat : 새로운 기능 추가
* fix : 버그 수정
* docs : 문서의 수정
* style : 코드의 수정 없이 스타일만 변경
* refactor : 코드를 리펙토링
* test : Test 관련한 코드의 추가, 수정
Loading