일반근무 이름 바꾸기 (웹 2026-11-25.1, 앱 0.14.2 소스)
달력 표시에서 일반근무를 직장에서 부르는 이름(주간·일근 등)으로 바꿀 수 있게 했다. 근무 식별자 REGULAR는 그대로 두고 보이는 이름만 바꾸므로 근무표와 통계는 그대로다. - 서버: 개인 설정 regularName 검사(8자·제어 문자 거부)와 구버전 저장 때 보존, 구독 제목 반영 - 웹: 달력 표시에 이름 칸, 달력 칸·오늘·고르는 목록·이름 표시 문구에 반영 - 앱: ShiftNames와 Shift.title/shortTitle/choiceTitle, 설정 창 칸, 위젯과 안내 줄 반영, 동기화 - 검사: 서버 93개, 앱 단위 53개, 위젯 기기 검사에 이름 확인 추가 - 근무 관리 기기 검사가 고정 날짜 때문에 날짜가 지나면 실패하던 것을 오늘 기준으로 고침 앱 0.14.2 APK는 외부 검사 뒤 따로 배포한다(release.json 앱 버전은 아직 0.14.1).
This commit is contained in:
1 parent
1982783048
commit
1aa4126727
27 files changed
+267
-41
No files matched your search
@@ -22,6 +22,7 @@ object WidgetAppearanceCheck {
|
||||
val originalPositions=positions.all.toMap()
|
||||
val schedulePrefs=app.getSharedPreferences("schedule",0)
|
||||
val originalWeekStart=schedulePrefs.all["weekStart"]
|
||||
val originalRegularName=schedulePrefs.all["regularName"]
|
||||
var success=false
|
||||
var message=""
|
||||
try {
|
||||
@@ -76,6 +77,21 @@ object WidgetAppearanceCheck {
|
||||
val sunHeader=month.findViewById<TextView>(if(start==1)R.id.widget_saturday else R.id.widget_sun)
|
||||
check(sunHeader.currentTextColor==WidgetStyle().color(0xFFBD5163.toInt()))
|
||||
}
|
||||
// 일반근무 이름을 바꾸면 위젯 칸에도 같은 이름이 보이고 다른 근무와 날짜 계산은 그대로다.
|
||||
if(ScheduleStore.isConfigured(app)) for(name in listOf("사무실","")) {
|
||||
val current=ScheduleStore.load(app)
|
||||
ScheduleStore.saveDisplay(app,current.dutyAsWeekday,current.showLunar,current.offAsHoliday,current.weekStart,fromSync=true,regularName=name)
|
||||
val schedule=ScheduleStore.load(app)
|
||||
val month=render(99001,500)
|
||||
val dates=calendarDays(java.time.YearMonth.now(),schedule.weekStart)
|
||||
val expected=if(name.isEmpty())"일반" else name
|
||||
DutyWidget.DAY_IDS.forEachIndexed { index,cellId ->
|
||||
val shift=schedule.shiftOn(dates[index])
|
||||
val lines=month.findViewById<TextView>(cellId).text.toString().lines()
|
||||
check(shift.shortTitle in lines){"위젯 날짜 $index 근무 이름: $lines (기대 ${shift.shortTitle})"}
|
||||
if(shift==Shift.REGULAR)check(expected in lines){"위젯 일반근무 이름: $lines (기대 $expected)"}
|
||||
}
|
||||
}
|
||||
// 제공자 등록만 확인하지 않고 최소 크기의 실제 글줄이 영역 안에 들어오는지도 확인한다.
|
||||
val density=app.resources.displayMetrics.density
|
||||
for(kind in WidgetKind.entries.filter{it!=WidgetKind.MONTH}) {
|
||||
@@ -155,12 +171,13 @@ object WidgetAppearanceCheck {
|
||||
}
|
||||
failure?.let{throw it}
|
||||
success=true
|
||||
message="네 종류의 기본 배치와 한 달 전체 선택 확인. 월·일 시작과 80·100·120% 및 최소·확장 크기에서 42칸과 모든 날짜 및 마지막 주의 글자 높이와 생략 없음 확인. 월 이동과 연말 넘김 및 오늘 복귀와 개별 저장 및 구버전 설정 보존 확인."
|
||||
message="일반근무 이름 바꾸기와 기본 이름 복귀 확인. 네 종류의 기본 배치와 한 달 전체 선택 확인. 월·일 시작과 80·100·120% 및 최소·확장 크기에서 42칸과 모든 날짜 및 마지막 주의 글자 높이와 생략 없음 확인. 월 이동과 연말 넘김 및 오늘 복귀와 개별 저장 및 구버전 설정 보존 확인."
|
||||
} catch(error:Throwable) {message=error.stackTraceToString()}
|
||||
finally {
|
||||
val scheduleRestore=schedulePrefs.edit()
|
||||
if(originalWeekStart is Int)scheduleRestore.putInt("weekStart",originalWeekStart) else scheduleRestore.remove("weekStart")
|
||||
check(scheduleRestore.commit())
|
||||
if(originalRegularName is String)scheduleRestore.putString("regularName",originalRegularName) else scheduleRestore.remove("regularName")
|
||||
check(scheduleRestore.commit());ScheduleStore.load(app)
|
||||
val editor=prefs.edit().clear()
|
||||
original.forEach{(key,value)->editor.putString(key,value as String)}
|
||||
check(editor.commit());DutyWidget.updateAll(app)
|
||||
|
||||
@@ -20,15 +20,17 @@ object WorkManagementCheck {
|
||||
check(ScheduleStore.load(app).shiftOn(LocalDate.of(2027,1,1))==Shift.NIGHT)
|
||||
val operation=PlannerStore.list(PlannerStore.operations(app)).first{it.getString("id")=="rotation"}
|
||||
check(PlanJson.read(operation.getJSONObject("data").getJSONObject("workPlan"))==schedule.workPlan)
|
||||
val data=JSONObject().put("title","복사 검사").put("date","2026-11-23").put("endDate","2026-11-23").put("allDay",false).put("startTime","09:00").put("endTime","10:00").put("notes","").put("category","GENERAL").put("repeat","NONE").put("repeatUntil","").put("reminderMinutes",-1)
|
||||
// 시간 겹침은 오늘 이후만 보므로 고정 날짜를 쓰면 날짜가 지난 뒤 검사가 저절로 깨진다(2026-11-25 확인). 오늘 기준으로 잡는다.
|
||||
val day=LocalDate.now().plusDays(3)
|
||||
val data=JSONObject().put("title","복사 검사").put("date",day.toString()).put("endDate",day.toString()).put("allDay",false).put("startTime","09:00").put("endTime","10:00").put("notes","").put("category","GENERAL").put("repeat","NONE").put("repeatUntil","").put("reminderMinutes",-1)
|
||||
val id=java.util.UUID.randomUUID().toString();PlannerStore.put(app,id,"event",data)
|
||||
PlannerStore.put(app,id,"event",JSONObject(),true)
|
||||
val deleted=PlannerStore.trash(app).first{it.getString("id")==id};check(deleted.getJSONObject("data").getString("title")=="복사 검사")
|
||||
PlannerStore.put(app,id,"event",deleted.getJSONObject("data"));check(PlannerStore.items(app).any{it.getString("id")==id})
|
||||
val document=app.getSharedPreferences("planner",0).getString("document",null)
|
||||
check(runCatching{PlannerStore.copyEvents(app,listOf(data,JSONObject(data.toString()).put("endDate","2026-11-22")))}.isFailure)
|
||||
check(runCatching{PlannerStore.copyEvents(app,listOf(data,JSONObject(data.toString()).put("endDate",day.minusDays(1).toString())))}.isFailure)
|
||||
check(document==app.getSharedPreferences("planner",0).getString("document",null)){"잘못된 일괄 복사에서 자료가 바뀜"}
|
||||
val count=PlannerStore.items(app).size;PlannerStore.copyEvents(app,listOf(JSONObject(data.toString()).put("date","2026-11-24").put("endDate","2026-11-24"),JSONObject(data.toString()).put("date","2026-11-25").put("endDate","2026-11-25")))
|
||||
val count=PlannerStore.items(app).size;PlannerStore.copyEvents(app,listOf(JSONObject(data.toString()).put("date",day.plusDays(1).toString()).put("endDate",day.plusDays(1).toString()),JSONObject(data.toString()).put("date",day.plusDays(2).toString()).put("endDate",day.plusDays(2).toString())))
|
||||
check(PlannerStore.items(app).size==count+2)
|
||||
check(WorkTools.conflicts(app,data,null).any{it.contains("복사 검사")})
|
||||
check(PlannerStore.history(app).isNotEmpty())
|
||||
|
||||
Reference in new issue
Block a user