당직근무 0.15.4 (웹 2026-11-25.8): 근무 순서 이름 줄마다 표시 고르기
사용자 지시(2026-11-25): 근무 순서 이름 창 위쪽의 공통 달력에 보일 것 하나로 하지 말고 이름 줄마다 고르게 할 것. - 근무표(rotation)에 nameModes를 더했다. 순서와 같은 길이이고 값은 both·name·shift 또는 빈 글자(예전 공통 선택 nameDisplay를 따름). - 앱·웹 이름 창: 줄마다 이름 칸 옆에 둘 다·이름만·근무만. 공통 선택 칸은 뺐다. 웹은 비회원도 고를 수 있다. - 달력 칸·위젯·오늘 카드·다른 달력 반영·구독 제목이 줄마다 고른 대로 보인다(Schedule.nameModeOn, WorkPlan.nameModeOn, name_mode_on). - 서버: validate_rotation_name_modes, 0.15.0~0.15.3 앱이 nameModes 없이 저장해도 이름이 있고 길이가 같으면 보존, 소속 공유에는 넣지 않음. - 기초 설정에서 근무 종류만 바꾸면(길이 같음) 이름과 표시를 남긴다. - 앱 0.15.4 / 설치 번호 28. APK 876810바이트, SHA-256 05d64c0b57c9817719d6b067fc7c6e7a3a6260c78b05ff02ecb78aa6b2e009c3
This commit is contained in:
1 parent
5f1b5b076c
commit
f7aaa68fd0
26 files changed
+244
-88
No files matched your search
+19
-5
@@ -73,13 +73,27 @@ def validate_rotation_names(names, size):
|
||||
return result if any(result) else []
|
||||
|
||||
|
||||
def validate_rotation_name_modes(modes, size, names=None):
|
||||
"""이름 줄마다 고른 달력 표시(0.15.4): 순서 길이와 같은 목록이고 값은 shift·name·both 또는 빈 글자(예전 공통 선택을 따름).
|
||||
이름이 하나도 없거나 모두 빈 글자면 빈 목록으로 저장한다. names가 None이면 이번 요청에 이름이 없어 이름 검사는 건너뛴다."""
|
||||
if not isinstance(modes, list) or len(modes) != size or any(mode not in ('',) + NAME_DISPLAYS for mode in modes):
|
||||
raise ValueError('근무 순서 이름의 표시 방법을 확인해 주세요.')
|
||||
if names is not None and not names:
|
||||
return []
|
||||
return modes if any(modes) else []
|
||||
|
||||
|
||||
def preserve_rotation_names(kind, data, current):
|
||||
"""구버전 앱은 근무 순서를 이름 없이 저장한다. 순서 길이가 그대로면 넣어 둔 이름을 지우지 않는다."""
|
||||
if kind != 'rotation' or 'names' in data or not current:
|
||||
"""구버전 앱은 근무 순서를 이름 없이 저장한다. 순서 길이가 그대로면 넣어 둔 이름을 지우지 않는다.
|
||||
줄마다 고른 표시(nameModes)를 모르는 0.15.0~0.15.3 앱도 같은 방법으로 지우지 않게 한다."""
|
||||
if kind != 'rotation' or not current:
|
||||
return
|
||||
saved = json.loads(current['data']).get('names')
|
||||
if isinstance(saved, list) and saved and len(saved) == len(data.get('pattern', [])):
|
||||
data['names'] = saved
|
||||
saved = json.loads(current['data'])
|
||||
size = len(data.get('pattern', []))
|
||||
if 'names' not in data and isinstance(saved.get('names'), list) and saved['names'] and len(saved['names']) == size:
|
||||
data['names'] = saved['names']
|
||||
if 'nameModes' not in data and data.get('names') and isinstance(saved.get('nameModes'), list) and saved['nameModes'] and len(saved['nameModes']) == size:
|
||||
data['nameModes'] = saved['nameModes']
|
||||
|
||||
|
||||
def preserve_regular_name(kind, data, current):
|
||||
|
||||
Reference in new issue
Block a user