feat(message_bizppurio): 알림 템플릿 편집 통합·검수 의견·관리탭 개선 및 언어팩 번역 보존 결함군 수정
비즈뿌리오 알림톡 UX 개편 후속: - 코어/게시판/이커머스 알림 템플릿 [편집] 모달에 확장 채널 편집 영역 (extension_point 2종 + hidden_template_editor 채널 메타)을 신설하고, 알림톡 템플릿·문자(SMS)·수신자 규칙을 한 창에서 통합 저장하도록 개정 (행 하단은 상태 요약 전용, 승인 여부 2단 배지) - 검수 신청에 검수자 전달 의견(comment) 동봉 — kapi request 로만 전달, 행에는 저장하지 않음 (FormRequest 신설 + API 문서 백필) - 관리 탭 모바일 카드뷰·도구줄 코어 관례 통일, 사이트맵 알림 정의 다국어 라벨 결측 수정 + 코어 정의 라벨 패리티 테스트 신설 언어팩 번역 소실·보존 결함군 (보완 실측 → 커밋 전 점검에서 연쇄 확정, 전부 실패 테스트 선행 후 수정): - [기본값 복원]이 활성 언어팩 번역(ja)을 영구 소실 → 복원 기본값에 시딩과 같은 주입기(SSoT)로 팩 로케일 병합 (notification·identity) - 코어 알림/본인인증 시더의 언어팩 주입 전면 불능 → 주입기가 연관/리스트 양형태 수용 + identity 시더의 config 복합 키 보존 - 실패한 언어팩 업데이트가 active 팩을 installed 로 방치 → 상태 복원 확장 - 병합·제거의 사용자 수정 보존 판정 사문(연관 전제 isset) → dot-path 판정 교정, 팩 주입 저장의 user_overrides 오염 차단(시딩 바인딩), 템플릿 2모델 translatableTrackableFields 선언(beta.4 설계 누락), 같은 프로세스 활성화 시 시더 번역 필터 stale(캡처 인스턴스 캐시) 교정 - 7.0.9 업그레이드 스텝 신설 — 활성 팩 seed 재동기화로 기설치본의 소실 번역 자동 복구 (멱등·운영자 수정 보존·팩별 실패 격리)
This commit is contained in:
1 parent
40f62e79aa
commit
e7fa1b5535
71 files changed
+7155
-8693
No files matched your search
@@ -9,8 +9,8 @@
|
||||
### Added
|
||||
|
||||
- 비즈뿌리오 연동 환경설정 화면과 문자(SMS/LMS)·카카오 알림톡 발송 채널을 추가했습니다. 회원가입·주문 등 코어 알림에 자동 연결되며, 검수/운영 환경을 구분해 운영합니다.
|
||||
- 알림 설정 화면의 '비즈뿌리오' 통합 탭에서 알림별 카카오 알림톡 템플릿을 직접 작성해 검수를 신청하고, 승인되면 그 내용으로 자동 발송됩니다. 기본형·부가정보형·채널추가형·복합형과 강조표기·이미지·아이템리스트 등 카카오 전 유형과 버튼·바로연결을 지원하며, 검수 결과는 30분 주기로 자동 확인되고 [새로고침]으로 즉시 확인할 수 있습니다. 반려되면 사유를 화면에서 확인하고 수정 후 다시 신청합니다. 게시판·이커머스 알림 설정 화면에서도 동일하게 동작합니다.
|
||||
- 알림별 대체 SMS(알림톡 실패 시)와 SMS 단독 발송 본문을 같은 화면에서 설정할 수 있습니다. 문자 본문은 언어별로 입력하며 회원이 사용하는 언어로 발송됩니다(해당 언어가 비어 있으면 기본 언어로 발송). [SMS 단독]을 선택한 알림은 템플릿이 승인되어 있어도 알림톡을 보내지 않고 문자로만 발송합니다. 승인 취소 시에는 알림톡 발송이 즉시 중단됨을 경고합니다.
|
||||
- 알림 설정 화면의 '비즈뿌리오' 통합 탭에서 각 알림의 [편집]을 누르면 알림 템플릿 편집 창 안에서 카카오 알림톡 템플릿을 직접 작성해 검수를 신청하고, 승인되면 그 내용으로 자동 발송됩니다. 기본형·부가정보형·채널추가형·복합형과 강조표기·이미지·아이템리스트 등 카카오 전 유형과 버튼·바로연결을 지원하며, 검수 결과는 30분 주기로 자동 확인되고 편집 창의 [새로고침]으로 즉시 확인할 수 있습니다. 검수 신청 시 변수 예시값 등 검수자에게 전달할 의견을 함께 적어 보낼 수 있으며, 반려되면 사유를 같은 창에서 확인하고 수정 후 다시 신청합니다. 알림 목록의 각 행에는 승인 여부(승인됨 / 미승인·세부 상태)와 문자 설정 요약이 표시됩니다. 게시판·이커머스 알림 설정 화면에서도 동일하게 동작합니다.
|
||||
- 같은 편집 창에서 알림별 대체 SMS(알림톡 실패 시)·SMS 단독 발송 여부와 문자 본문을 함께 설정하고, 하단 [저장] 한 번으로 알림톡 템플릿·문자 설정·수신자 규칙을 모두 저장합니다. 문자 본문은 언어별로 입력하며 회원이 사용하는 언어로 발송됩니다(해당 언어가 비어 있으면 기본 언어로 발송). [SMS 단독]을 선택한 알림은 템플릿이 승인되어 있어도 알림톡을 보내지 않고 문자로만 발송합니다. 검수중·승인된 템플릿은 내용이 잠기며, 승인 취소는 즉시 알림톡 발송이 중단됨을 같은 창에서 확인한 뒤 진행합니다.
|
||||
- 플러그인 설정의 '알림 템플릿 관리' 화면에서 모든 알림의 템플릿 상태를 한눈에 보고 검색·필터·수정·삭제할 수 있습니다.
|
||||
- 비즈뿌리오 webhook 으로 발송 결과를 수신해 "알림 발송 이력" 화면에 성공/실패와 사유를 기록하며, 지갑 잔액 부족 등으로 발송이 막히면 관리자에게 알립니다. 요청 과다로 인한 일시적 발송 실패도 사유가 표시됩니다.
|
||||
- 플러그인을 삭제하면 추가했던 발송 채널이 함께 정리되고, 재설치 시 자동 복원됩니다.
|
||||
@@ -114,10 +114,10 @@ https://your-domain.com/api/plugins/sirsoft-message_bizppurio/webhook
|
||||
|
||||
카카오 알림톡 템플릿의 **작성·검수 신청·취소·삭제를 관리자 화면에서 직접** 수행합니다. 비즈뿌리오 콘솔을 따로 열 필요가 없습니다.
|
||||
|
||||
작성 위치는 두 곳이고 화면 구성은 같습니다.
|
||||
작성 위치는 두 곳입니다.
|
||||
|
||||
- **알림 설정 > 비즈뿌리오 탭** — 알림 항목마다 알림톡 템플릿과 대체 SMS 를 함께 설정합니다. 게시판·이커머스의 알림 설정 화면에서도 동일하게 동작합니다.
|
||||
- **플러그인 설정 > 알림 템플릿 관리** — 전체 알림의 템플릿 상태를 한 화면에서 보고 검색·필터링합니다.
|
||||
- **알림 설정 > 비즈뿌리오 탭** — 알림 항목의 **[편집]** 을 누르면 알림 템플릿 편집 창 안에 **알림톡 템플릿** 섹션과 **문자(SMS)** 섹션이 함께 열립니다. 알림톡 본문·유형·버튼, 대체 SMS/SMS 단독 여부와 문자 본문, 수신자 규칙을 한 창에서 고치고 하단 **[저장]** 한 번으로 모두 저장합니다(알림톡 검수는 **[저장 후 검수 신청]** — 작성 폼 하단의 **검수자 전달 의견**에 변수 예시값 등을 적으면 신청과 함께 카카오 검수자에게 전달됩니다). 이 채널에서는 코어의 제목/본문 입력이 숨겨지고 알림톡 본문이 그 자리를 대신합니다. 알림 목록의 각 행 하단에는 승인 여부(**승인됨** / **미승인 (세부 상태)**)와 문자 설정 요약이 표시됩니다. 게시판·이커머스의 알림 설정 화면에서도 동일하게 동작합니다.
|
||||
- **플러그인 설정 > 알림 템플릿 관리** — 전체 알림의 템플릿 상태를 한 화면에서 보고 검색·필터링합니다(자체 작성/SMS 본문 모달).
|
||||
|
||||
기본 흐름은 **작성 → 검수 신청 → (카카오 승인) → 자동 발송** 입니다. 승인된 시점의 내용이 발송 기준으로 저장되며, 발송할 때마다 카카오를 조회하지 않습니다.
|
||||
|
||||
@@ -136,13 +136,13 @@ https://your-domain.com/api/plugins/sirsoft-message_bizppurio/webhook
|
||||
| 차단 | ❌ | 카카오에서 차단된 템플릿 |
|
||||
| 휴면 | ❌ | 장기 미사용으로 휴면 전환. 화면의 [휴면 해제]로 복구 |
|
||||
|
||||
검수 결과는 30분 주기로 자동 확인하며, 각 행의 [새로고침]으로 즉시 확인할 수도 있습니다.
|
||||
검수 결과는 30분 주기로 자동 확인하며, 편집 창의 [새로고침]으로 즉시 확인할 수도 있습니다.
|
||||
|
||||
승인된 템플릿의 내용을 고치려면 [수정]을 눌러 승인을 먼저 취소해야 합니다. **승인을 취소하면 그 즉시 해당 알림의 알림톡 발송이 중단**되므로(대체 SMS 는 설정에 따라 계속 발송), 화면에서 확인 후 진행합니다.
|
||||
검수중·승인된 템플릿은 편집 창에서 내용이 잠기고 요약만 표시됩니다. 검수중이면 [신청 취소] 후, 승인된 템플릿은 [수정 (승인 취소)] 를 눌러 승인을 먼저 취소해야 고칠 수 있습니다. **승인을 취소하면 그 즉시 해당 알림의 알림톡 발송이 중단**되므로(대체 SMS 는 설정에 따라 계속 발송), 같은 창의 확인 박스에서 확인 후 진행합니다.
|
||||
|
||||
### 문자(SMS) 본문
|
||||
|
||||
알림마다 문자 본문을 따로 입력합니다. 쓰임은 두 가지이고 본문은 하나를 공유합니다.
|
||||
알림마다 문자 본문을 따로 입력합니다(편집 창의 문자(SMS) 섹션). 쓰임은 두 가지이고 본문은 하나를 공유하며, 카카오 검수 대상이 아니므로 [저장] 즉시 반영됩니다.
|
||||
|
||||
- **대체 SMS** — 알림톡 발송이 실패했을 때(수신 거부·미가입 등) 같은 번호로 문자를 대신 보냅니다.
|
||||
- **SMS 단독** — 알림톡을 쓰지 않고 문자로만 보냅니다. 이 항목을 켜면 템플릿이 승인 상태여도 알림톡을 보내지 않습니다.
|
||||
|
||||
@@ -672,6 +672,7 @@ Content-Type: application/json
|
||||
| 이름 | 위치 | 타입 | 필수 | 허용값 | 용도 |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| id | path | integer | 예 | 숫자만 | 템플릿 PK |
|
||||
| comment | body | string | 아니오 | 500자 이내 (앞뒤 공백 제거, 비어 있으면 미전달) | 검수자 전달 의견 — kapi `template/request` 의 comment 로 그대로 실린다. 행에는 저장하지 않는다 |
|
||||
|
||||
**요청 예시**
|
||||
|
||||
@@ -679,7 +680,12 @@ Content-Type: application/json
|
||||
POST /api/plugins/sirsoft-message_bizppurio/admin/templates/4/request HTTP/1.1
|
||||
Host: api.example.com
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {YOUR_TOKEN}
|
||||
|
||||
{
|
||||
"comment": "변수 예시: #{name}=홍길동, #{order_number}=20260823-0001"
|
||||
}
|
||||
```
|
||||
|
||||
**응답 필드** (`data.template` — 상세 객체, `GET /admin/templates/{id}` 와 동일)
|
||||
@@ -710,7 +716,7 @@ Authorization: Bearer {YOUR_TOKEN}
|
||||
| 401 | Unauthenticated | 유효한 Bearer 토큰이 없거나 만료된 경우 |
|
||||
| 403 | Forbidden | 요구 권한(`sirsoft-message_bizppurio.messaging.manage`)이 없는 경우 |
|
||||
| 404 | Not Found | `{id}` 에 해당하는 템플릿이 없는 경우 |
|
||||
| 422 | Unprocessable Entity | content 미작성 / 신청 불가 상태(draft·rejected 외) / kapi 실패(`errors.bizppurio_message`·`errors.result_code`) / 발신프로필 키(sender_key) 미설정 / 템플릿 코드 채번 실패 |
|
||||
| 422 | Unprocessable Entity | comment 500자 초과 / content 미작성 / 신청 불가 상태(draft·rejected 외) / kapi 실패(`errors.bizppurio_message`·`errors.result_code`) / 발신프로필 키(sender_key) 미설정 / 템플릿 코드 채번 실패 |
|
||||
|
||||
**설명**
|
||||
|
||||
@@ -720,6 +726,9 @@ Authorization: Bearer {YOUR_TOKEN}
|
||||
add 성공 시점에만 template_code 를 행에 확정하므로, add 자체가 실패하면 다음 시도에서 다시 채번부터 진행된다.
|
||||
`draft`/`rejected` 상태에서만 신청할 수 있으며(requested 는 이미 검수중, approved 는 승인 취소 먼저),
|
||||
content 미작성이면 422 를 반환한다. 성공 시 `inspection_detail` 은 초기화된다.
|
||||
요청 본문의 `comment`(선택, ≤500)는 ③ 의 kapi request 에 검수자 전달 의견으로 그대로 실리며 행에는 저장하지 않는다 —
|
||||
카카오 심사 가이드가 본문 변수마다 요구하는 '예시 텍스트' 를 검수자에게 전할 유일한 통로다(kapi `template/add` 에는
|
||||
예시 필드가 없다). 500자 초과는 kapi 호출 전에 422 로 끝나므로 행 상태와 선점은 바뀌지 않는다.
|
||||
|
||||
|
||||
### POST /api/plugins/sirsoft-message_bizppurio/admin/templates/{id}/cancel-request
|
||||
|
||||
@@ -132,6 +132,7 @@ return [
|
||||
'message_type' => 'message type',
|
||||
'emphasize_type' => 'emphasis type',
|
||||
'template_content' => 'body',
|
||||
'comment' => 'reviewer comment',
|
||||
'preview_message' => 'preview message',
|
||||
'category_code' => 'category',
|
||||
'security_flag' => 'secure template flag',
|
||||
|
||||
@@ -132,6 +132,7 @@ return [
|
||||
'message_type' => '메시지 유형',
|
||||
'emphasize_type' => '강조 유형',
|
||||
'template_content' => '본문',
|
||||
'comment' => '검수자 전달 의견',
|
||||
'preview_message' => '미리보기 문구',
|
||||
'category_code' => '카테고리',
|
||||
'security_flag' => '보안 템플릿 여부',
|
||||
|
||||
+140
-745
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extension_point": "notification_definition_row_footer",
|
||||
"comment": "알림 설정 '비즈뿌리오' 통합 탭의 각 알림 행 하단(코어 notification_definition_row_footer 슬롯)에 알림톡 라이프사이클 줄 + SMS 설정 줄을 채운다(#597 §4.1). activeChannel==='alimtalk'(통합 탭 정체성)일 때만 노출. 요약 데이터는 bizppurioTemplates(각 탭 오버레이가 등록·조회, GET templates/map)에서 def.type 으로 읽고, 작성/수정은 modal_bizppurio_template(오버레이 등록), SMS 본문은 modal_bizppurio_sms, 반려 사유는 modal_bizppurio_rejection, 승인 취소 경고는 modal_bizppurio_cancel_approval 을 연다. 코어 목록·행은 건드리지 않으며, 플러그인 미설치 시 슬롯은 빈 자리로 남는다.",
|
||||
"comment": "알림 설정 '비즈뿌리오' 통합 탭의 각 알림 행 하단 상태 요약(PO 결정 2026-08-23 — 버튼 없음, 조작은 코어 [편집] 모달로 일원화). activeChannel==='alimtalk'(통합 탭 정체성)일 때만 노출. 요약 데이터는 bizppurioTemplates(각 탭 오버레이가 등록·조회, GET templates/map)에서 def.type 으로 읽는다. 1줄: 알림톡 승인 2단 배지 + 신청/동기화일 + 발송 사용 여부 / 2줄: 문자(SMS) 대체·단독 사용 여부 + 본문 미리보기.",
|
||||
"priority": 320,
|
||||
"components": [
|
||||
{
|
||||
"id": "bizppurio_row_lifecycle",
|
||||
@@ -14,787 +15,181 @@
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "flex-center flex-wrap gap-2"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"name": "fas fa-comment-dots",
|
||||
"size": "sm",
|
||||
"className": "text-teal-600 dark:text-teal-400 flex-shrink-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.alimtalk_label",
|
||||
"props": {
|
||||
"className": "text-sm font-medium text-gray-700 dark:text-gray-200 flex-shrink-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "{{$t('sirsoft-message_bizppurio.template.status.' + ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten'))}}",
|
||||
"props": {
|
||||
"className": "{{'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium flex-shrink-0 ' + ((((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) === 'approved' ? 'bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200' : (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) === 'requested' ? 'bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-200' : (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) === 'rejected' ? 'bg-red-100 dark:bg-red-800 text-red-700 dark:text-red-100' : (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) === 'dormant' ? 'bg-orange-100 dark:bg-orange-900 text-orange-700 dark:text-orange-200' : ((((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) === 'stopped' || (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) === 'blocked') ? 'border border-red-400 dark:border-red-500 text-red-600 dark:text-red-400' : 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300')}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.requested_on|date={{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.requested_at ?? '').slice(5, 10)}}",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-400 dark:text-gray-500 flex-shrink-0"
|
||||
},
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.requested_at}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.synced_on|date={{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.last_synced_at ?? '').slice(5, 10)}}",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-400 dark:text-gray-500 flex-shrink-0"
|
||||
},
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.last_synced_at}}"
|
||||
}
|
||||
],
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"className": "flex-center gap-2 min-w-0 flex-wrap"
|
||||
"name": "fas fa-comment-dots",
|
||||
"className": "text-sm text-teal-600 dark:text-teal-400 flex-shrink-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "text-sm font-medium text-gray-700 dark:text-gray-200 flex-shrink-0"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.alimtalk_label"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"comment": "승인 여부 2단 배지(PO 결정 2026-08-23): 1차 = 승인됨/미승인, 2차(괄호) = 세부 상태(미작성·작성중·검수중·반려·휴면·중지·차단). approved 는 세부 없이 단독 표기.",
|
||||
"props": {
|
||||
"className": "{{'inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium flex-shrink-0 ' + ((((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'approved' ? 'bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200' : (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'requested' ? 'bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-200' : (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'rejected' ? 'bg-red-100 dark:bg-red-800 text-red-700 dark:text-red-100' : ((((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'stopped' || (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'blocked') ? 'border border-red-400 dark:border-red-500 text-red-600 dark:text-red-400' : (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'dormant' ? 'bg-orange-100 dark:bg-orange-900 text-orange-700 dark:text-orange-200' : 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300')}}"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"children": [
|
||||
{
|
||||
"type": "composite",
|
||||
"name": "Toggle",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content === true)}}",
|
||||
"props": {
|
||||
"checked": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.alimtalk_enabled ?? false}}",
|
||||
"size": "sm"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "change",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/delivery/{{extensionPointProps.definition?.type}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"alimtalk_enabled": "{{!(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.alimtalk_enabled ?? false)}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.alimtalk_enabled",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content === true)}}"
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "flex-center gap-1.5"
|
||||
}
|
||||
"name": "Span",
|
||||
"text": "{{$t('sirsoft-message_bizppurio.template.approval.' + ((((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') === 'approved' ? 'approved' : 'not_approved'))}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"name": "Span",
|
||||
"if": "{{(((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten') !== 'approved'}}",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-red-300 dark:border-red-600 text-red-700 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/30"
|
||||
"className": "font-normal opacity-80"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_reject_view": {
|
||||
"notification_name": "{{extensionPointProps.definition?.name?.[$locale] ?? extensionPointProps.definition?.type}}",
|
||||
"comments": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.inspection_detail ?? []}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "openModal",
|
||||
"target": "modal_bizppurio_rejection"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_view_reason",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'rejected' && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.inspection_detail ?? []).length > 0}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-teal-300 dark:border-teal-600 text-teal-700 dark:text-teal-300 hover:bg-teal-50 dark:hover:bg-teal-900/30"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_upload": { "uploading": false, "error": null },
|
||||
"bz_tpl_modal": {
|
||||
"id": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id ?? null}}",
|
||||
"notification_type": "{{extensionPointProps.definition?.type}}",
|
||||
"notification_name": "{{extensionPointProps.definition?.name?.[$locale] ?? extensionPointProps.definition?.type}}",
|
||||
"variables": "{{extensionPointProps.definition?.variables ?? []}}",
|
||||
"status": "draft",
|
||||
"inspection_detail": [],
|
||||
"isSaving": false,
|
||||
"error": null,
|
||||
"sender_profile": "",
|
||||
"content": {
|
||||
"templateName": "{{extensionPointProps.definition?.name?.[$locale] ?? extensionPointProps.definition?.type}}",
|
||||
"templateMessageType": "BA",
|
||||
"templateEmphasizeType": "NONE",
|
||||
"templateContent": "{{(((extensionPointProps.definition?.templates ?? []).find(tpl => tpl.channel === 'alimtalk')?.body?.[$locale] ?? '').split('{').join('#{'))}}",
|
||||
"templateExtra": "",
|
||||
"templateHeader": "",
|
||||
"templateTitle": "",
|
||||
"templateSubtitle": "",
|
||||
"templateImageName": "",
|
||||
"templateImageUrl": "",
|
||||
"categoryCode": "",
|
||||
"buttons": [],
|
||||
"quickReplies": [],
|
||||
"templateItem": {
|
||||
"list": [],
|
||||
"summary": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"templateItemHighlight": {
|
||||
"title": "",
|
||||
"description": "",
|
||||
"imageUrl": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "openModal",
|
||||
"target": "modal_bizppurio_template"
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioCategories"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioProfiles"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_compose",
|
||||
"if": "{{!(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) || !(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content === true)}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-teal-300 dark:border-teal-600 text-teal-700 dark:text-teal-300 hover:bg-teal-50 dark:hover:bg-teal-900/30"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id}}",
|
||||
"params": {
|
||||
"method": "GET"
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_upload": { "uploading": false, "error": null },
|
||||
"bz_tpl_modal": {
|
||||
"id": "{{response.data?.template?.id}}",
|
||||
"notification_type": "{{response.data?.template?.notification_type}}",
|
||||
"notification_name": "{{extensionPointProps.definition?.name?.[$locale] ?? response.data?.template?.notification_type}}",
|
||||
"variables": "{{extensionPointProps.definition?.variables ?? []}}",
|
||||
"status": "{{response.data?.template?.status}}",
|
||||
"inspection_detail": "{{response.data?.template?.inspection_detail ?? []}}",
|
||||
"isSaving": false,
|
||||
"error": null,
|
||||
"sender_profile": "",
|
||||
"content": "{{Object.assign({templateName: '', templateMessageType: 'BA', templateEmphasizeType: 'NONE', templateContent: '', templateExtra: '', templateHeader: '', templateTitle: '', templateSubtitle: '', templateImageName: '', templateImageUrl: '', categoryCode: '', buttons: [], quickReplies: [], templateItem: {list: [], summary: {title: '', description: ''}}, templateItemHighlight: {title: '', description: '', imageUrl: ''}}, JSON.parse(JSON.stringify(response.data?.template?.content ?? {})))}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "openModal",
|
||||
"target": "modal_bizppurio_template"
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioCategories"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioProfiles"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_edit",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content === true) && ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'draft' || (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'rejected')}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_cancel_approval": {
|
||||
"id": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id}}",
|
||||
"notification_name": "{{extensionPointProps.definition?.name?.[$locale] ?? extensionPointProps.definition?.type}}",
|
||||
"isSaving": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "openModal",
|
||||
"target": "modal_bizppurio_cancel_approval"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_edit_approved",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'approved'}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-teal-300 dark:border-teal-600 text-teal-700 dark:text-teal-300 hover:bg-teal-50 dark:hover:bg-teal-900/30",
|
||||
"disabled": "{{_global.bz_row_busy ?? false}}"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_row_busy": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id}}/request",
|
||||
"params": {
|
||||
"method": "POST"
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_row_busy": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.row.requested_toast",
|
||||
"type": "success"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_row_busy": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"if": "{{!(_global.bz_row_busy ?? false)}}"
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_request",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content === true) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'draft'}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id}}/cancel-request",
|
||||
"params": {
|
||||
"method": "POST"
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.row.cancel_request_toast",
|
||||
"type": "success"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_cancel_request",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'requested'}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-teal-300 dark:border-teal-600 text-teal-700 dark:text-teal-300 hover:bg-teal-50 dark:hover:bg-teal-900/30"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id}}/release",
|
||||
"params": {
|
||||
"method": "POST"
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.row.released_toast",
|
||||
"type": "success"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_release",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status) === 'dormant'}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.id}}/sync",
|
||||
"params": {
|
||||
"method": "POST"
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.row.synced_toast",
|
||||
"type": "success"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_refresh",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.template_code}}"
|
||||
"text": "{{'(' + $t('sirsoft-message_bizppurio.template.status.' + (((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content)) ? bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.status : 'unwritten')) + ')'}}"
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.requested_at}}",
|
||||
"props": {
|
||||
"className": "flex-center gap-1.5 flex-shrink-0 flex-wrap"
|
||||
}
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.requested_on|date={{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.requested_at ?? '').slice(5, 10)}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.last_synced_at}}",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.synced_on|date={{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.last_synced_at ?? '').slice(5, 10)}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_content === true) && (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.alimtalk_enabled === false)}}",
|
||||
"props": {
|
||||
"className": "text-xs px-1.5 py-0.5 rounded border border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.alimtalk_disabled"
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "flex-between gap-2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "flex-center flex-wrap gap-2"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"name": "fas fa-comment-sms",
|
||||
"size": "sm",
|
||||
"className": "text-gray-400 dark:text-gray-500 flex-shrink-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Label",
|
||||
"comment": "알림톡 실패 시 SMS 대체발송 — 변경 즉시 저장(행이 없으면 draft 로 생성)",
|
||||
"props": {
|
||||
"className": "flex items-center gap-1.5 cursor-pointer select-none"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Checkbox",
|
||||
"props": {
|
||||
"autoBinding": false,
|
||||
"checked": "{{!!(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.fallback_sms_enabled)}}",
|
||||
"className": "h-3.5 w-3.5 rounded border-gray-300 dark:border-gray-600 text-teal-600"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "change",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/delivery/{{extensionPointProps.definition?.type}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"fallback_sms_enabled": "{{$event.target.checked}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.fallback_sms",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-600 dark:text-gray-300"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Label",
|
||||
"comment": "알림톡 없이 SMS 만 발송 — 변경 즉시 저장",
|
||||
"props": {
|
||||
"className": "flex items-center gap-1.5 cursor-pointer select-none"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Checkbox",
|
||||
"props": {
|
||||
"autoBinding": false,
|
||||
"checked": "{{!!(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_only)}}",
|
||||
"className": "h-3.5 w-3.5 rounded border-gray-300 dark:border-gray-600 text-teal-600"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "change",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/delivery/{{extensionPointProps.definition?.type}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"sms_only": "{{$event.target.checked}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.sms_only",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-600 dark:text-gray-300"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"comment": "SMS 본문 미리보기. 로케일 선택·폴백·유무 판정은 서버(BizppurioTemplate::getLocalizedSmsBody/hasSmsBody)가 하고 화면은 결과만 그린다 — 여기서 맵을 직접 훑으면 발송 게이트와 규칙이 갈린다.",
|
||||
"text": "{{$t('sirsoft-message_bizppurio.template.row.sms_body_prefix')}} {{(bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_body_preview ?? '').slice(0, 40) + ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_body_preview ?? '').length > 40 ? '…' : '')}}",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400 truncate min-w-0"
|
||||
},
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_sms_body === true}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.sms_body_missing",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-400 dark:text-gray-500"
|
||||
},
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_sms_body !== true}}"
|
||||
}
|
||||
],
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"className": "flex-center gap-3 min-w-0 flex-wrap"
|
||||
"name": "fas fa-comment-sms",
|
||||
"className": "text-sm text-gray-500 dark:text-gray-400 flex-shrink-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
||||
"className": "text-sm font-medium text-gray-700 dark:text-gray-200 flex-shrink-0"
|
||||
},
|
||||
"actions": [
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.sms_label"
|
||||
},
|
||||
{
|
||||
"id": "bizppurio_row_sms_fallback",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"comment": "fallback_sms 상태 배지 — 사용(초록)/미사용(회색). 문구 대신 배지(PO 지시 2026-08-23, 행의 활성·기본·승인 배지와 일관).",
|
||||
"props": {
|
||||
"className": "flex-center gap-1 flex-shrink-0"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_sms_modal": {
|
||||
"notification_type": "{{extensionPointProps.definition?.type}}",
|
||||
"notification_name": "{{extensionPointProps.definition?.name?.[$locale] ?? extensionPointProps.definition?.type}}",
|
||||
"variables": "{{extensionPointProps.definition?.variables ?? []}}",
|
||||
"body": "{{Object.assign({}, bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_body)}}",
|
||||
"editLang": "{{$locale}}",
|
||||
"isSaving": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "openModal",
|
||||
"target": "modal_bizppurio_sms"
|
||||
}
|
||||
]
|
||||
}
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.fallback_sms"
|
||||
},
|
||||
{
|
||||
"id": "bizppurio_row_sms_fallback_badge",
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "{{'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium flex-shrink-0 ' + ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.fallback_sms_enabled) ? 'bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200' : 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300')}}"
|
||||
},
|
||||
"text": "{{$t('sirsoft-message_bizppurio.template.row.' + ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.fallback_sms_enabled) ? 'on' : 'off'))}}"
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.btn_edit_sms"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bizppurio_row_sms_only",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"comment": "sms_only 상태 배지 — 사용(초록)/미사용(회색). 문구 대신 배지(PO 지시 2026-08-23, 행의 활성·기본·승인 배지와 일관).",
|
||||
"props": {
|
||||
"className": "flex-center gap-1 flex-shrink-0"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.sms_only"
|
||||
},
|
||||
{
|
||||
"id": "bizppurio_row_sms_only_badge",
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "{{'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium flex-shrink-0 ' + ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_only) ? 'bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200' : 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300')}}"
|
||||
},
|
||||
"text": "{{$t('sirsoft-message_bizppurio.template.row.' + ((bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_only) ? 'on' : 'off'))}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_sms_body === true}}",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400 truncate max-w-md"
|
||||
},
|
||||
"text": "{{$t('sirsoft-message_bizppurio.template.row.sms_body_prefix') + ' ' + (bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.sms_body_preview ?? '')}}"
|
||||
},
|
||||
{
|
||||
"id": "bizppurio_row_sms_body_missing",
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"comment": "본문 미설정 = 값 없음 — '발송 사용 안 함' 칩과 같은 외곽선 스타일.",
|
||||
"if": "{{bizppurioTemplates?.data?.templates?.[extensionPointProps.definition?.type]?.has_sms_body !== true}}",
|
||||
"props": {
|
||||
"className": "text-xs px-1.5 py-0.5 rounded border border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 flex-shrink-0"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.row.sms_body_missing"
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "flex-between gap-2"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"priority": 320
|
||||
]
|
||||
}
|
||||
+1
-2384
File diff suppressed because it is too large.
Load diff
+1
-2384
File diff suppressed because it is too large.
Load diff
+1
-2384
File diff suppressed because it is too large.
Load diff
+797
@@ -0,0 +1,797 @@
|
||||
{
|
||||
"extension_point": "notification_template_form_footer_actions",
|
||||
"comment": "코어 알림 템플릿 [편집] 모달 푸터에 주입되는 통합 저장 버튼(PO 결정 2026-08-23 — 저장은 하나로). 채널 메타 hidden_template_editor 로 코어 [저장]/[미리보기]가 숨겨진 자리에서, [저장] 한 번으로 ① 알림톡 템플릿(draft/rejected 만 내용 갱신) + 발송 설정·SMS 본문 ② 수신자 규칙이 바뀐 경우에만 코어 채널 템플릿을 순차 저장한다(앞 단계 실패 시 중단). [저장 후 검수 신청]은 알림톡 본문이 있고 수정 가능한 상태에서만 노출된다 — 카카오 검수는 알림톡 템플릿만 대상이며 SMS 는 검수 없이 즉시 반영된다. 더블클릭 재진입은 click if + disabled 로 막고, 중복 검수 신청의 SSoT 는 서버 원자 선점이다.",
|
||||
"priority": 320,
|
||||
"components": [
|
||||
{
|
||||
"id": "bizppurio_tpl_footer_actions",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"if": "{{extensionPointProps.channel === 'alimtalk'}}",
|
||||
"props": {
|
||||
"className": "flex gap-2"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"if": "{{(['draft', 'rejected'].includes(_global.bz_tpl_modal?.status ?? 'draft')) && ((_global.bz_tpl_modal?.content?.templateContent ?? '').trim() !== '') && ((_global.bz_tpl_modal?.notification_type === extensionPointProps.definition?.type) && !(_global.bz_tpl_modal?.loading ?? false))}}",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-sm px-4 py-2 rounded-md bg-teal-600 text-white hover:bg-teal-700 dark:bg-teal-500 dark:hover:bg-teal-600 disabled:opacity-50 disabled:cursor-not-allowed",
|
||||
"disabled": "{{(_global.bz_tpl_modal?.isSaving ?? false) || (_global.bz_tpl_upload?.uploading ?? false) || !((_global.bz_tpl_modal?.notification_type === extensionPointProps.definition?.type) && !(_global.bz_tpl_modal?.loading ?? false))}}"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.form.btn_save_request",
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(_global.bz_tpl_modal?.isSaving ?? false) && ((_global.bz_tpl_modal?.notification_type === extensionPointProps.definition?.type) && !(_global.bz_tpl_modal?.loading ?? false))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": true,
|
||||
"bz_tpl_modal.error": null,
|
||||
"bz_tpl_modal.errors": null,
|
||||
"bz_sms_modal.isSaving": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "① 행 없음 + 본문 입력 → POST(생성). 검수 신청은 생성 응답의 id 로 이어간다.",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates",
|
||||
"if": "{{!(_global.bz_tpl_modal?.id) && ((_global.bz_tpl_modal?.content?.templateContent ?? '').trim() !== '')}}",
|
||||
"params": {
|
||||
"method": "POST",
|
||||
"body": {
|
||||
"notification_type": "{{_global.bz_tpl_modal?.notification_type}}",
|
||||
"content": "{{_global.bz_tpl_modal?.content}}",
|
||||
"alimtalk_enabled": "{{!!(_global.bz_tpl_modal?.alimtalk_enabled ?? true)}}",
|
||||
"fallback_sms_enabled": "{{!!(_global.bz_sms_modal?.fallback_sms_enabled)}}",
|
||||
"sms_only": "{{!!(_global.bz_sms_modal?.sms_only)}}",
|
||||
"sms_body": "{{Object.assign({}, _global.bz_sms_modal?.body)}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{response.data?.template?.id}}/request",
|
||||
"params": {
|
||||
"method": "POST",
|
||||
"body": {
|
||||
"comment": "{{_global.bz_tpl_modal?.request_comment ?? ''}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"comment": "수신자 규칙 변경 시에만: 코어 채널 템플릿 PUT(코어 모달의 저장 계약과 동일 엔드포인트/본문 — subject·body 는 숨겨진 값 그대로).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "{{extensionPointProps.saveEndpoint}}",
|
||||
"if": "{{(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"subject": "{{_global?.[extensionPointProps.stateKey]?.template?.subject}}",
|
||||
"body": "{{_global?.[extensionPointProps.stateKey]?.template?.body}}",
|
||||
"click_url": "{{_global?.[extensionPointProps.stateKey]?.template?.click_url ?? null}}",
|
||||
"recipients": "{{_global?.[extensionPointProps.stateKey]?.recipients ?? []}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.form.requested_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "수신자 규칙 변경 없음: 코어 PUT 없이 마무리.",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.form.requested_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "② 행 있음 + draft/rejected + 본문 입력 → PUT(내용 갱신).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{_global.bz_tpl_modal?.id}}",
|
||||
"if": "{{!!(_global.bz_tpl_modal?.id) && (['draft', 'rejected'].includes(_global.bz_tpl_modal?.status ?? 'draft')) && ((_global.bz_tpl_modal?.content?.templateContent ?? '').trim() !== '')}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"content": "{{_global.bz_tpl_modal?.content}}",
|
||||
"alimtalk_enabled": "{{!!(_global.bz_tpl_modal?.alimtalk_enabled ?? true)}}",
|
||||
"fallback_sms_enabled": "{{!!(_global.bz_sms_modal?.fallback_sms_enabled)}}",
|
||||
"sms_only": "{{!!(_global.bz_sms_modal?.sms_only)}}",
|
||||
"sms_body": "{{Object.assign({}, _global.bz_sms_modal?.body)}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{_global.bz_tpl_modal?.id}}/request",
|
||||
"params": {
|
||||
"method": "POST",
|
||||
"body": {
|
||||
"comment": "{{_global.bz_tpl_modal?.request_comment ?? ''}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"comment": "수신자 규칙 변경 시에만: 코어 채널 템플릿 PUT(코어 모달의 저장 계약과 동일 엔드포인트/본문 — subject·body 는 숨겨진 값 그대로).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "{{extensionPointProps.saveEndpoint}}",
|
||||
"if": "{{(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"subject": "{{_global?.[extensionPointProps.stateKey]?.template?.subject}}",
|
||||
"body": "{{_global?.[extensionPointProps.stateKey]?.template?.body}}",
|
||||
"click_url": "{{_global?.[extensionPointProps.stateKey]?.template?.click_url ?? null}}",
|
||||
"recipients": "{{_global?.[extensionPointProps.stateKey]?.recipients ?? []}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.form.requested_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "수신자 규칙 변경 없음: 코어 PUT 없이 마무리.",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.form.requested_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "flex-center gap-2 text-sm px-4 py-2 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 dark:bg-indigo-500 dark:hover:bg-indigo-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
||||
"disabled": "{{(_global.bz_tpl_modal?.isSaving ?? false) || (_global.bz_tpl_upload?.uploading ?? false) || !((_global.bz_tpl_modal?.notification_type === extensionPointProps.definition?.type) && !(_global.bz_tpl_modal?.loading ?? false))}}"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"if": "{{(_global.bz_tpl_modal?.isSaving ?? false)}}",
|
||||
"props": {
|
||||
"name": "spinner",
|
||||
"className": "animate-spin text-sm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "{{(_global.bz_tpl_modal?.isSaving ?? false) ? '$t:common.saving' : '$t:common.save'}}"
|
||||
}
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(_global.bz_tpl_modal?.isSaving ?? false) && ((_global.bz_tpl_modal?.notification_type === extensionPointProps.definition?.type) && !(_global.bz_tpl_modal?.loading ?? false))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": true,
|
||||
"bz_tpl_modal.error": null,
|
||||
"bz_tpl_modal.errors": null,
|
||||
"bz_sms_modal.isSaving": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "① 행 없음 + 본문 입력 → POST(생성). 검수 신청은 생성 응답의 id 로 이어간다.",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates",
|
||||
"if": "{{!(_global.bz_tpl_modal?.id) && ((_global.bz_tpl_modal?.content?.templateContent ?? '').trim() !== '')}}",
|
||||
"params": {
|
||||
"method": "POST",
|
||||
"body": {
|
||||
"notification_type": "{{_global.bz_tpl_modal?.notification_type}}",
|
||||
"content": "{{_global.bz_tpl_modal?.content}}",
|
||||
"alimtalk_enabled": "{{!!(_global.bz_tpl_modal?.alimtalk_enabled ?? true)}}",
|
||||
"fallback_sms_enabled": "{{!!(_global.bz_sms_modal?.fallback_sms_enabled)}}",
|
||||
"sms_only": "{{!!(_global.bz_sms_modal?.sms_only)}}",
|
||||
"sms_body": "{{Object.assign({}, _global.bz_sms_modal?.body)}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"comment": "수신자 규칙 변경 시에만: 코어 채널 템플릿 PUT(코어 모달의 저장 계약과 동일 엔드포인트/본문 — subject·body 는 숨겨진 값 그대로).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "{{extensionPointProps.saveEndpoint}}",
|
||||
"if": "{{(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"subject": "{{_global?.[extensionPointProps.stateKey]?.template?.subject}}",
|
||||
"body": "{{_global?.[extensionPointProps.stateKey]?.template?.body}}",
|
||||
"click_url": "{{_global?.[extensionPointProps.stateKey]?.template?.click_url ?? null}}",
|
||||
"recipients": "{{_global?.[extensionPointProps.stateKey]?.recipients ?? []}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.section.saved_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "수신자 규칙 변경 없음: 코어 PUT 없이 마무리.",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.section.saved_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "② 행 있음 + draft/rejected + 본문 입력 → PUT(내용 갱신).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{_global.bz_tpl_modal?.id}}",
|
||||
"if": "{{!!(_global.bz_tpl_modal?.id) && (['draft', 'rejected'].includes(_global.bz_tpl_modal?.status ?? 'draft')) && ((_global.bz_tpl_modal?.content?.templateContent ?? '').trim() !== '')}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"content": "{{_global.bz_tpl_modal?.content}}",
|
||||
"alimtalk_enabled": "{{!!(_global.bz_tpl_modal?.alimtalk_enabled ?? true)}}",
|
||||
"fallback_sms_enabled": "{{!!(_global.bz_sms_modal?.fallback_sms_enabled)}}",
|
||||
"sms_only": "{{!!(_global.bz_sms_modal?.sms_only)}}",
|
||||
"sms_body": "{{Object.assign({}, _global.bz_sms_modal?.body)}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"comment": "수신자 규칙 변경 시에만: 코어 채널 템플릿 PUT(코어 모달의 저장 계약과 동일 엔드포인트/본문 — subject·body 는 숨겨진 값 그대로).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "{{extensionPointProps.saveEndpoint}}",
|
||||
"if": "{{(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"subject": "{{_global?.[extensionPointProps.stateKey]?.template?.subject}}",
|
||||
"body": "{{_global?.[extensionPointProps.stateKey]?.template?.body}}",
|
||||
"click_url": "{{_global?.[extensionPointProps.stateKey]?.template?.click_url ?? null}}",
|
||||
"recipients": "{{_global?.[extensionPointProps.stateKey]?.recipients ?? []}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.section.saved_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "수신자 규칙 변경 없음: 코어 PUT 없이 마무리.",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.section.saved_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "③ 본문 미입력(SMS 만 설정) 또는 내용 잠금 상태(검수중/승인 등) → delivery upsert(발송 설정·SMS 본문만, 행 없으면 draft 생성).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/delivery/{{_global.bz_tpl_modal?.notification_type}}",
|
||||
"if": "{{!((_global.bz_tpl_modal?.content?.templateContent ?? '').trim() !== '') || (!!(_global.bz_tpl_modal?.id) && !(['draft', 'rejected'].includes(_global.bz_tpl_modal?.status ?? 'draft')))}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"alimtalk_enabled": "{{!!(_global.bz_tpl_modal?.alimtalk_enabled ?? true)}}",
|
||||
"fallback_sms_enabled": "{{!!(_global.bz_sms_modal?.fallback_sms_enabled)}}",
|
||||
"sms_only": "{{!!(_global.bz_sms_modal?.sms_only)}}",
|
||||
"sms_body": "{{Object.assign({}, _global.bz_sms_modal?.body)}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"comment": "수신자 규칙 변경 시에만: 코어 채널 템플릿 PUT(코어 모달의 저장 계약과 동일 엔드포인트/본문 — subject·body 는 숨겨진 값 그대로).",
|
||||
"handler": "apiCall",
|
||||
"auth_required": true,
|
||||
"target": "{{extensionPointProps.saveEndpoint}}",
|
||||
"if": "{{(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"method": "PUT",
|
||||
"body": {
|
||||
"subject": "{{_global?.[extensionPointProps.stateKey]?.template?.subject}}",
|
||||
"body": "{{_global?.[extensionPointProps.stateKey]?.template?.body}}",
|
||||
"click_url": "{{_global?.[extensionPointProps.stateKey]?.template?.click_url ?? null}}",
|
||||
"recipients": "{{_global?.[extensionPointProps.stateKey]?.recipients ?? []}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.section.saved_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"comment": "수신자 규칙 변경 없음: 코어 PUT 없이 마무리.",
|
||||
"handler": "sequence",
|
||||
"if": "{{!(JSON.stringify(_global?.[extensionPointProps.stateKey]?.recipients ?? []) !== JSON.stringify(_global?.[extensionPointProps.stateKey]?.template?.recipients ?? []))}}",
|
||||
"params": {
|
||||
"actions": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "bizppurioTemplates"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "refetchDataSource",
|
||||
"params": {
|
||||
"dataSourceId": "{{extensionPointProps.refetchDataSourceId}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "toast",
|
||||
"params": {
|
||||
"message": "$t:sirsoft-message_bizppurio.template.section.saved_toast",
|
||||
"type": "success"
|
||||
}
|
||||
},
|
||||
{
|
||||
"handler": "closeModal"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"onError": [
|
||||
{
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.isSaving": false,
|
||||
"bz_sms_modal.isSaving": false,
|
||||
"bz_tpl_modal.error": "{{error.errors?.bizppurio_message ?? error.message}}",
|
||||
"bz_tpl_modal.errors": "{{(error.errors && typeof error.errors === 'object' && !error.errors.bizppurio_message) ? error.errors : null}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+2714
File diff suppressed because it is too large.
Load diff
+13
-25
@@ -8,15 +8,16 @@
|
||||
*
|
||||
* 검증 방식: comment 필드 제거 후 JSON 문자열에서 면 고유 토큰(target_layout·target_id·
|
||||
* 컴포넌트 id 접두)만 코어 형으로 치환하면 코어 오버레이와 완전 동일해야 한다.
|
||||
* 반대로 데이터소스 id·모달 id·전역 상태 경로(bz_tpl_modal 등)는 치환 없이도 3면 동일해야
|
||||
* 한다 — notification_row_footer.json(전역 매칭)이 이 이름들을 공유 참조하기 때문이다.
|
||||
* 반대로 데이터소스 id 는 치환 없이도 3면 동일해야 한다 — notification_row_footer.json 과
|
||||
* notification_template_form_sections.json(전역 매칭, 3면 공유 1본)이 이 이름들을 공유 참조하기 때문이다.
|
||||
* 편집 UI(작성 폼·SMS·저장)는 코어 [편집] 모달의 extension_point 에 주입되는 공유 1본이라
|
||||
* 면 패리티 대상이 아니다(PO 결정 2026-08-23).
|
||||
*
|
||||
* 세 오버레이가 전문 동일하다는 것이 board/ecommerce 면의 화면 효과를 떠받치는 근거다 —
|
||||
* core 면에서 단언한 것들(탭 통합·행 하단 UI·업로드 잠금·SMS 언어 탭)이 두 면에도 있다는
|
||||
* 보장은 이 패리티뿐이고, 그래서 이 파일이 사라지면 두 면은 미측정으로 남는다.
|
||||
*
|
||||
* @effects bizppurio_tab_replaces_sms_and_alimtalk_tabs, row_footer_shows_status_badge_and_lifecycle_actions,
|
||||
* upload_in_progress_locks_save_buttons_not_cancel, sms_modal_edits_body_per_locale_tab
|
||||
* @effects bizppurio_tab_replaces_sms_and_alimtalk_tabs, row_footer_shows_status_summary_only
|
||||
*/
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
@@ -68,13 +69,8 @@ const normalizedCore = JSON.stringify(stripComments(coreOverlay));
|
||||
|
||||
/** 3면 공유 이름(치환 없이 동일해야 하는 축) */
|
||||
const SHARED_DATA_SOURCE_IDS = ['bizppurioTemplates', 'bizppurioCategories', 'bizppurioProfiles'];
|
||||
const SHARED_MODAL_IDS = [
|
||||
'modal_bizppurio_template',
|
||||
'modal_bizppurio_sms',
|
||||
'modal_bizppurio_cancel_approval',
|
||||
'modal_bizppurio_rejection',
|
||||
];
|
||||
const SHARED_GLOBAL_STATE_PATHS = ['bz_tpl_modal', 'bz_sms_modal', 'bz_cancel_approval', 'bz_reject_view', 'bz_tpl_upload'];
|
||||
// 모달·전역 상태(bz_*)는 오버레이가 아니라 3면 공유 1본(notification_template_form_sections.json /
|
||||
// _footer_actions.json)이 소유한다(PO 결정 2026-08-23 — 편집 모달 통합). 오버레이는 모달을 등록하지 않는다.
|
||||
|
||||
describe.each(FIXTURES)('$label 오버레이 — 3면 패리티', ({ label, overlay, targetLayout, targetId, idPrefix }) => {
|
||||
it(`target_layout=${targetLayout} 이고 extension_point 키가 없다(overlay 전용)`, () => {
|
||||
@@ -102,27 +98,19 @@ describe.each(FIXTURES)('$label 오버레이 — 3면 패리티', ({ label, over
|
||||
expect(ids).toEqual(SHARED_DATA_SOURCE_IDS);
|
||||
});
|
||||
|
||||
it('모달 id 4종이 코어와 완전 동일하다(행 footer 의 openModal target 공유)', () => {
|
||||
const ids = ((overlay as { modals?: AnyNode[] }).modals ?? []).map((m) => m.id);
|
||||
expect(ids).toEqual(SHARED_MODAL_IDS);
|
||||
});
|
||||
|
||||
it('전역 상태 경로(bz_*)가 접두 치환 없이 그대로 사용된다(면 전용 상태 분기 금지)', () => {
|
||||
it('오버레이는 모달을 등록하지 않고, 면 전용 전역 상태(bz_board_* 등)도 만들지 않는다', () => {
|
||||
expect((overlay as { modals?: AnyNode[] }).modals, `${label} 오버레이 modals`).toBeUndefined();
|
||||
const raw = JSON.stringify(overlay);
|
||||
for (const path of SHARED_GLOBAL_STATE_PATHS) {
|
||||
expect(raw, `${label} 에 ${path} 없음`).toContain(`_global.${path}`);
|
||||
// 면 접두가 붙은 변형(bz_board_* 등)이 존재하면 footer 공유가 깨진다
|
||||
expect(raw).not.toContain(path.replace('bz_', `bz_${idPrefix.replace('bizppurio_', '')}`));
|
||||
}
|
||||
expect(raw).not.toContain(`bz_${idPrefix.replace('bizppurio_', '')}`);
|
||||
expect(raw).not.toContain('openModal');
|
||||
});
|
||||
});
|
||||
|
||||
describe('3면 패리티 — 공유 축 교차 검증', () => {
|
||||
it('코어 오버레이도 동일한 공유 데이터소스·모달 id 집합을 갖는다(패리티 기준점 고정)', () => {
|
||||
it('코어 오버레이도 동일한 공유 데이터소스 id 집합을 갖고 모달은 없다(패리티 기준점 고정)', () => {
|
||||
const dsIds = ((coreOverlay as { data_sources?: Array<{ id: string }> }).data_sources ?? []).map((d) => d.id);
|
||||
const modalIds = ((coreOverlay as { modals?: AnyNode[] }).modals ?? []).map((m) => m.id);
|
||||
expect(dsIds).toEqual(SHARED_DATA_SOURCE_IDS);
|
||||
expect(modalIds).toEqual(SHARED_MODAL_IDS);
|
||||
expect((coreOverlay as { modals?: AnyNode[] }).modals).toBeUndefined();
|
||||
});
|
||||
|
||||
it('세 오버레이의 init_actions(탭 진입 요약 맵 조회)가 comment 제외 완전 동일하다', () => {
|
||||
|
||||
+579
-429
File diff suppressed because it is too large.
Load diff
+232
-39
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* 플러그인 설정 — 알림 템플릿 관리 탭(DB 목록) 구조 검증 (#597 §4.3)
|
||||
*
|
||||
* @effects manage_screen_lists_db_rows_with_merge_query_round_trip
|
||||
* @effects manage_screen_lists_db_rows_with_merge_query_round_trip, inspection_request_carries_reviewer_comment
|
||||
*
|
||||
* templates 탭은 DB 목록 관리 화면이다:
|
||||
* - 데이터소스 bizppurio_templates_list(GET /admin/templates) — 필터·검색·페이지는
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import layout from '../../../layouts/admin/plugin_settings.json';
|
||||
import footer from '../../../extensions/notification_row_footer.json';
|
||||
import sections from '../../../extensions/notification_template_form_sections.json';
|
||||
import footerActions from '../../../extensions/notification_template_form_footer_actions.json';
|
||||
import ko from '../../../lang/ko.json';
|
||||
import en from '../../../lang/en.json';
|
||||
import { findById, findAllByName, evalBinding, type AnyNode } from './helpers';
|
||||
@@ -105,7 +106,7 @@ describe('manage — 필터·검색·페이지 (mergeQuery 왕복 규약)', () =
|
||||
|
||||
it('새로고침 버튼은 URL 을 건드리지 않고 목록만 refetch 한다(보던 목록 유지)', () => {
|
||||
const refreshBtn = findAllByName(manageView, 'Button')
|
||||
.find((b) => b.text === '$t:sirsoft-message_bizppurio.templates.list.refresh');
|
||||
.find((b) => (b.props as Record<string, unknown>)?.['aria-label'] === '$t:sirsoft-message_bizppurio.templates.list.refresh');
|
||||
expect(refreshBtn).toBeTruthy();
|
||||
const raw = JSON.stringify(refreshBtn);
|
||||
expect(raw).toContain('bizppurio_templates_list');
|
||||
@@ -157,15 +158,14 @@ describe('manage — 행 액션(알림 설정 탭 행 하단과 동일 엔드포
|
||||
});
|
||||
|
||||
/**
|
||||
* 관리 화면(bzRow)과 행 하단(요약 맵)의 노출 조건을 같은 상태 집합에 **실제로 태워** 대조한다.
|
||||
* 관리 화면(bzRow)과 코어 [편집] 모달 섹션(_global.bz_tpl_modal)의 노출 조건을 같은 상태
|
||||
* 집합에 **실제로 태워** 대조한다(PO 결정 2026-08-23 — 행 하단 버튼 폐지, 섹션이 SSoT).
|
||||
*
|
||||
* 문자열 동일성 단언은 두 면의 식이 실제로 같은 결과를 내는지 증명하지 못한다 — 실제로
|
||||
* `btn_refresh` 는 footer 가 `(row) && row?.template_code`, manage 는 `bzRow.template_code`
|
||||
* 로 서로 다른 모양이고, `=== true` 와 truthy 도 갈린다. 두 식을 각자의 컨텍스트로 평가해
|
||||
* 상태별 결과가 일치하는지를 본다.
|
||||
* 문자열 동일성 단언은 두 면의 식이 실제로 같은 결과를 내는지 증명하지 못한다 — 두 식을
|
||||
* 각자의 컨텍스트로 평가해 상태별 결과가 일치하는지를 본다.
|
||||
*/
|
||||
const MANAGE_ROWS: Record<string, Record<string, unknown>> = {
|
||||
'행만 있고 내용 없음': { has_content: false, status: 'draft' },
|
||||
'행만 있고 내용 없음': { has_content: false, status: 'draft', template_code: null },
|
||||
draft: { has_content: true, status: 'draft', template_code: null },
|
||||
requested: { has_content: true, status: 'requested', template_code: 'g7_a_1' },
|
||||
approved: { has_content: true, status: 'approved', template_code: 'g7_a_1' },
|
||||
@@ -178,60 +178,64 @@ describe('manage — 행 액션(알림 설정 탭 행 하단과 동일 엔드포
|
||||
|
||||
/** manage 화면 식을 bzRow 컨텍스트로 평가 */
|
||||
const evalManage = (expr: string, bzRow: Record<string, unknown>): boolean => {
|
||||
const body = expr.trim().replace(/^\{\{/, '').replace(/\}\}$/, '');
|
||||
const body = expr.trim().replace(/^{{/, '').replace(/}}$/, '');
|
||||
// eslint-disable-next-line no-new-func
|
||||
return Boolean(new Function('bzRow', `return (${body});`)(bzRow));
|
||||
};
|
||||
|
||||
/** footer 식을 요약 맵 컨텍스트로 평가 */
|
||||
const evalFooter = (expr: string, bzRow: Record<string, unknown>): boolean => {
|
||||
const body = expr.trim().replace(/^\{\{/, '').replace(/\}\}$/, '');
|
||||
/** 편집 모달 섹션 식을 _global.bz_tpl_modal 컨텍스트로 평가(섹션은 상세 GET 으로 status/template_code 를 시딩한다) */
|
||||
const evalSection = (expr: string, bzRow: Record<string, unknown>): boolean => {
|
||||
const body = expr.trim().replace(/^{{/, '').replace(/}}$/, '');
|
||||
// eslint-disable-next-line no-new-func
|
||||
const fn = new Function('bizppurioTemplates', 'extensionPointProps', `return (${body});`);
|
||||
return Boolean(fn({ data: { templates: { welcome: bzRow } } }, { definition: { type: 'welcome' } }));
|
||||
// 섹션은 READY(자기 알림 유형으로 시딩 + 상세 GET 완료) 컨텍스트에서 평가한다
|
||||
const fn = new Function('_global', 'extensionPointProps', `return (${body});`);
|
||||
return Boolean(fn(
|
||||
{ bz_tpl_modal: { notification_type: 'welcome', loading: false, status: bzRow.status, template_code: bzRow.template_code ?? null }, bz_tpl_ui: { confirmCancelApproval: false } },
|
||||
{ definition: { type: 'welcome' }, channel: 'alimtalk' },
|
||||
));
|
||||
};
|
||||
|
||||
const footerRoot = { children: (footer as { components?: AnyNode[] }).components ?? [] } as AnyNode;
|
||||
const footerRow = findById(footerRoot, 'bizppurio_row_lifecycle') as AnyNode;
|
||||
const sectionsRoot = { children: (sections as { components?: AnyNode[] }).components ?? [] } as AnyNode;
|
||||
const byTextKey = (root: AnyNode, key: string) => findAllByName(root, 'Button')
|
||||
.find((b) => b.text === `$t:sirsoft-message_bizppurio.${key}`);
|
||||
|
||||
/** 관리 화면 ↔ 행 하단에서 같은 의미를 갖는 버튼 쌍 */
|
||||
/** 관리 화면 ↔ 편집 모달 섹션에서 같은 의미를 갖는 버튼 쌍 */
|
||||
const PAIRS = [
|
||||
'template.row.btn_request',
|
||||
'template.row.btn_cancel_request',
|
||||
'template.row.btn_release',
|
||||
'template.row.btn_refresh',
|
||||
'template.row.btn_edit_approved',
|
||||
];
|
||||
|
||||
it.each(PAIRS)('%s 의 노출 조건이 관리 화면과 행 하단에서 상태별로 같은 결과를 낸다', (key) => {
|
||||
it.each(PAIRS)('%s 의 노출 조건이 관리 화면과 편집 모달 섹션에서 상태별로 같은 결과를 낸다', (key) => {
|
||||
const m = byTextKey(manageView, key);
|
||||
const f = byTextKey(footerRow, key);
|
||||
const f = byTextKey(sectionsRoot, key);
|
||||
expect(m?.if, `관리 화면에 ${key} if 가 없다`).toBeTruthy();
|
||||
expect(f?.if, `행 하단에 ${key} if 가 없다`).toBeTruthy();
|
||||
expect(f?.if, `편집 모달 섹션에 ${key} if 가 없다`).toBeTruthy();
|
||||
|
||||
for (const [state, bzRow] of Object.entries(MANAGE_ROWS)) {
|
||||
expect(evalManage(m!.if as string, bzRow), `${key} @ ${state}`)
|
||||
.toBe(evalFooter(f!.if as string, bzRow));
|
||||
.toBe(evalSection(f!.if as string, bzRow));
|
||||
}
|
||||
});
|
||||
|
||||
it('작성/수정 버튼은 행 하단의 작성+수정 두 버튼을 합친 것과 같은 상태에서 노출된다', () => {
|
||||
// 관리 화면은 DB 목록이라 "행 없음" 이 없다 — footer 의 btn_compose(!row || !has_content)와
|
||||
// btn_edit(has_content && draft|rejected)를 합집합으로 놓고 대조한다.
|
||||
it('관리 화면 [검수 신청]은 draft + 내용 보유에서만 노출된다(편집 모달은 [저장 후 검수 신청]이 본문 입력으로 판정)', () => {
|
||||
const m = byTextKey(manageView, 'template.row.btn_request');
|
||||
expect(m?.if).toBeTruthy();
|
||||
for (const [state, bzRow] of Object.entries(MANAGE_ROWS)) {
|
||||
expect(evalManage(m!.if as string, bzRow), `검수 신청 @ ${state}`).toBe(bzRow.status === 'draft' && bzRow.has_content === true);
|
||||
}
|
||||
});
|
||||
|
||||
it('작성/수정 버튼은 편집 모달의 작성 폼이 열리는 상태(draft/rejected)에서만 노출된다', () => {
|
||||
const m = findAllByName(manageView, 'Button')
|
||||
.find((b) => typeof b.text === 'string' && b.text.includes("sirsoft-message_bizppurio.manage.' + (bzRow.has_content"));
|
||||
expect(m?.if, '관리 화면 작성/수정 버튼을 찾지 못했다').toBeTruthy();
|
||||
|
||||
const compose = byTextKey(footerRow, 'template.row.btn_compose');
|
||||
const edit = byTextKey(footerRow, 'template.row.btn_edit');
|
||||
expect(compose?.if).toBeTruthy();
|
||||
expect(edit?.if).toBeTruthy();
|
||||
|
||||
const editor = findById(sectionsRoot, 'bizppurio_tpl_editor');
|
||||
expect(editor?.if).toBeTruthy();
|
||||
for (const [state, bzRow] of Object.entries(MANAGE_ROWS)) {
|
||||
const footerVisible = evalFooter(compose!.if as string, bzRow) || evalFooter(edit!.if as string, bzRow);
|
||||
expect(evalManage(m!.if as string, bzRow), `작성/수정 @ ${state}`).toBe(footerVisible);
|
||||
expect(evalManage(m!.if as string, bzRow), `작성/수정 @ ${state}`).toBe(evalSection(editor!.if as string, bzRow));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -246,15 +250,14 @@ describe('manage — 행 액션(알림 설정 탭 행 하단과 동일 엔드포
|
||||
expect(en.manage.btn_compose).toBeTruthy();
|
||||
});
|
||||
|
||||
it('승인 취소·SMS 본문·delivery upsert 는 행 하단(footer)과 같은 엔드포인트 계열을 쓴다', () => {
|
||||
it('상태 전이·delivery upsert 엔드포인트 계열이 편집 모달 섹션·푸터 액션과 같다', () => {
|
||||
const layoutEndpoints = collectEndpoints(layout);
|
||||
const footerEndpoints = collectEndpoints(footer);
|
||||
// footer 가 쓰는 계열(map 조회 제외 — 관리 화면은 DB 목록을 쓴다)이 관리 화면에도 존재한다
|
||||
for (const ep of footerEndpoints) {
|
||||
if (ep.endsWith('/map')) continue;
|
||||
const sharedEndpoints = collectEndpoints([sections, footerActions]);
|
||||
// 편집 모달이 쓰는 계열(map 조회·상세 GET 제외 — 관리 화면은 DB 목록을 쓴다)이 관리 화면에도 존재한다
|
||||
for (const ep of sharedEndpoints) {
|
||||
if (ep.endsWith('/map') || ep === '/api/plugins/sirsoft-message_bizppurio/admin/templates/{id}') continue;
|
||||
expect(layoutEndpoints, `관리 화면에 ${ep} 누락`).toContain(ep);
|
||||
}
|
||||
// 승인 취소 모달 공유 확인
|
||||
expect(JSON.stringify(layout)).toContain(
|
||||
'/api/plugins/sirsoft-message_bizppurio/admin/templates/{{_global.bz_cancel_approval?.id}}/cancel-approval',
|
||||
);
|
||||
@@ -371,3 +374,193 @@ describe('manage 모달 — 이미지 업로드 배선·SMS 언어 탭 (#597 §1
|
||||
expect(modalRaw).toContain("'bz_sms_modal.body.' + (_global.bz_sms_modal?.editLang ?? $locale)");
|
||||
});
|
||||
});
|
||||
|
||||
describe('manage 모달 — 검수자 전달 의견 (#597 §18.7, PO 결정 2026-08-23)', () => {
|
||||
const composeModal = findById(modalRoot, 'modal_bizppurio_template') as AnyNode;
|
||||
const sectionsRoot = { children: (sections as { components?: AnyNode[] }).components ?? [] } as AnyNode;
|
||||
const collectHandlers = (node: unknown, acc: AnyNode[] = []): AnyNode[] => {
|
||||
if (Array.isArray(node)) node.forEach((c) => collectHandlers(c, acc));
|
||||
else if (node && typeof node === 'object') {
|
||||
const rec = node as AnyNode;
|
||||
if (typeof rec.handler === 'string') acc.push(rec);
|
||||
Object.values(rec).forEach((v) => collectHandlers(v, acc));
|
||||
}
|
||||
return acc;
|
||||
};
|
||||
|
||||
it('작성 모달에 bz_manage_request_comment 입력란(≤500)이 있고 편집 모달 섹션과 같은 상태 키·바인딩을 쓴다', () => {
|
||||
const block = findById(composeModal, 'bz_manage_request_comment') as AnyNode;
|
||||
expect(block).toBeTruthy();
|
||||
const ta = findAllByName(block, 'Textarea')[0] as AnyNode;
|
||||
expect((ta.props as { name: string }).name).toBe('bz_request_comment');
|
||||
expect((ta.props as { maxLength: number }).maxLength).toBe(500);
|
||||
const sectionsTa = findAllByName(findById(sectionsRoot, 'bizppurio_tpl_request_comment') as AnyNode, 'Textarea')[0] as AnyNode;
|
||||
expect((ta.props as { value: string }).value).toBe((sectionsTa.props as { value: string }).value);
|
||||
expect(JSON.stringify(ta.actions)).toBe(JSON.stringify(sectionsTa.actions));
|
||||
});
|
||||
|
||||
it('작성 모달의 request 2노드는 comment 를 싣고, 행 단위 [검수 신청](입력란 없음)은 싣지 않는다', () => {
|
||||
const all = collectHandlers(root).filter((a) => a.handler === 'apiCall' && String(a.target).endsWith('/request'));
|
||||
const modalReqs = all.filter((a) => !String(a.target).includes('{{bzRow.id}}'));
|
||||
const rowReqs = all.filter((a) => String(a.target).includes('{{bzRow.id}}'));
|
||||
expect(modalReqs).toHaveLength(2);
|
||||
expect(rowReqs).toHaveLength(1);
|
||||
for (const r of modalReqs) {
|
||||
expect((r.params as { body: { comment: string } }).body.comment).toBe("{{_global.bz_tpl_modal?.request_comment ?? ''}}");
|
||||
}
|
||||
for (const r of rowReqs) expect((r.params as { body?: unknown }).body).toBeUndefined();
|
||||
});
|
||||
|
||||
it('바로연결 블록(헤더+목록) 바로 뒤 형제로 놓이고, 라벨+[바로연결 추가] flex 행 안에 끼지 않는다 (회귀: PO 화면 지적 2026-08-23)', () => {
|
||||
const ancestorsOf = (root: AnyNode, id: string, anc: AnyNode[] = []): AnyNode[] | null => {
|
||||
for (const c of (root.children as AnyNode[] | undefined) ?? []) {
|
||||
if (c.id === id) return anc.concat(root);
|
||||
const r = ancestorsOf(c, id, anc.concat(root));
|
||||
if (r) return r;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const chain = ancestorsOf(composeModal, 'bz_manage_request_comment') as AnyNode[];
|
||||
expect(chain).toBeTruthy();
|
||||
const parent = chain[chain.length - 1];
|
||||
const siblings = parent.children as AnyNode[];
|
||||
const idx = siblings.findIndex((c) => c.id === 'bz_manage_request_comment');
|
||||
const prev = siblings[idx - 1];
|
||||
expect(JSON.stringify(prev)).toContain('template.form.quick_reply_add');
|
||||
expect(JSON.stringify(prev)).toContain('quickRepliesItem');
|
||||
for (const a of chain) {
|
||||
expect(String((a.props as { className?: string } | undefined)?.className ?? ''), `ancestor ${a.id ?? a.name}`).not.toMatch(/\bflex\b/);
|
||||
}
|
||||
});
|
||||
|
||||
it('행에서 작성 모달을 열 때 request_comment 를 빈 문자열로 시딩한다(다른 행의 의견 이월 금지)', () => {
|
||||
const seeds = collectHandlers(root)
|
||||
.filter((a) => a.handler === 'setState' && (a.params as Record<string, unknown>)?.bz_tpl_modal);
|
||||
expect(seeds.length).toBeGreaterThan(0);
|
||||
for (const s of seeds) {
|
||||
expect(((s.params as Record<string, unknown>).bz_tpl_modal as Record<string, unknown>).request_comment).toBe('');
|
||||
}
|
||||
});
|
||||
|
||||
it('라벨·placeholder·안내 키가 ko/en 에 존재한다', () => {
|
||||
const pick = (json: unknown, key: string): unknown => key.split('.')
|
||||
.reduce<unknown>((acc, seg) => (acc as Record<string, unknown>)?.[seg], json);
|
||||
for (const key of ['request_comment', 'request_comment_placeholder', 'request_comment_hint']) {
|
||||
expect(pick(ko, `template.form.${key}`), `ko ${key}`).toBeTruthy();
|
||||
expect(pick(en, `template.form.${key}`), `en ${key}`).toBeTruthy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('manage — 목록 SMS 열은 상태 배지 (행 하단과 같은 규칙, PO 지시 2026-08-23)', () => {
|
||||
// iteration(bzRow) 안이라 정적 id 를 둘 수 없다 — 텍스트 식으로 찾는다
|
||||
const badge = findAllByName(manageView, 'Span').find((n) => String(n.text).includes("manage.sms_fallback') : $t('sirsoft-message_bizppurio.template.row.off')")) as AnyNode;
|
||||
const evalCell = (expr: string, row: Record<string, unknown>): unknown => {
|
||||
const body = String(expr).trim().replace(/^\{\{/, '').replace(/\}\}$/, '');
|
||||
// eslint-disable-next-line no-new-func
|
||||
return new Function('$t', 'bzRow', `return (${body});`)((k: string) => k, row);
|
||||
};
|
||||
|
||||
it('단독/대체는 초록, 미사용은 회색 배지이며 평문 "-" 는 남지 않는다', () => {
|
||||
expect(badge).toBeTruthy();
|
||||
const cls = String((badge.props as { className: string }).className);
|
||||
expect(String(evalCell(cls, { sms_only: true }))).toContain('bg-green-100');
|
||||
expect(String(evalCell(cls, { fallback_sms_enabled: true }))).toContain('bg-green-100');
|
||||
expect(String(evalCell(cls, {}))).toContain('bg-gray-100');
|
||||
expect(String(evalCell(cls, {}))).toContain('rounded');
|
||||
expect(evalCell(String(badge.text), { sms_only: true })).toBe('sirsoft-message_bizppurio.manage.sms_only');
|
||||
expect(evalCell(String(badge.text), { fallback_sms_enabled: true })).toBe('sirsoft-message_bizppurio.manage.sms_fallback');
|
||||
expect(evalCell(String(badge.text), {})).toBe('sirsoft-message_bizppurio.template.row.off');
|
||||
expect(JSON.stringify(manageView)).not.toContain("sms_fallback') : '-')");
|
||||
});
|
||||
});
|
||||
|
||||
describe('manage — 목록 모바일 카드 전환 + 도구줄 버튼 일관성 (PO 지시 2026-08-24)', () => {
|
||||
const header = findById(manageView, 'bz_manage_list_header') as AnyNode;
|
||||
const rowsWrap = findById(manageView, 'bz_manage_list_rows') as AnyNode;
|
||||
const findIterationRow = (n: AnyNode | null): AnyNode | null => {
|
||||
if (!n) return null;
|
||||
if (n.iteration?.item_var === 'bzRow') return n;
|
||||
for (const c of n.children ?? []) {
|
||||
const found = findIterationRow(c);
|
||||
if (found) return found;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const portableClass = (n: AnyNode | null | undefined): string => String(
|
||||
((n?.responsive as Record<string, { props?: { className?: string } }> | undefined)?.portable?.props?.className) ?? '',
|
||||
);
|
||||
|
||||
it('Table 마크업이 사라지고 grid 목록으로 렌더된다(헤더 7컬럼 키 유지, portable 에서 숨김)', () => {
|
||||
expect(findAllByName(manageView, 'Table').length).toBe(0);
|
||||
expect(header).toBeTruthy();
|
||||
expect(String((header.props as { className?: string })?.className)).toContain('grid-cols-12');
|
||||
expect(portableClass(header)).toBe('hidden');
|
||||
const raw = JSON.stringify(header);
|
||||
for (const c of ['notification', 'owner', 'status', 'sms', 'requested_at', 'synced_at', 'actions']) {
|
||||
expect(raw, `columns.${c}`).toContain('manage.columns.' + c);
|
||||
}
|
||||
});
|
||||
|
||||
it('행은 데스크톱 grid, portable 에서 카드(flex-wrap)로 전환된다 — responsive 는 반복 노드가 아니라 내부 래퍼에 둔다', () => {
|
||||
const row = findIterationRow(rowsWrap);
|
||||
expect(row).toBeTruthy();
|
||||
expect(row!.responsive, '반복 노드 자체에 responsive 를 두지 않는다(내부 래퍼 담당)').toBeUndefined();
|
||||
const inner = (row!.children ?? [])[0] as AnyNode;
|
||||
expect(String((inner.props as { className?: string })?.className)).toContain('grid grid-cols-12');
|
||||
expect(portableClass(inner)).toContain('flex flex-wrap');
|
||||
});
|
||||
|
||||
it('소속·신청일·동기화일 셀은 portable 에서 숨고, 카드 메타 줄이 대신 노출된다', () => {
|
||||
const row = findIterationRow(rowsWrap) as AnyNode;
|
||||
const rowInner = (row.children ?? [])[0] as AnyNode;
|
||||
const hiddenCells = (rowInner.children ?? []).filter((c) => portableClass(c) === 'hidden');
|
||||
expect(hiddenCells.length).toBeGreaterThanOrEqual(3);
|
||||
// 메타 줄: 신청일+동기화일을 한 텍스트에 담고, 데스크톱(hidden)→portable 에서만 보인다
|
||||
const all: AnyNode[] = [];
|
||||
const walk = (n: AnyNode) => { all.push(n); (n.children ?? []).forEach(walk); };
|
||||
walk(row);
|
||||
const meta = all.find((n) => typeof n.text === 'string'
|
||||
&& n.text.includes("requested_at ?? '').slice(0, 10)")
|
||||
&& n.text.includes('last_synced_at'));
|
||||
expect(meta, '카드 메타 줄(신청·동기화 합본)이 없다').toBeTruthy();
|
||||
expect(String((meta!.props as { className?: string })?.className)).toContain('hidden');
|
||||
expect(portableClass(meta)).not.toContain('hidden');
|
||||
expect(portableClass(meta).length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('행 액션 묶음은 카드 전환 후에도 단일 인스턴스다(삭제 버튼 1개)', () => {
|
||||
const delBtns = findAllByName(manageView, 'Button')
|
||||
.filter((b) => b.text === '$t:sirsoft-message_bizppurio.manage.btn_delete');
|
||||
expect(delBtns.length).toBe(1);
|
||||
});
|
||||
|
||||
it('검색 버튼이 btn btn-primary 계열로 통일된다(구 미니 버튼 조합 제거)', () => {
|
||||
const searchBtn = findAllByName(manageView, 'Button')
|
||||
.find((b) => b.text === '$t:sirsoft-message_bizppurio.manage.btn_search') as AnyNode;
|
||||
expect(searchBtn).toBeTruthy();
|
||||
const cls = String((searchBtn.props as { className?: string })?.className);
|
||||
expect(cls).toContain('btn btn-primary');
|
||||
expect(cls).not.toContain('text-xs');
|
||||
});
|
||||
|
||||
it('새로고침이 btn-icon 아이콘 버튼으로 통일된다(fa-arrows-rotate + aria-label, refetch 전용 유지)', () => {
|
||||
const refreshBtn = findAllByName(manageView, 'Button')
|
||||
.find((b) => (b.props as Record<string, unknown>)?.['aria-label'] === '$t:sirsoft-message_bizppurio.templates.list.refresh') as AnyNode;
|
||||
expect(refreshBtn).toBeTruthy();
|
||||
expect(String((refreshBtn.props as { className?: string })?.className)).toContain('btn-icon');
|
||||
const raw = JSON.stringify(refreshBtn);
|
||||
expect(raw).toContain('fa-arrows-rotate');
|
||||
expect(raw).toContain('bizppurio_templates_list');
|
||||
expect(raw).not.toContain('"handler":"navigate"');
|
||||
});
|
||||
|
||||
it('검색 입력·상태 필터가 portable 에서 전폭 계열로 전환된다', () => {
|
||||
const input = findAllByName(manageView, 'Input')
|
||||
.find((i) => String((i.props as { value?: string })?.value ?? '').includes('bzSearchDraft')) as AnyNode;
|
||||
expect(portableClass(input)).toContain('w-full');
|
||||
const select = findAllByName(manageView, 'Select')
|
||||
.find((sel) => (sel.props as { value?: string })?.value === "{{query.bz_status ?? ''}}") as AnyNode;
|
||||
expect(portableClass(select)).toContain('flex-1');
|
||||
});
|
||||
});
|
||||
+15
-13
@@ -12,7 +12,7 @@
|
||||
* 디스패치 시점의 동기 검사라 리렌더를 기다리지 않는다.
|
||||
*
|
||||
* 이 테스트는 신청 체인을 포함하는 모든 click 액션이 재진입 가드(if)를
|
||||
* 보유하는지 4개 산출 파일 전수로 고정한다. 가드가 한 파일에서라도 빠지면
|
||||
* 보유하는지 산출 파일 전수(편집 모달 푸터 1본 + 관리 화면)로 고정한다. 가드가 한 파일에서라도 빠지면
|
||||
* 그 면에서만 중복 신청이 재발한다.
|
||||
*
|
||||
* 실행 검증은 §6.3 10c 브라우저 실측이 담당한다. 라운드 5 실측 결과를 여기 남긴다:
|
||||
@@ -36,10 +36,9 @@ import { describe, it, expect } from 'vitest';
|
||||
const BASE = path.resolve(__dirname, '../../../..');
|
||||
|
||||
const FILES = [
|
||||
'resources/extensions/notification_tab_core.json',
|
||||
'resources/extensions/notification_tab_board.json',
|
||||
'resources/extensions/notification_tab_ecommerce.json',
|
||||
'resources/extensions/notification_row_footer.json',
|
||||
// 3면 공유 1본 — 코어 [편집] 모달 푸터에 주입되는 통합 저장/검수 신청 버튼(PO 결정 2026-08-23)
|
||||
'resources/extensions/notification_template_form_footer_actions.json',
|
||||
// 플러그인 관리 화면의 자기 모달
|
||||
'resources/layouts/admin/plugin_settings.json',
|
||||
];
|
||||
|
||||
@@ -113,8 +112,8 @@ describe('검수 신청 체인 재진입 가드 (#597 10c)', () => {
|
||||
const all = FILES.flatMap(collectRequestClickActions);
|
||||
|
||||
it('신청 체인을 포함한 click 액션이 산출 파일 전체에서 수집된다 (0건이면 아래 단언은 공회전한다)', () => {
|
||||
// 모달 저장 후 신청(신규/수정) ×4파일 + row footer 신청 + 관리 화면 행 신청
|
||||
expect(all.length).toBeGreaterThanOrEqual(6);
|
||||
// 편집 모달 푸터 [저장 후 검수 신청] 1 + 관리 화면(모달 저장 후 신청 신규/수정 + 행 신청)
|
||||
expect(all.length).toBeGreaterThanOrEqual(3);
|
||||
});
|
||||
|
||||
it.each(FILES)('%s 의 신청 체인 click 액션은 모두 재진입 if 가드를 갖는다', (file) => {
|
||||
@@ -172,9 +171,11 @@ describe('저장 체인 재진입 가드 (#597 라운드 5 §6.3 10c 실측 파
|
||||
if (!node || typeof node !== 'object') return;
|
||||
if (Array.isArray(node)) { node.forEach(walk); return; }
|
||||
const n = node as Record<string, any>;
|
||||
// 관리 화면 모달: text=form.btn_save / 편집 모달 푸터(통합 저장): 자식 Span 이 $t:common.save
|
||||
const isSave = n.name === 'Button'
|
||||
&& typeof n.text === 'string'
|
||||
&& n.text.endsWith('sirsoft-message_bizppurio.template.form.btn_save');
|
||||
&& ((typeof n.text === 'string' && n.text.endsWith('sirsoft-message_bizppurio.template.form.btn_save'))
|
||||
|| (Array.isArray(n.children) && JSON.stringify(n.children).includes('$t:common.save')
|
||||
&& JSON.stringify(n.props ?? {}).includes('bz_tpl_modal')));
|
||||
if (isSave && Array.isArray(n.actions)) {
|
||||
for (const a of n.actions) {
|
||||
if (a?.type === 'click') found.push({ file, ifExpr: a.if });
|
||||
@@ -188,14 +189,15 @@ describe('저장 체인 재진입 가드 (#597 라운드 5 §6.3 10c 실측 파
|
||||
return found;
|
||||
};
|
||||
|
||||
it('저장 버튼의 click 액션이 4개 산출 파일 전수에서 재진입 가드를 보유한다', () => {
|
||||
it('저장 버튼의 click 액션이 산출 파일 전수에서 재진입 가드를 보유한다', () => {
|
||||
const all = FILES.flatMap(collectSaveClickActions);
|
||||
// 3면 오버레이 + 관리 화면 = 4면 × (신규/수정) 2버튼
|
||||
expect(all.length, '저장 버튼 click 액션 수').toBe(8);
|
||||
// 편집 모달 푸터 통합 [저장] 1 + 관리 화면 모달 (신규/수정) 2버튼
|
||||
expect(all.length, '저장 버튼 click 액션 수').toBe(3);
|
||||
|
||||
for (const a of all) {
|
||||
// 편집 모달 푸터의 통합 [저장]은 isSaving 가드에 상세 GET 완료 전 가드(loading)를 AND 로 더 단다 — 포함 판정
|
||||
expect(a.ifExpr, `${a.file}: 저장 체인에 재진입 가드(if)가 없다 — 더블 클릭 시 중복 저장`)
|
||||
.toBe(GUARD);
|
||||
.toContain(GUARD.slice(2, -2));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -105,7 +105,7 @@
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"tab_guide": "Compose an alimtalk template per notification and request inspection. Once Kakao approves it, alimtalk is sent automatically. SMS fallback and SMS-only delivery are also configured here.",
|
||||
"tab_guide": "Open [Edit] on each notification to write the alimtalk template and the SMS body together and request review. Alimtalk is sent automatically after Kakao approval; fallback SMS and SMS-only sending are configured in the same window.",
|
||||
"status": {
|
||||
"unwritten": "Not composed",
|
||||
"draft": "Draft",
|
||||
@@ -137,7 +137,11 @@
|
||||
"sms_only": "SMS only",
|
||||
"sms_body_prefix": "Body:",
|
||||
"sms_body_missing": "No SMS body",
|
||||
"btn_edit_sms": "Edit SMS body"
|
||||
"btn_edit_sms": "Edit SMS body",
|
||||
"sms_label": "SMS",
|
||||
"on": "On",
|
||||
"off": "Off",
|
||||
"alimtalk_disabled": "Sending off"
|
||||
},
|
||||
"form": {
|
||||
"modal_title": "Alimtalk Template — {name}",
|
||||
@@ -199,6 +203,9 @@
|
||||
"btn_remove_quick_reply": "Remove quick reply",
|
||||
"btn_save": "Save",
|
||||
"btn_save_request": "Save & request inspection",
|
||||
"request_comment": "Note to reviewer",
|
||||
"request_comment_placeholder": "e.g. #{name}=Jane Doe, #{order_number}=20260823-0001",
|
||||
"request_comment_hint": "Sent to the Kakao reviewer together with the inspection request (optional, up to 500 characters). Kakao review guidelines ask for an example value per body variable, so listing them here reduces rejections. It is not stored — it is only sent when you request inspection.",
|
||||
"saved_toast": "Notification template saved.",
|
||||
"requested_toast": "Inspection requested. Alimtalk delivery starts once approved."
|
||||
},
|
||||
@@ -217,6 +224,18 @@
|
||||
"rejection": {
|
||||
"modal_title": "Rejection Reasons — {name}",
|
||||
"btn_close": "Close"
|
||||
},
|
||||
"approval": {
|
||||
"approved": "Approved",
|
||||
"not_approved": "Not approved"
|
||||
},
|
||||
"section": {
|
||||
"alimtalk_title": "Alimtalk template",
|
||||
"sms_title": "SMS",
|
||||
"alimtalk_enabled": "Send alimtalk",
|
||||
"locked_hint": "Templates under review or already approved cannot be edited. Press [Cancel request] or [Edit (cancel approval)] first.",
|
||||
"saved_toast": "Notification template saved.",
|
||||
"loading": "Loading template…"
|
||||
}
|
||||
},
|
||||
"manage": {
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
}
|
||||
},
|
||||
"template": {
|
||||
"tab_guide": "알림별로 알림톡 템플릿을 작성해 검수를 신청하세요. 카카오 승인 후 알림톡이 자동 발송되며, 대체 SMS·SMS 단독 발송도 이 화면에서 설정합니다.",
|
||||
"tab_guide": "각 알림의 [편집]에서 알림톡 템플릿과 문자(SMS) 본문을 함께 작성하고 검수를 신청하세요. 카카오 승인 후 알림톡이 자동 발송되며, 대체 SMS·SMS 단독 발송도 같은 창에서 설정합니다.",
|
||||
"status": {
|
||||
"unwritten": "미작성",
|
||||
"draft": "작성중",
|
||||
@@ -137,7 +137,11 @@
|
||||
"sms_only": "SMS 단독",
|
||||
"sms_body_prefix": "본문:",
|
||||
"sms_body_missing": "SMS 본문 미설정",
|
||||
"btn_edit_sms": "SMS 본문 편집"
|
||||
"btn_edit_sms": "SMS 본문 편집",
|
||||
"sms_label": "문자(SMS)",
|
||||
"on": "사용",
|
||||
"off": "미사용",
|
||||
"alimtalk_disabled": "발송 사용 안 함"
|
||||
},
|
||||
"form": {
|
||||
"modal_title": "알림톡 템플릿 — {name}",
|
||||
@@ -199,6 +203,9 @@
|
||||
"btn_remove_quick_reply": "바로연결 삭제",
|
||||
"btn_save": "저장",
|
||||
"btn_save_request": "저장 후 검수 신청",
|
||||
"request_comment": "검수자 전달 의견",
|
||||
"request_comment_placeholder": "예: #{name}=홍길동, #{order_number}=20260823-0001",
|
||||
"request_comment_hint": "검수 신청 시 카카오 검수자에게 함께 전달됩니다(선택, 500자 이내). 카카오 심사 가이드는 본문 변수마다 예시값을 요구하므로 변수별 예시값을 적어 두면 반려를 줄일 수 있습니다. 저장되지 않으며 신청할 때만 전송됩니다.",
|
||||
"saved_toast": "알림 템플릿을 저장했습니다.",
|
||||
"requested_toast": "검수를 신청했습니다. 승인되면 알림톡 발송이 시작됩니다."
|
||||
},
|
||||
@@ -217,6 +224,18 @@
|
||||
"rejection": {
|
||||
"modal_title": "반려 사유 — {name}",
|
||||
"btn_close": "닫기"
|
||||
},
|
||||
"approval": {
|
||||
"approved": "승인됨",
|
||||
"not_approved": "미승인"
|
||||
},
|
||||
"section": {
|
||||
"alimtalk_title": "알림톡 템플릿",
|
||||
"sms_title": "문자(SMS)",
|
||||
"alimtalk_enabled": "알림톡 발송 사용",
|
||||
"locked_hint": "검수중이거나 승인된 템플릿은 내용을 수정할 수 없습니다. 수정하려면 [신청 취소] 또는 [수정 (승인 취소)]를 먼저 누르세요.",
|
||||
"saved_toast": "알림 템플릿을 저장했습니다.",
|
||||
"loading": "템플릿 내용을 불러오는 중…"
|
||||
}
|
||||
},
|
||||
"manage": {
|
||||
|
||||
+281
-112
@@ -1648,7 +1648,7 @@
|
||||
"type": "composite",
|
||||
"name": "Select",
|
||||
"props": {
|
||||
"className": "w-40 text-sm",
|
||||
"className": "w-40 text-sm flex-shrink-0",
|
||||
"value": "{{query.bz_status ?? ''}}",
|
||||
"options": "{{[{value: '', label: $t('sirsoft-message_bizppurio.manage.filter_all')}, ...['draft','requested','approved','rejected','stopped','blocked','dormant'].map(s => ({value: s, label: $t('sirsoft-message_bizppurio.template.status.' + s)}))]}}"
|
||||
},
|
||||
@@ -1677,13 +1677,20 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "flex-1 min-w-0 text-sm"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Input",
|
||||
"props": {
|
||||
"className": "w-full px-3 py-2 text-sm bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100 w-56",
|
||||
"className": "flex-1 min-w-0 px-3 py-2 text-sm bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100",
|
||||
"placeholder": "$t:sirsoft-message_bizppurio.manage.search_placeholder",
|
||||
"value": "{{_local.bzSearchDraft ?? (query.bz_search ?? '')}}"
|
||||
},
|
||||
@@ -1696,14 +1703,21 @@
|
||||
"bzSearchDraft": "{{$event.target.value}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "w-full px-3 py-2 text-sm bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
||||
"className": "btn btn-primary whitespace-nowrap flex-shrink-0"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
@@ -1737,7 +1751,7 @@
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "flex-center gap-2 flex-wrap"
|
||||
"className": "flex-center gap-2 flex-wrap flex-1 min-w-0"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1745,7 +1759,8 @@
|
||||
"name": "Button",
|
||||
"props": {
|
||||
"type": "button",
|
||||
"className": "text-xs font-medium px-2.5 py-1 rounded-md whitespace-nowrap flex-shrink-0 border border-gray-300 dark:border-gray-600 text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"
|
||||
"aria-label": "$t:sirsoft-message_bizppurio.templates.list.refresh",
|
||||
"className": "btn-icon flex-shrink-0"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
@@ -1756,7 +1771,17 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"text": "$t:sirsoft-message_bizppurio.templates.list.refresh"
|
||||
"comment": "새로고침 — 코어 관리자 목록 관례(btn-icon + 회전 아이콘)와 통일 (PO 지시 2026-08-24).",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Icon",
|
||||
"props": {
|
||||
"name": "fas fa-arrows-rotate",
|
||||
"className": "text-base"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
@@ -1776,105 +1801,125 @@
|
||||
"name": "Div",
|
||||
"children": [
|
||||
{
|
||||
"id": "bz_manage_list_header",
|
||||
"type": "basic",
|
||||
"name": "Table",
|
||||
"name": "Div",
|
||||
"comment": "데스크톱 grid 헤더 — portable 에서는 카드가 자기 서술이므로 숨긴다 (PO 지시 2026-08-24 모바일 카드뷰).",
|
||||
"props": {
|
||||
"className": "w-full text-left"
|
||||
"className": "grid grid-cols-12 gap-2 px-4 py-2.5 bg-gray-50 dark:bg-gray-900 text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "hidden"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Thead",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "bg-gray-50 dark:bg-gray-900"
|
||||
"className": "col-span-3"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.notification"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "col-span-2"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.owner"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "col-span-1"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.status"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "col-span-1"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.sms"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "col-span-1"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.requested_at"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "col-span-1"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.synced_at"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "col-span-3 text-right"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.actions"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bz_manage_list_rows",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"if": "{{(bizppurio_templates_list?.data?.templates ?? []).length > 0}}",
|
||||
"props": {
|
||||
"className": "divide-y divide-gray-100 dark:divide-gray-700"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"comment": "반복 노드에는 responsive 를 두지 않는다(저장소 관례 — 실측상 반복 노드 위 오버라이드는 화면 전환에 반영되지 않아, 클래스·responsive 는 내부 래퍼가 담당한다. 2026-08-24 Chrome 실측).",
|
||||
"iteration": {
|
||||
"source": "{{bizppurio_templates_list?.data?.templates ?? []}}",
|
||||
"item_var": "bzRow",
|
||||
"index_var": "bzRowIdx"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Tr",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-left text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.notification"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-left text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.owner"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-left text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.status"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-left text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.sms"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-left text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.requested_at"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-left text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.synced_at"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Th",
|
||||
"props": {
|
||||
"className": "px-4 py-2.5 text-right text-xs font-medium text-gray-500 dark:text-gray-400"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.manage.columns.actions"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Tbody",
|
||||
"if": "{{(bizppurio_templates_list?.data?.templates ?? []).length > 0}}",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Tr",
|
||||
"iteration": {
|
||||
"source": "{{bizppurio_templates_list?.data?.templates ?? []}}",
|
||||
"item_var": "bzRow",
|
||||
"index_var": "bzRowIdx"
|
||||
},
|
||||
"name": "Div",
|
||||
"comment": "행 — 데스크톱 grid 12열, portable 에서 카드(flex-wrap: 이름 전폭 → 배지 줄 → 메타 줄 → 액션 전폭).",
|
||||
"props": {
|
||||
"className": "border-t border-gray-100 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
||||
"className": "grid grid-cols-12 gap-2 px-4 py-3 items-center hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "flex flex-wrap gap-2 px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3 text-sm text-gray-700 dark:text-gray-200"
|
||||
"className": "col-span-3"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "w-full"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
@@ -1892,22 +1937,45 @@
|
||||
"props": {
|
||||
"className": "text-xs text-gray-400 dark:text-gray-500"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"comment": "카드 메타 줄 — 데스크톱에서 별도 열인 소속·신청일·동기화일을 portable 카드에서 한 줄로 요약.",
|
||||
"props": {
|
||||
"className": "hidden"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "text-xs text-gray-400 dark:text-gray-500 mt-1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"text": "{{$t('sirsoft-message_bizppurio.manage.owner.' + (bzRow.definition_extension_type ?? 'core'))}} {{(bzRow.definition_extension_type ?? 'core') === 'core' ? '' : ('(' + (bzRow.definition_extension_identifier ?? '') + ')')}} · {{$t('sirsoft-message_bizppurio.manage.columns.requested_at')}} {{(bzRow.requested_at ?? '').slice(0, 10) || '-'}} · {{$t('sirsoft-message_bizppurio.manage.columns.synced_at')}} {{(bzRow.last_synced_at ?? '').slice(0, 10) || '-'}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3 text-sm text-gray-700 dark:text-gray-200"
|
||||
"className": "col-span-2 text-sm text-gray-700 dark:text-gray-200"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "hidden"
|
||||
}
|
||||
}
|
||||
},
|
||||
"text": "{{$t('sirsoft-message_bizppurio.manage.owner.' + (bzRow.definition_extension_type ?? 'core'))}} {{(bzRow.definition_extension_type ?? 'core') === 'core' ? '' : ('(' + (bzRow.definition_extension_identifier ?? '') + ')')}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3 text-sm text-gray-700 dark:text-gray-200"
|
||||
"className": "col-span-1"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
@@ -1922,33 +1990,64 @@
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3 text-sm text-gray-700 dark:text-gray-200"
|
||||
"className": "col-span-1"
|
||||
},
|
||||
"text": "{{bzRow.sms_only ? $t('sirsoft-message_bizppurio.manage.sms_only') : (bzRow.fallback_sms_enabled ? $t('sirsoft-message_bizppurio.manage.sms_fallback') : '-')}}"
|
||||
"comment": "SMS 발송 모드 배지 — 단독/대체(초록), 미사용(회색). 행 하단 상태 배지와 같은 규칙(PO 지시 2026-08-23).",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"props": {
|
||||
"className": "{{'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ' + ((bzRow.sms_only || bzRow.fallback_sms_enabled) ? 'bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-200' : 'bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300')}}"
|
||||
},
|
||||
"text": "{{bzRow.sms_only ? $t('sirsoft-message_bizppurio.manage.sms_only') : (bzRow.fallback_sms_enabled ? $t('sirsoft-message_bizppurio.manage.sms_fallback') : $t('sirsoft-message_bizppurio.template.row.off'))}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3 text-sm text-gray-700 dark:text-gray-200 tabular-nums"
|
||||
"className": "col-span-1 text-sm text-gray-700 dark:text-gray-200 tabular-nums"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "hidden"
|
||||
}
|
||||
}
|
||||
},
|
||||
"text": "{{(bzRow.requested_at ?? '').slice(0, 10) || '-'}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3 text-sm text-gray-700 dark:text-gray-200 tabular-nums"
|
||||
"className": "col-span-1 text-sm text-gray-700 dark:text-gray-200 tabular-nums"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "hidden"
|
||||
}
|
||||
}
|
||||
},
|
||||
"text": "{{(bzRow.last_synced_at ?? '').slice(0, 10) || '-'}}"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Td",
|
||||
"name": "Div",
|
||||
"props": {
|
||||
"className": "px-4 py-3"
|
||||
"className": "col-span-3"
|
||||
},
|
||||
"responsive": {
|
||||
"portable": {
|
||||
"props": {
|
||||
"className": "w-full pt-1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
@@ -2072,7 +2171,8 @@
|
||||
"description": "",
|
||||
"imageUrl": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"request_comment": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2540,7 +2640,7 @@
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "admin-card overflow-x-auto p-0"
|
||||
"className": "admin-card p-0 overflow-hidden"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -3421,7 +3521,7 @@
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "space-y-1.5"
|
||||
"className": "space-y-2"
|
||||
},
|
||||
"if": "{{_global.bz_tpl_modal?.content?.templateEmphasizeType === 'ITEM_LIST'}}"
|
||||
},
|
||||
@@ -3654,7 +3754,7 @@
|
||||
"index_var": "buttonsIdx"
|
||||
},
|
||||
"props": {
|
||||
"className": "p-2.5 rounded-lg border border-gray-200 dark:border-gray-700 space-y-1.5"
|
||||
"className": "p-3 rounded-lg border border-gray-200 dark:border-gray-700 space-y-2"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
@@ -3866,7 +3966,7 @@
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "space-y-1.5"
|
||||
"className": "space-y-2"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -3919,7 +4019,7 @@
|
||||
"index_var": "quickRepliesIdx"
|
||||
},
|
||||
"props": {
|
||||
"className": "p-2.5 rounded-lg border border-gray-200 dark:border-gray-700 space-y-1.5"
|
||||
"className": "p-3 rounded-lg border border-gray-200 dark:border-gray-700 space-y-2"
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
@@ -4131,8 +4231,71 @@
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "space-y-1.5"
|
||||
"className": "space-y-2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bz_manage_request_comment",
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"comment": "검수자 전달 의견 — kapi template/request 의 comment(≤500). 카카오 심사 가이드가 요구하는 변수 예시값 등을 검수자에게 전할 유일한 통로(PO 결정 2026-08-23 §18.7). 신청 시에만 전송되며 행에 저장되지 않는다.",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Div",
|
||||
"children": [
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Label",
|
||||
"props": {
|
||||
"className": "text-secondary block text-xs font-medium mb-1"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.form.request_comment"
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Span",
|
||||
"text": "{{(_global.bz_tpl_modal?.request_comment ?? '').length}}/500",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-400 dark:text-gray-500"
|
||||
}
|
||||
}
|
||||
],
|
||||
"props": {
|
||||
"className": "flex-between"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "Textarea",
|
||||
"props": {
|
||||
"name": "bz_request_comment",
|
||||
"rows": 3,
|
||||
"maxLength": 500,
|
||||
"className": "w-full px-3 py-2 text-sm bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-900 dark:text-gray-100",
|
||||
"placeholder": "$t:sirsoft-message_bizppurio.template.form.request_comment_placeholder",
|
||||
"value": "{{_global.bz_tpl_modal?.request_comment ?? ''}}"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"type": "change",
|
||||
"handler": "setState",
|
||||
"params": {
|
||||
"target": "global",
|
||||
"bz_tpl_modal.request_comment": "{{$event.target.value}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "basic",
|
||||
"name": "P",
|
||||
"props": {
|
||||
"className": "text-xs text-gray-500 dark:text-gray-400 mt-1"
|
||||
},
|
||||
"text": "$t:sirsoft-message_bizppurio.template.form.request_comment_hint"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -4354,7 +4517,10 @@
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{response.data?.template?.id}}/request",
|
||||
"params": {
|
||||
"method": "POST"
|
||||
"method": "POST",
|
||||
"body": {
|
||||
"comment": "{{_global.bz_tpl_modal?.request_comment ?? ''}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
@@ -4452,7 +4618,10 @@
|
||||
"auth_required": true,
|
||||
"target": "/api/plugins/sirsoft-message_bizppurio/admin/templates/{{_global.bz_tpl_modal?.id}}/request",
|
||||
"params": {
|
||||
"method": "POST"
|
||||
"method": "POST",
|
||||
"body": {
|
||||
"comment": "{{_global.bz_tpl_modal?.request_comment ?? ''}}"
|
||||
}
|
||||
},
|
||||
"onSuccess": [
|
||||
{
|
||||
|
||||
+4
-2
@@ -12,6 +12,7 @@ use Plugins\Sirsoft\MessageBizppurio\Exceptions\BizppurioApiException;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Exceptions\BizppurioTemplateStateException;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Http\Requests\BizppurioTemplateImageRequest;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Http\Requests\BizppurioTemplateListRequest;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Http\Requests\RequestBizppurioInspectionRequest;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Http\Requests\StoreBizppurioTemplateRequest;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Http\Requests\UpdateBizppurioDeliveryRequest;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Http\Requests\UpdateBizppurioTemplateRequest;
|
||||
@@ -164,10 +165,11 @@ class BizppurioTemplateController extends AdminBaseController
|
||||
/**
|
||||
* 검수를 신청합니다 (채번 → kapi add/update → request → status=requested).
|
||||
*
|
||||
* @param RequestBizppurioInspectionRequest $request 검수자 전달 의견(comment, 선택 ≤500)
|
||||
* @param int $id 템플릿 PK
|
||||
* @return JsonResponse data.template 에 갱신된 행
|
||||
*/
|
||||
public function requestInspection(int $id): JsonResponse
|
||||
public function requestInspection(RequestBizppurioInspectionRequest $request, int $id): JsonResponse
|
||||
{
|
||||
$template = $this->service->find($id);
|
||||
if ($template === null) {
|
||||
@@ -176,7 +178,7 @@ class BizppurioTemplateController extends AdminBaseController
|
||||
|
||||
return $this->guardLifecycle(fn () => ResponseHelper::success(
|
||||
'sirsoft-message_bizppurio::messages.template.requested',
|
||||
['template' => $this->detailRow($this->service->requestInspection($template))],
|
||||
['template' => $this->detailRow($this->service->requestInspection($template, $request->comment()))],
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Plugins\Sirsoft\MessageBizppurio\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* 알림톡 템플릿 검수 신청 요청 검증 (#597 §18.7 — PO 결정 2026-08-23).
|
||||
*
|
||||
* 카카오 심사 가이드는 템플릿 변수마다 '예시 텍스트' 를 요구하지만 kapi `template/add` 에는
|
||||
* 예시 필드가 없다. 검수자에게 무언가를 전달할 유일한 통로가 `template/request` 의
|
||||
* comment(≤500)이므로 그 값을 선택 입력으로 받는다. 행에는 저장하지 않고 신청 호출에만 싣는다.
|
||||
*/
|
||||
class RequestBizppurioInspectionRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* 권한은 라우트 미들웨어(messaging.manage)에서 처리한다.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 규칙을 반환합니다.
|
||||
*
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'comment' => ['sometimes', 'nullable', 'string', 'max:500'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 검수자 전달 의견을 반환합니다 (앞뒤 공백 제거, 비어 있으면 null).
|
||||
*
|
||||
* @return string|null 전달 의견
|
||||
*/
|
||||
public function comment(): ?string
|
||||
{
|
||||
$comment = trim((string) ($this->validated()['comment'] ?? ''));
|
||||
|
||||
return $comment === '' ? null : $comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검증 오류 문구에 쓰일 필드 라벨을 반환합니다.
|
||||
*
|
||||
* @return array<string, string> 필드 경로 → 라벨
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'comment' => __('sirsoft-message_bizppurio::messages.validation.attributes.comment'),
|
||||
];
|
||||
}
|
||||
}
|
||||
+6
@@ -270,6 +270,11 @@ class RegisterNotificationChannelsListener implements HookListenerInterface
|
||||
* - sms.hidden_tab: 탭만 숨긴다(채널 토글 카드·발송 축은 그대로).
|
||||
* - alimtalk.tab_channels: 이 목록 중 하나라도 활성 저장이면 탭을 노출한다.
|
||||
* - alimtalk.tab_label_key: 탭 라벨용 프론트 lang 키($t 해석 — 카드 라벨(name)과 분리).
|
||||
* - alimtalk.hidden_template_editor: 코어 알림 템플릿 [편집] 모달의 제목/본문 입력·미리보기·
|
||||
* 코어 [저장]을 숨긴다(PO 결정 2026-08-23). 알림톡 본문은 카카오 규격(#{var}, 유형별 필드)이라
|
||||
* 코어 본문과 다른 편집기가 필요하고, 그 편집기·통합 저장은 플러그인이 같은 모달의
|
||||
* extension_point(notification_template_form_sections / _footer_actions)에 주입한다.
|
||||
* 코어 채널 템플릿 행(제목/본문)은 발송에 쓰이지 않으므로 숨겨도 동작 손실이 없다.
|
||||
* 코어 getAvailableChannels 는 임의 필드를 보존하므로 프론트까지 그대로 도달한다
|
||||
* (is_test_mode 와 동일 경로).
|
||||
*
|
||||
@@ -298,6 +303,7 @@ class RegisterNotificationChannelsListener implements HookListenerInterface
|
||||
'allow_guest' => true,
|
||||
'tab_channels' => ['sms', 'alimtalk'],
|
||||
'tab_label_key' => self::PLUGIN_IDENTIFIER.'.channels.bizppurio_tab',
|
||||
'hidden_template_editor' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
+9
-2
@@ -16,14 +16,20 @@ use App\Contracts\Extension\HookListenerInterface;
|
||||
* (NotificationSyncHelper::syncTemplate), cleanupStaleTemplates 의 definedChannels 에 우리
|
||||
* 채널이 포함되므로 재시딩·업데이트에도 삭제되지 않는다. 코어·모듈 파일은 수정하지 않는다.
|
||||
*
|
||||
* 구독 훅(3영역, 정의 배열을 넘기는 필터):
|
||||
* 구독 훅(정의 배열을 넘기는 필터 4종):
|
||||
* - seed.notifications.translations (코어 — config/core.php)
|
||||
* - seed.sirsoft-board.notifications.translations (게시판)
|
||||
* - seed.sirsoft-ecommerce.notifications.translations (이커머스)
|
||||
* - core.notification.filter_default_definitions (코어 [기본값 복원] 경로 —
|
||||
* NotificationTemplateService::getDefaultTemplateData). 시딩 3훅과 같은 증강을 적용해야
|
||||
* 우리가 시드한 sms·alimtalk 행의 [기본값 복원]이 "기본 템플릿 데이터를 찾을 수 없습니다" 로
|
||||
* 끝나지 않는다 — 시드 출처와 복원 출처가 같은 함수여야 한다(#597 §18.7 C2 실측 결함).
|
||||
* 게시판·이커머스가 자기 정의를 이 필터에 보태는 priority 20 뒤(50)에 돌아야 모듈 정의도
|
||||
* 증강된다.
|
||||
*
|
||||
* 배열 형태 차이:
|
||||
* - 코어: 연관 배열 `['welcome' => [...], ...]` (키가 type)
|
||||
* - 모듈: 순차 배열 `[['type' => 'order_confirmed', ...], ...]`
|
||||
* - 모듈·기본값 복원 경로: 순차 배열 `[['type' => 'order_confirmed', ...], ...]`
|
||||
* 둘 다 각 정의 값에 대해 동일하게 채널을 증강하고 키/순서는 보존한다.
|
||||
*
|
||||
* 증강 대상 = 회원(사용자) 대상 알림(결정 E). 관리자 전용(수신자가 role:admin 뿐인) 알림은
|
||||
@@ -54,6 +60,7 @@ class SeedChannelTemplatesListener implements HookListenerInterface
|
||||
'seed.notifications.translations',
|
||||
'seed.sirsoft-board.notifications.translations',
|
||||
'seed.sirsoft-ecommerce.notifications.translations',
|
||||
'core.notification.filter_default_definitions',
|
||||
] as $hook) {
|
||||
$hooks[$hook] = [
|
||||
'method' => 'augment',
|
||||
|
||||
+9
-2
@@ -193,14 +193,17 @@ class BizppurioTemplateService
|
||||
* - template_code 가 없으면(최초) 자체 채번 후 kapi add, 있으면(재신청) kapi update.
|
||||
* add 성공 시점에만 template_code 를 행에 확정하므로, add 자체가 실패하면 다음
|
||||
* 시도에서 다시 채번부터 진행된다.
|
||||
* - 검수자 전달 의견(comment)은 kapi request 에만 싣고 행에 저장하지 않는다 — 카카오 심사
|
||||
* 가이드가 요구하는 변수 '예시 텍스트' 를 전할 유일한 통로다(PO 결정 2026-08-23, §18.7).
|
||||
*
|
||||
* @param BizppurioTemplate $template 대상 행
|
||||
* @param string|null $comment 검수자 전달 의견 (≤500, 비어 있으면 미전달)
|
||||
* @return BizppurioTemplate 갱신된 행 (status=requested)
|
||||
*
|
||||
* @throws BizppurioTemplateStateException 신청 불가 상태·content 미작성
|
||||
* @throws BizppurioApiException kapi 실패 (사유 원문 보존)
|
||||
*/
|
||||
public function requestInspection(BizppurioTemplate $template): BizppurioTemplate
|
||||
public function requestInspection(BizppurioTemplate $template, ?string $comment = null): BizppurioTemplate
|
||||
{
|
||||
if (! is_array($template->content) || $template->content === []) {
|
||||
throw new BizppurioTemplateStateException(
|
||||
@@ -248,7 +251,11 @@ class BizppurioTemplateService
|
||||
$this->assertSuccess($this->kakao->updateTemplate($payload));
|
||||
}
|
||||
|
||||
$this->assertSuccess($this->kakao->requestInspection($senderKey, (string) $template->template_code));
|
||||
$this->assertSuccess($this->kakao->requestInspection(
|
||||
$senderKey,
|
||||
(string) $template->template_code,
|
||||
trim((string) $comment),
|
||||
));
|
||||
} catch (\Throwable $e) {
|
||||
// 선점 해제: kapi 미완료 상태로 requested 가 남지 않도록 원래 상태로 복귀.
|
||||
$this->templates->update($template, ['status' => $originalStatus->value]);
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Plugins\Sirsoft\MessageBizppurio\Tests\Feature\Notification;
|
||||
|
||||
use App\Extension\HookListenerRegistrar;
|
||||
use App\Models\NotificationDefinition;
|
||||
use App\Models\NotificationTemplate;
|
||||
use App\Models\Permission;
|
||||
use App\Models\Role;
|
||||
use App\Models\User;
|
||||
use App\Services\NotificationTemplateService;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Listeners\SeedChannelTemplatesListener;
|
||||
use Plugins\Sirsoft\MessageBizppurio\Tests\PluginTestCase;
|
||||
|
||||
/**
|
||||
* 코어 [기본값 복원]이 플러그인이 시드한 alimtalk 채널 template 에서도 동작한다 (#597 §18.7 C2).
|
||||
*
|
||||
* 실측 결함: welcome 알림톡 행의 [기본값 복원] → 404 "기본 템플릿 데이터를 찾을 수 없습니다".
|
||||
* 플러그인이 시딩 훅(seed.*.notifications.translations)으로 행을 만들어 놓고, 복원 경로가
|
||||
* 통과하는 필터(core.notification.filter_default_definitions)에는 참여하지 않아서였다.
|
||||
*
|
||||
* 리스너 메서드를 직접 부르지 않는다 — 실제 등록 경로(HookListenerRegistrar)로 올린 뒤
|
||||
* 코어 서비스·엔드포인트의 관찰 가능한 결과(복원값·행 상태)로 판정한다.
|
||||
*/
|
||||
class CoreTemplateResetDefaultsTest extends PluginTestCase
|
||||
{
|
||||
/** 리스너를 실제 훅 파이프라인에 등록합니다 (getSubscribedHooks 기반). */
|
||||
private function registerListener(): void
|
||||
{
|
||||
HookListenerRegistrar::register(SeedChannelTemplatesListener::class, 'plugin:sirsoft-message_bizppurio');
|
||||
}
|
||||
|
||||
/** config/core.php welcome 정의의 database 채널 본문(ko) — 시딩·복원이 공유하는 출처. */
|
||||
private function welcomeDatabaseBodyKo(): string
|
||||
{
|
||||
foreach (config('core.notification_definitions.welcome.templates', []) as $template) {
|
||||
if (($template['channel'] ?? null) === 'database') {
|
||||
return (string) $template['body']['ko'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->fail('config/core.php welcome 정의에 database 채널 template 이 없다.');
|
||||
}
|
||||
|
||||
/** welcome 정의 + 운영자가 손본(is_default=false) alimtalk 채널 행. */
|
||||
private function modifiedAlimtalkTemplate(): NotificationTemplate
|
||||
{
|
||||
$definition = NotificationDefinition::create([
|
||||
'type' => 'welcome',
|
||||
'hook_prefix' => 'core.auth',
|
||||
'extension_type' => 'core',
|
||||
'extension_identifier' => 'core',
|
||||
'name' => ['ko' => '회원가입 환영', 'en' => 'Welcome'],
|
||||
'variables' => [['key' => 'name', 'description' => '이름']],
|
||||
'channels' => ['mail', 'database', 'alimtalk'],
|
||||
'hooks' => ['core.auth.after_register'],
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
return NotificationTemplate::create([
|
||||
'definition_id' => $definition->id,
|
||||
'channel' => 'alimtalk',
|
||||
'subject' => ['ko' => '바뀐 제목'],
|
||||
'body' => ['ko' => '바뀐 본문 {name}'],
|
||||
'recipients' => [['type' => 'role', 'value' => 'admin']],
|
||||
'is_active' => true,
|
||||
'is_default' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
/** core.settings.update 권한을 가진 관리자의 인증 헤더. */
|
||||
private function adminHeaders(): array
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
$adminRole = Role::firstOrCreate(
|
||||
['identifier' => 'admin'],
|
||||
['name' => json_encode(['ko' => '관리자', 'en' => 'Admin']), 'type' => 'admin']
|
||||
);
|
||||
$permission = Permission::firstOrCreate(
|
||||
['identifier' => 'core.settings.update'],
|
||||
['name' => json_encode(['ko' => '설정 수정', 'en' => 'Settings update']), 'type' => 'admin']
|
||||
);
|
||||
$adminRole->permissions()->syncWithoutDetaching([$permission->id]);
|
||||
$user->roles()->attach($adminRole->id, ['assigned_at' => now(), 'assigned_by' => null]);
|
||||
|
||||
return [
|
||||
'Accept' => 'application/json',
|
||||
'Authorization' => 'Bearer '.$user->fresh()->createToken('test')->plainTextToken,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @effects core_reset_restores_seeded_channel_template_defaults
|
||||
*/
|
||||
public function test_리스너_등록_후_코어_기본값_조회가_시드와_같은_alimtalk_기본값을_돌려준다(): void
|
||||
{
|
||||
$this->registerListener();
|
||||
|
||||
$data = app(NotificationTemplateService::class)->getDefaultTemplateData('welcome', 'alimtalk');
|
||||
|
||||
$this->assertNotEmpty($data, '복원 경로가 alimtalk 기본값을 찾아야 한다(시드만 하고 복원에 빠지면 빈 배열).');
|
||||
$this->assertSame([['type' => 'trigger_user']], $data['recipients']);
|
||||
$this->assertSame($this->welcomeDatabaseBodyKo(), $data['body']['ko'], '시딩과 같은 database 평문 body 가 복원값이다.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @effects core_reset_restores_seeded_channel_template_defaults
|
||||
*/
|
||||
public function test_기본값_복원_엔드포인트가_시드된_alimtalk_행을_복원한다(): void
|
||||
{
|
||||
$this->registerListener();
|
||||
$template = $this->modifiedAlimtalkTemplate();
|
||||
|
||||
$this->postJson('/api/admin/notification-templates/'.$template->id.'/reset', [], $this->adminHeaders())
|
||||
->assertOk();
|
||||
|
||||
$fresh = $template->fresh();
|
||||
$this->assertTrue((bool) $fresh->is_default, '복원 후 "사용자 수정" 표시가 사라져야 한다.');
|
||||
$this->assertSame([['type' => 'trigger_user']], $fresh->recipients);
|
||||
$this->assertSame($this->welcomeDatabaseBodyKo(), $fresh->body['ko']);
|
||||
}
|
||||
}
|
||||
+40
@@ -609,6 +609,46 @@ class BizppurioTemplateControllerTest extends PluginTestCase
|
||||
Http::assertSentCount(3); // codeCheck → add → request
|
||||
}
|
||||
|
||||
/**
|
||||
* 검수자 전달 의견(comment)은 선택 입력이며 kapi request 로만 전달된다 (#597 §18.7 — PO 결정 2026-08-23).
|
||||
*
|
||||
* 500자 초과는 FormRequest 가 kapi 호출 전에 422 로 끊고(행 상태 불변), 유효한 의견은
|
||||
* `template/request` 의 comment 로 원문 그대로 실린다.
|
||||
*
|
||||
* @effects inspection_request_carries_reviewer_comment
|
||||
*/
|
||||
public function test_검수_신청의_comment는_kapi_request에_실리고_500자를_넘으면_422다(): void
|
||||
{
|
||||
Http::fake(['kapi.ppurio.com/*' => Http::response(['code' => '200', 'message' => 'ok'])]);
|
||||
$this->seedKakaoSettings();
|
||||
$this->definition();
|
||||
$template = BizppurioTemplate::create([
|
||||
'notification_type' => 'welcome',
|
||||
'status' => 'draft',
|
||||
'content' => $this->baseContent(),
|
||||
]);
|
||||
$user = $this->adminWith([self::MANAGE]);
|
||||
|
||||
$this->postJson(self::BASE.'/'.$template->id.'/request', ['comment' => str_repeat('가', 501)], $this->authHeaders($user))
|
||||
->assertStatus(422)
|
||||
->assertJsonValidationErrors('comment');
|
||||
$this->assertSame(BizppurioTemplateStatus::Draft, $template->fresh()->status, '검증 실패는 kapi 호출 전에 끝나야 한다(선점 없음).');
|
||||
Http::assertNothingSent();
|
||||
|
||||
$this->postJson(self::BASE.'/'.$template->id.'/request', ['comment' => '변수 예시: #{name}=홍길동'], $this->authHeaders($user))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.template.status', 'requested');
|
||||
|
||||
Http::assertSent(function ($request) {
|
||||
if (parse_url($request->url(), PHP_URL_PATH) !== '/v3/kakao/template/request') {
|
||||
return false;
|
||||
}
|
||||
$this->assertSame('변수 예시: #{name}=홍길동', $request->data()['comment'] ?? null);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @scenario content_variant=ad_image, transition=draft_to_requested
|
||||
*
|
||||
|
||||
+137
-31
@@ -1,14 +1,18 @@
|
||||
/**
|
||||
* E2E 정밀 점검 매트릭스: 비즈뿌리오 알림 템플릿 라이프사이클 (#597 §6.3)
|
||||
*
|
||||
* @scenario bizppurio_tab_integration_e2e, bizppurio_compose_modal_e2e, bizppurio_manage_round_trip_e2e
|
||||
* @scenario bizppurio_tab_integration_e2e, bizppurio_edit_modal_e2e, bizppurio_compose_modal_e2e, bizppurio_manage_round_trip_e2e
|
||||
* @effects bizppurio_tab_replaces_sms_and_alimtalk_tabs, tab_visible_when_any_of_tab_channels_active,
|
||||
* row_footer_shows_status_badge_and_lifecycle_actions, compose_modal_switches_conditional_fields_by_type,
|
||||
* row_footer_shows_status_summary_only, approval_badge_two_tier, edit_modal_hosts_alimtalk_and_sms_sections,
|
||||
* core_modal_hides_editor_for_hidden_template_editor_channel, unified_save_chain_alimtalk_then_core_recipients,
|
||||
* compose_modal_switches_conditional_fields_by_type,
|
||||
* manage_screen_lists_db_rows_with_merge_query_round_trip, sms_modal_edits_body_per_locale_tab,
|
||||
* upload_in_progress_locks_save_buttons_not_cancel, manage_row_actions_match_row_footer_visibility,
|
||||
* sms_body_presence_and_preview_resolved_by_server
|
||||
* sms_body_presence_and_preview_resolved_by_server, inspection_request_carries_reviewer_comment
|
||||
*
|
||||
* 계획서 §6.3 이 요구한 7대 축(T1~T7) + 선택 축(T8~T10) + 회귀 축(R1~R6)을 브라우저에서 실측한다.
|
||||
* PO 결정(2026-08-23, 계획서 §18)으로 알림톡 작성·SMS 본문 편집은 행 하단 버튼/별도 모달이 아니라
|
||||
* 코어 [편집] 모달 안의 섹션으로 통합됐다 — 모달 진입은 언제나 행의 [편집] 이고, 저장은 하단 [저장] 하나다.
|
||||
* 이 매트릭스는 라운드 1~4 동안 "수행 증거 없음" 으로 남아 있었고, 그 근본 원인은 플러그인
|
||||
* package.json 에 실행 진입점(test:e2e)이 없었다는 것이다 — 라운드 5 에서 진입점을 만들고
|
||||
* 매트릭스를 spec 으로 고정해 다음 라운드부터는 명령 하나로 재실측된다.
|
||||
@@ -71,7 +75,7 @@ function dialog(page: Page) {
|
||||
return page.getByRole('dialog');
|
||||
}
|
||||
|
||||
/** 모달 안의 저장 버튼(신규/수정 공통 — if 로 하나만 렌더된다) */
|
||||
/** 편집 모달 푸터의 통합 [저장](코어 [저장]은 hidden_template_editor 게이트로 숨는다 — 하나만 렌더된다) */
|
||||
function modalSave(page: Page) {
|
||||
return dialog(page).getByRole('button', { name: '저장', exact: true });
|
||||
}
|
||||
@@ -94,12 +98,18 @@ async function seedTemplate(page: Page, wanted = 'welcome'): Promise<string> {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
// 카테고리 코드는 kapi 실조회 목록에 있는 값이어야 한다 — 편집 모달의 카테고리 셀렉트는
|
||||
// 목록에 없는 값을 빈 값으로 정규화하므로(실측: 더미 코드 '001001' 이 실자격증명 환경에서
|
||||
// 비워져 저장이 422 "카테고리 필수"), 목록이 있으면 첫 코드를, 없으면(자격증명 미설정) 더미를 쓴다.
|
||||
const catRes = await fetch('/api/plugins/sirsoft-message_bizppurio/admin/alimtalk-templates/categories', { headers });
|
||||
const catJson = catRes.ok ? await catRes.json() : null;
|
||||
const firstCategory = catJson?.data?.categories?.[0]?.code;
|
||||
const content = {
|
||||
templateName: '매트릭스 측정용',
|
||||
templateMessageType: 'BA',
|
||||
templateEmphasizeType: 'NONE',
|
||||
templateContent: '초기 본문 #{site_name}',
|
||||
categoryCode: '001001',
|
||||
categoryCode: typeof firstCategory === 'string' && firstCategory ? firstCategory : '001001',
|
||||
};
|
||||
|
||||
const listRes = await fetch('/api/plugins/sirsoft-message_bizppurio/admin/templates?per_page=50', { headers });
|
||||
@@ -110,6 +120,19 @@ async function seedTemplate(page: Page, wanted = 'welcome'): Promise<string> {
|
||||
const existing = rows.find((r: { notification_type?: string; status?: string }) =>
|
||||
r.notification_type === wantedType && r.status === 'draft');
|
||||
|
||||
// 유효 자격증명 환경에서는 10c 의 [저장 후 검수 신청]이 실제로 성립해 행이 requested 로 남는다 —
|
||||
// 다음 실행이 같은 행을 다시 쓰려면 신청을 취소해 draft 로 되돌린다(kapi cancel_request 실호출).
|
||||
const requested = rows.find((r: { notification_type?: string; status?: string }) =>
|
||||
r.notification_type === wantedType && r.status === 'requested');
|
||||
if (!existing && requested) {
|
||||
await fetch(`/api/plugins/sirsoft-message_bizppurio/admin/templates/${requested.id}/cancel-request`, { method: 'POST', headers });
|
||||
await fetch(`/api/plugins/sirsoft-message_bizppurio/admin/templates/${requested.id}`, {
|
||||
method: 'PUT', headers, body: JSON.stringify({ content }),
|
||||
});
|
||||
|
||||
return requested.notification_type as string;
|
||||
}
|
||||
|
||||
if (existing) {
|
||||
await fetch(`/api/plugins/sirsoft-message_bizppurio/admin/templates/${existing.id}`, {
|
||||
method: 'PUT', headers, body: JSON.stringify({ content }),
|
||||
@@ -128,22 +151,35 @@ async function seedTemplate(page: Page, wanted = 'welcome'): Promise<string> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 시드된 행의 수정 모달을 연다.
|
||||
* 알림 행의 코어 [편집] 버튼(그 행 카드 안의 것)을 찾는다.
|
||||
*
|
||||
* 행 카드는 유형 코드(welcome 등)를 font-mono 텍스트로 그린다 — 그 텍스트에서 가장 가까운
|
||||
* "[편집] 버튼을 품은 조상" 이 행 카드다. 목록 순서 의존(first())을 없애 테스트 간 간섭을 막는다.
|
||||
*/
|
||||
function rowEditButton(page: Page, type: string) {
|
||||
return page.getByText(type, { exact: true })
|
||||
.locator('xpath=ancestor::*[.//button[normalize-space()="편집"]][1]')
|
||||
.getByRole('button', { name: '편집', exact: true })
|
||||
.first();
|
||||
}
|
||||
|
||||
/**
|
||||
* 알림 행의 코어 [편집] 모달을 열고 플러그인 섹션 루트(알림톡 템플릿 + 문자 SMS)를 돌려준다.
|
||||
*
|
||||
* @param page 페이지
|
||||
* @param type 알림 유형 코드(없으면 첫 행)
|
||||
*/
|
||||
async function openEditModal(page: Page) {
|
||||
async function openEditModal(page: Page, type?: string) {
|
||||
await page.goto(SETTINGS_URL);
|
||||
await page.waitForLoadState('networkidle', { timeout: 30_000 });
|
||||
|
||||
// 행 컨테이너 id 는 모든 행이 공유하므로 유형으로 특정할 수 없다. 목록 순서는 재조회
|
||||
// 후에도 동일하므로, 같은 테스트 안에서 first() 는 항상 같은 행을 연다 — 저장→새로고침→
|
||||
// 재오픈 왕복 비교에는 그것으로 충분하다. (테스트 간 간섭은 알림 유형 분리로 막는다.)
|
||||
const edit = page.getByRole('button', { name: '수정', exact: true }).first();
|
||||
const edit = type ? rowEditButton(page, type) : page.getByRole('button', { name: '편집', exact: true }).first();
|
||||
await expect(edit).toBeVisible({ timeout: 20_000 });
|
||||
await edit.click();
|
||||
const modal = dialog(page).locator('[id^="bizppurio_tpl_modal_body"]').first();
|
||||
const modal = dialog(page).locator('#bizppurio_tpl_sections');
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
// 작성 폼은 draft/rejected 에서만 열린다 — 시드 행은 draft 이므로 본문 textarea 가 보여야 한다
|
||||
await expect(modal.locator('textarea[name="bz_template_content"]')).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
return modal;
|
||||
}
|
||||
@@ -196,6 +232,13 @@ test.describe('T1 진입/표시', () => {
|
||||
evidence('1b 행 하단 블록 수', rowCount);
|
||||
expect(rowCount).toBeGreaterThan(0);
|
||||
|
||||
// 행 하단은 상태 요약만 — 버튼 0 + 승인 2단 배지(승인됨 | 미승인 (세부))
|
||||
const footerButtons = await rows.locator('button').count();
|
||||
const badges = (await rows.allInnerTexts()).map((t) => (t.match(/승인됨|미승인\s*\([^)]+\)/) ?? [''])[0]);
|
||||
evidence('1b 행 하단 버튼 수 / 배지', { footerButtons, badges });
|
||||
expect(footerButtons).toBe(0);
|
||||
expect(badges.every((b) => b.length > 0)).toBe(true);
|
||||
|
||||
const content = await page.locator('#notif_channel_content').innerText();
|
||||
const rawKeys = (content.match(/\$t:|sirsoft-message_bizppurio\./g) ?? []).length;
|
||||
evidence('1b i18n 원문 노출 수', rawKeys);
|
||||
@@ -255,9 +298,23 @@ test.describe('T2·T3 입력', () => {
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await openBizppurioTab(page);
|
||||
|
||||
await page.getByRole('button', { name: '알림톡 템플릿 작성' }).first().click();
|
||||
const modal = dialog(page).locator('[id^="bizppurio_tpl_modal_body"]').first();
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
await seedTemplate(page, 'welcome');
|
||||
const modal = await openEditModal(page, 'welcome');
|
||||
|
||||
// 2c: 코어 제목/본문 입력은 숨고(hidden_template_editor) 플러그인 섹션 2종이 그 자리를 채운다
|
||||
const coreHidden = {
|
||||
subjectInputs: await dialog(page).locator('#template_subject_input').count(),
|
||||
bodyInputs: await dialog(page).locator('#template_body_input').count(),
|
||||
previewButtons: await dialog(page).getByRole('button', { name: '미리보기', exact: true }).count(),
|
||||
alimtalkSection: await dialog(page).locator('#bizppurio_tpl_alimtalk_section').count(),
|
||||
smsSection: await dialog(page).locator('#bizppurio_tpl_sms_section').count(),
|
||||
saveButtons: await dialog(page).getByRole('button', { name: '저장', exact: true }).count(),
|
||||
};
|
||||
evidence('2c 코어 입력 숨김 / 섹션 2종 / 저장 버튼 수', coreHidden);
|
||||
expect(coreHidden.subjectInputs + coreHidden.bodyInputs + coreHidden.previewButtons).toBe(0);
|
||||
expect(coreHidden.alimtalkSection).toBe(1);
|
||||
expect(coreHidden.smsSection).toBe(1);
|
||||
expect(coreHidden.saveButtons, '저장은 하나여야 한다(코어 저장은 숨김)').toBe(1);
|
||||
|
||||
const name = await modal.locator('input[name="bz_template_name"]').inputValue();
|
||||
evidence('2a 템플릿명 프리필', name);
|
||||
@@ -303,9 +360,8 @@ test.describe('T2·T3 입력', () => {
|
||||
test('3a 버튼 3회 추가 + 1회 삭제 → 카운트 정합, 5개 도달 시 추가 잠김', async ({ page, messagingManageToken }) => {
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await openBizppurioTab(page);
|
||||
await page.getByRole('button', { name: '알림톡 템플릿 작성' }).first().click();
|
||||
const modal = dialog(page).locator('[id^="bizppurio_tpl_modal_body"]').first();
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
await seedTemplate(page, 'welcome');
|
||||
const modal = await openEditModal(page, 'welcome');
|
||||
|
||||
const addBtn = modal.getByRole('button', { name: '버튼 추가' });
|
||||
const rowCount = () => modal.getByPlaceholder('버튼명', { exact: false }).count();
|
||||
@@ -360,7 +416,7 @@ test.describe('T4 제출/응답 + T10 경계', () => {
|
||||
const results: Record<string, number> = {};
|
||||
const typed: Record<string, number> = {};
|
||||
for (const len of [999, 1000, 1001]) {
|
||||
const modal = await openEditModal(page);
|
||||
const modal = await openEditModal(page, 'reset_password');
|
||||
|
||||
const ta = modal.locator('textarea[name="bz_template_content"]');
|
||||
await ta.fill('가'.repeat(len));
|
||||
@@ -387,10 +443,13 @@ test.describe('T4 제출/응답 + T10 경계', () => {
|
||||
});
|
||||
|
||||
test('10c [저장] 더블클릭 시 요청이 1회만 나간다', async ({ page, messagingManageToken }) => {
|
||||
// 유효 자격증명 환경에서는 kapi 실호출(add·request·cancel_request·delete) 4회 + 고정 대기 7초가
|
||||
// 한 테스트에 들어가므로 기본 30초를 넘긴다(실측 31.3초). 판정 축이 시간은 아니다.
|
||||
test.setTimeout(90_000);
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await openBizppurioTab(page);
|
||||
await seedTemplate(page, 'password_changed');
|
||||
const modal = await openEditModal(page);
|
||||
const modal = await openEditModal(page, 'password_changed');
|
||||
await modal.locator('textarea[name="bz_template_content"]').fill('중복 제출 테스트 #{site_name}');
|
||||
|
||||
let saves = 0;
|
||||
@@ -418,13 +477,40 @@ test.describe('T4 제출/응답 + T10 경계', () => {
|
||||
// 판정 축은 "요청 수" 가 아니라 **중복 신청 0** 이다. 클라이언트 if 가드는
|
||||
// setState 반영 전에 두 번째 click 이 디스패치되면 뚫린다(실측). 실제 방어는
|
||||
// 서버의 원자 선점(claimForInspection)이며, 두 번째 신청은 422 로 거부된다.
|
||||
const modal2 = await openEditModal(page);
|
||||
const modal2 = await openEditModal(page, 'password_changed');
|
||||
await modal2.locator('textarea[name="bz_template_content"]').fill('중복 신청 테스트 #{site_name}');
|
||||
// 검수자 전달 의견(PO 결정 2026-08-23 §18.7) — 신청 요청 본문의 comment 로 실려야 한다.
|
||||
const REVIEW_COMMENT = '변수 예시: #{site_name}=G7 데모 사이트';
|
||||
await modal2.locator('textarea[name="bz_request_comment"]').fill(REVIEW_COMMENT);
|
||||
const requestBodies: string[] = [];
|
||||
page.on('request', (r) => {
|
||||
if (r.method() === 'POST' && /\/admin\/templates\/\d+\/request$/.test(r.url())) requestBodies.push(r.postData() ?? '');
|
||||
});
|
||||
await dialog(page).getByRole('button', { name: '저장 후 검수 신청', exact: true })
|
||||
.first().click({ clickCount: 2, delay: 30 });
|
||||
await page.waitForTimeout(4_000);
|
||||
evidence('10c 저장후신청 더블클릭', { 신청요청수: requests, 신청성공수: okRequests });
|
||||
expect(okRequests, '중복 검수 신청이 성립하면 카카오측 중복 등록이 된다').toBeLessThanOrEqual(1);
|
||||
evidence('10c 신청 comment 전달', { 본문수: requestBodies.length, comment일치: requestBodies.filter((b) => b.includes(REVIEW_COMMENT)).length });
|
||||
expect(requestBodies.length, '검수 신청 요청이 관측되지 않았다').toBeGreaterThan(0);
|
||||
for (const body of requestBodies) expect(JSON.parse(body).comment, '신청 본문의 comment').toBe(REVIEW_COMMENT);
|
||||
|
||||
// 정리: 유효 자격증명 환경에서는 신청이 실제로 성립한다 — 신청 취소 후 행을 지워
|
||||
// 카카오측에 측정용 템플릿이 남지 않게 한다(자격증명 미설정 환경에서는 둘 다 no-op 에 가깝다).
|
||||
const cleanup = await page.evaluate(async () => {
|
||||
const headers = { Accept: 'application/json', Authorization: `Bearer ${localStorage.getItem('auth_token') ?? ''}` };
|
||||
const list = await (await fetch('/api/plugins/sirsoft-message_bizppurio/admin/templates?per_page=50', { headers })).json();
|
||||
const row = (list?.data?.templates ?? []).find((r: { notification_type?: string }) => r.notification_type === 'password_changed');
|
||||
if (!row) return { row: null };
|
||||
let cancel: number | null = null;
|
||||
if (row.status === 'requested') {
|
||||
cancel = (await fetch(`/api/plugins/sirsoft-message_bizppurio/admin/templates/${row.id}/cancel-request`, { method: 'POST', headers })).status;
|
||||
}
|
||||
const del = (await fetch(`/api/plugins/sirsoft-message_bizppurio/admin/templates/${row.id}`, { method: 'DELETE', headers })).status;
|
||||
|
||||
return { row: row.id, status: row.status, cancel, del };
|
||||
});
|
||||
evidence('10c 정리(신청 취소 + 삭제)', cleanup);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -441,7 +527,7 @@ test.describe('T6·T7 영속성·컨텍스트 격리', () => {
|
||||
page.evaluate(() => ((window as any).G7Core?.state?.get?.()?.bz_tpl_modal?.id ?? (window as any).G7Core?.state?.getGlobal?.()?.bz_tpl_modal?.id) ?? null);
|
||||
|
||||
const body = `영속성 확인 ${'가'.repeat(5)} #{site_name} !@#$%^&*() 🎉`;
|
||||
let modal = await openEditModal(page);
|
||||
let modal = await openEditModal(page, 'welcome');
|
||||
const targetId = await openedId();
|
||||
evidence('6a 측정 대상 행 id', targetId);
|
||||
expect(targetId, '수정 모달이 연 행의 id 를 읽지 못했다').not.toBeNull();
|
||||
@@ -450,7 +536,7 @@ test.describe('T6·T7 영속성·컨텍스트 격리', () => {
|
||||
const beforeSave = await page.evaluate(() => {
|
||||
const g = (window as any).G7Core?.state?.get?.() ?? {};
|
||||
const m = g.bz_tpl_modal ?? {};
|
||||
return { id: m.id ?? null, len: (m.content?.templateContent ?? '').length, modals: document.querySelectorAll('[id^="bizppurio_tpl_modal_body"]').length };
|
||||
return { id: m.id ?? null, len: (m.content?.templateContent ?? '').length, modals: document.querySelectorAll('#bizppurio_tpl_sections').length };
|
||||
});
|
||||
evidence('6a 저장 직전 전역 상태', beforeSave);
|
||||
|
||||
@@ -474,7 +560,7 @@ test.describe('T6·T7 영속성·컨텍스트 격리', () => {
|
||||
expect(stored, '이모지·특수문자·#{var} 가 섞인 본문이 그대로 저장되어야 한다').toBe(body);
|
||||
|
||||
// ② 새로고침 후 화면이 그 값을 복원하는가 (영속성 UI 축)
|
||||
modal = await openEditModal(page);
|
||||
modal = await openEditModal(page, 'welcome');
|
||||
const reopenedId = await openedId();
|
||||
const restored = await modal.locator('textarea[name="bz_template_content"]').inputValue();
|
||||
const expected = reopenedId === targetId
|
||||
@@ -509,15 +595,16 @@ test.describe('T6·T7 영속성·컨텍스트 격리', () => {
|
||||
evidence('7a 탭 왕복 전/후 쿼리', { before, after });
|
||||
expect(after).toContain('channel=alimtalk');
|
||||
|
||||
// 7b: 모달에 값을 넣고 저장 없이 닫은 뒤 다시 열면 이전 입력이 남지 않는다
|
||||
const modal = dialog(page).locator('[id^="bizppurio_tpl_modal_body"]').first();
|
||||
await page.getByRole('button', { name: '알림톡 템플릿 작성' }).first().click();
|
||||
// 7b: 모달에 값을 넣고 저장 없이 닫은 뒤 다시 열면 이전 입력이 남지 않는다(마운트 시 재시딩)
|
||||
await seedTemplate(page, 'welcome');
|
||||
const modal = dialog(page).locator('#bizppurio_tpl_sections');
|
||||
await rowEditButton(page, 'welcome').click();
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
await modal.locator('textarea[name="bz_template_content"]').fill('이월되면 안 되는 값');
|
||||
await dialog(page).getByRole('button', { name: '취소', exact: true }).first().click();
|
||||
await expect(modal).toBeHidden({ timeout: 10_000 });
|
||||
|
||||
await page.getByRole('button', { name: '알림톡 템플릿 작성' }).first().click();
|
||||
await rowEditButton(page, 'welcome').click();
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
const reopened = await modal.locator('textarea[name="bz_template_content"]').inputValue();
|
||||
evidence('7b 재오픈 시 이전 값 잔존', reopened.includes('이월되면 안 되는 값'));
|
||||
@@ -559,6 +646,26 @@ test.describe('T8 3면 패리티·다크·로케일', () => {
|
||||
if (visible && tabs.length > 0) {
|
||||
expect(tabs.join('|')).not.toContain('알림톡');
|
||||
}
|
||||
|
||||
// 8c: 그 면의 코어 [편집] 모달에도 섹션 2종이 주입되고 코어 본문 입력은 숨는다(3면 공유 1본)
|
||||
if (rows > 0) {
|
||||
await page.getByRole('button', { name: '편집', exact: true }).first().click();
|
||||
const sections = dialog(page).locator('#bizppurio_tpl_sections');
|
||||
await expect(sections).toBeVisible({ timeout: 15_000 });
|
||||
const prefix = url.includes('/boards/') ? 'board_' : 'ecommerce_';
|
||||
const measured = {
|
||||
alimtalk: await dialog(page).locator('#bizppurio_tpl_alimtalk_section').count(),
|
||||
sms: await dialog(page).locator('#bizppurio_tpl_sms_section').count(),
|
||||
coreBody: await dialog(page).locator(`#${prefix}template_body_input`).count(),
|
||||
saveButtons: await dialog(page).getByRole('button', { name: '저장', exact: true }).count(),
|
||||
};
|
||||
evidence(`8c ${face} 편집 모달 섹션`, measured);
|
||||
expect(measured.alimtalk).toBe(1);
|
||||
expect(measured.sms).toBe(1);
|
||||
expect(measured.coreBody).toBe(0);
|
||||
expect(measured.saveButtons).toBe(1);
|
||||
await dialog(page).getByRole('button', { name: '취소', exact: true }).first().click();
|
||||
}
|
||||
expect(errors).toHaveLength(0);
|
||||
});
|
||||
}
|
||||
@@ -616,9 +723,8 @@ test.describe('라운드5 신규 축 — 업로드 가드·관리 라벨·SMS
|
||||
test('U1 업로드 진행 중 저장 계열 버튼이 잠기고 취소는 열려 있다', async ({ page, messagingManageToken }) => {
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await openBizppurioTab(page);
|
||||
await page.getByRole('button', { name: '알림톡 템플릿 작성' }).first().click();
|
||||
const modal = dialog(page).locator('[id^="bizppurio_tpl_modal_body"]').first();
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
await seedTemplate(page, 'welcome');
|
||||
const modal = await openEditModal(page, 'welcome');
|
||||
await modal.getByRole('button', { name: '이미지', exact: true }).click();
|
||||
|
||||
// 업로드 응답을 붙잡아 in-flight 상태를 만든다(네트워크 지연 재현).
|
||||
|
||||
+76
-12
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* @scenario bizppurio_tab_integration_e2e, bizppurio_compose_modal_e2e, bizppurio_manage_round_trip_e2e
|
||||
* @effects bizppurio_tab_replaces_sms_and_alimtalk_tabs, row_footer_shows_status_badge_and_lifecycle_actions,
|
||||
* compose_modal_switches_conditional_fields_by_type, manage_screen_lists_db_rows_with_merge_query_round_trip
|
||||
* compose_modal_switches_conditional_fields_by_type, manage_screen_lists_db_rows_with_merge_query_round_trip,
|
||||
* manage_list_mobile_card_view_and_unified_toolbar
|
||||
*
|
||||
* 검증 대상(브라우저에서만 잡히는 축):
|
||||
* 1. 코어 알림 설정 서브탭 통합 — '비즈뿌리오' 단일 탭 노출, 문자·알림톡 개별 탭 부재
|
||||
@@ -66,8 +67,8 @@ test.describe('비즈뿌리오 통합 탭 (코어 알림 설정)', () => {
|
||||
});
|
||||
|
||||
// @scenario bizppurio_tab_integration_e2e
|
||||
// @effects row_footer_shows_status_badge_and_lifecycle_actions
|
||||
test('알림 행 하단에 알림톡 라이프사이클 줄과 SMS 설정 줄이 렌더된다', async ({ page, messagingManageToken }) => {
|
||||
// @effects row_footer_shows_status_summary_only, approval_badge_two_tier
|
||||
test('알림 행 하단에 알림톡 승인 2단 배지와 SMS 설정 요약만 렌더된다(버튼 0)', async ({ page, messagingManageToken }) => {
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await page.goto(SETTINGS_URL);
|
||||
await page.waitForLoadState('networkidle', { timeout: 30_000 });
|
||||
@@ -75,11 +76,16 @@ test.describe('비즈뿌리오 통합 탭 (코어 알림 설정)', () => {
|
||||
const rows = page.locator('[id^="bizppurio_row_lifecycle"]');
|
||||
await expect(rows.first()).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
// 알림톡 라벨 + 상태 배지(미작성/작성중/…) + SMS 체크박스 라벨
|
||||
// 알림톡 라벨 + 승인 2단 배지(승인됨 | 미승인 (세부)) + SMS 설정 요약 — 버튼은 없다(조작은 [편집] 모달)
|
||||
const firstRow = rows.first();
|
||||
await expect(firstRow.getByText('알림톡', { exact: false }).first()).toBeVisible();
|
||||
await expect(firstRow.getByText(/승인됨|미승인/).first()).toBeVisible();
|
||||
await expect(firstRow.getByText('대체 SMS', { exact: false }).first()).toBeVisible();
|
||||
await expect(firstRow.getByText('SMS 단독', { exact: false }).first()).toBeVisible();
|
||||
// SMS 사용 여부는 문구("대체 SMS: 미사용")가 아니라 배지(사용/미사용)로 렌더된다 (PO 지시 2026-08-23)
|
||||
expect(await firstRow.locator('span.rounded', { hasText: /^(사용|미사용)$/ }).count()).toBeGreaterThanOrEqual(2);
|
||||
expect(await firstRow.getByText(/대체 SMS:|SMS 단독:/).count()).toBe(0);
|
||||
expect(await rows.locator('button').count()).toBe(0);
|
||||
|
||||
// i18n 원문 키 노출 0 (탭 콘텐츠 영역 전체)
|
||||
const content = await page.locator('#notif_channel_content').innerText();
|
||||
@@ -87,24 +93,41 @@ test.describe('비즈뿌리오 통합 탭 (코어 알림 설정)', () => {
|
||||
expect(content).not.toContain('sirsoft-message_bizppurio.');
|
||||
});
|
||||
|
||||
// @scenario bizppurio_compose_modal_e2e
|
||||
// @effects compose_modal_switches_conditional_fields_by_type
|
||||
test('작성 모달의 강조 유형 전환 시 조건부 필드가 등장·소멸한다', async ({ page, messagingManageToken }) => {
|
||||
// @scenario bizppurio_edit_modal_e2e, bizppurio_compose_modal_e2e
|
||||
// @effects edit_modal_hosts_alimtalk_and_sms_sections, core_modal_hides_editor_for_hidden_template_editor_channel, compose_modal_switches_conditional_fields_by_type
|
||||
test('[편집] 모달의 알림톡 섹션에서 강조 유형 전환 시 조건부 필드가 등장·소멸한다', async ({ page, messagingManageToken }) => {
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await page.goto(SETTINGS_URL);
|
||||
await page.waitForLoadState('networkidle', { timeout: 30_000 });
|
||||
|
||||
// 미작성 행의 [알림톡 템플릿 작성] → 모달 오픈
|
||||
const composeButton = page.getByRole('button', { name: '알림톡 템플릿 작성' }).first();
|
||||
await expect(composeButton).toBeVisible({ timeout: 30_000 });
|
||||
await composeButton.click();
|
||||
// 행의 코어 [편집] → 같은 모달 안에 알림톡 템플릿·문자(SMS) 섹션이 주입된다(작성 폼은 draft/rejected/미작성 행에서 열린다)
|
||||
const editButton = page.getByRole('button', { name: '편집', exact: true }).first();
|
||||
await expect(editButton).toBeVisible({ timeout: 30_000 });
|
||||
await editButton.click();
|
||||
|
||||
const modal = page.locator('[id^="bizppurio_tpl_modal_body"]').first();
|
||||
const dialog = page.getByRole('dialog');
|
||||
const modal = dialog.locator('#bizppurio_tpl_sections');
|
||||
await expect(modal).toBeVisible({ timeout: 15_000 });
|
||||
await expect(dialog.locator('#bizppurio_tpl_sms_section')).toBeVisible();
|
||||
// 코어 제목/본문 입력은 hidden_template_editor 게이트로 숨는다 — 본문 입력은 알림톡 섹션 하나뿐
|
||||
await expect(dialog.locator('#template_body_input')).toHaveCount(0);
|
||||
await expect(dialog.getByRole('button', { name: '저장', exact: true })).toHaveCount(1);
|
||||
|
||||
// 본문 textarea 는 상시
|
||||
await expect(modal.locator('textarea[name="bz_template_content"]')).toBeVisible();
|
||||
|
||||
// 검수자 전달 의견 입력란은 바로연결 블록 아래 한 줄을 통째로 차지한다
|
||||
// (회귀: 라벨+[바로연결 추가] flex 행 안에 끼어 라벨이 세로로 찌그러짐 — PO 화면 지적 2026-08-23)
|
||||
const commentBox = modal.locator('textarea[name="bz_request_comment"]');
|
||||
await expect(commentBox).toBeVisible();
|
||||
const [quickAddBox, commentBounds, bodyBox] = await Promise.all([
|
||||
modal.getByRole('button', { name: '바로연결 추가' }).boundingBox(),
|
||||
commentBox.boundingBox(),
|
||||
modal.locator('textarea[name="bz_template_content"]').boundingBox(),
|
||||
]);
|
||||
expect(commentBounds!.y, '의견란은 [바로연결 추가] 아래에 있어야 한다').toBeGreaterThanOrEqual(quickAddBox!.y + quickAddBox!.height);
|
||||
expect(Math.abs(commentBounds!.x - bodyBox!.x), '의견란은 본문 입력과 같은 왼쪽 선에 맞는다').toBeLessThan(4);
|
||||
|
||||
// 없음(NONE): 강조표기·이미지·아이템 필드 부재
|
||||
await expect(modal.getByText('강조표기 타이틀', { exact: false })).toHaveCount(0);
|
||||
|
||||
@@ -147,6 +170,9 @@ test.describe('비즈뿌리오 알림 템플릿 관리 (플러그인 설정)', (
|
||||
|
||||
await expect(manageView).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
// 목록 SMS 열은 평문(단독/대체/-)이 아니라 상태 배지(단독·대체=초록, 미사용=회색) — 행 하단과 같은 규칙 (PO 지시 2026-08-23)
|
||||
await expect(manageView.locator('span.rounded', { hasText: /^(단독|대체|미사용)$/ }).first()).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
// 상태 필터 변경 → URL bz_status 반영 (mergeQuery — tab 파라미터 유지)
|
||||
const filterRoot = manageView.locator('[aria-haspopup]').first();
|
||||
await filterRoot.click();
|
||||
@@ -160,4 +186,42 @@ test.describe('비즈뿌리오 알림 템플릿 관리 (플러그인 설정)', (
|
||||
expect(text).not.toContain('$t:');
|
||||
expect(text).not.toContain('sirsoft-message_bizppurio.');
|
||||
});
|
||||
// @scenario bizppurio_manage_round_trip_e2e
|
||||
// @effects manage_list_mobile_card_view_and_unified_toolbar
|
||||
test('portable(375px) 에서 목록이 카드로 전환되고 도구줄 버튼이 btn 계열로 통일된다', async ({ page, messagingManageToken }) => {
|
||||
await authenticatePage(page, messagingManageToken);
|
||||
await page.goto(MANAGE_URL);
|
||||
await page.waitForLoadState('networkidle', { timeout: 30_000 });
|
||||
|
||||
const manageView = page.locator('#templates_manage_view');
|
||||
const readiness = page.locator('#templates_readiness');
|
||||
if (await readiness.isVisible().catch(() => false)) {
|
||||
await expect(readiness.getByText('환경설정', { exact: false }).first()).toBeVisible();
|
||||
return;
|
||||
}
|
||||
await expect(manageView).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
// 데스크톱: grid 헤더 노출 + 도구줄 버튼 계열
|
||||
await expect(manageView.locator('#bz_manage_list_header')).toBeVisible();
|
||||
const searchBtn = manageView.getByRole('button', { name: '검색', exact: true });
|
||||
await expect(searchBtn).toHaveClass(/btn-primary/);
|
||||
// 행 액션에도 동명 [새로고침](행 동기화) 버튼이 있어 aria-label 로 도구줄 버튼만 집는다
|
||||
const refreshBtn = manageView.getByLabel('새로고침', { exact: true });
|
||||
await expect(refreshBtn).toHaveClass(/btn-icon/);
|
||||
await expect(refreshBtn.locator('i.fa-arrows-rotate')).toBeVisible();
|
||||
|
||||
// portable 로 전환 → 헤더 숨김 + 카드 메타 줄(신청·동기화 합본) 노출
|
||||
await page.setViewportSize({ width: 375, height: 812 });
|
||||
await expect(manageView.locator('#bz_manage_list_header')).toBeHidden();
|
||||
const firstRowInner = manageView.locator('#bz_manage_list_rows > div > div').first();
|
||||
if (await firstRowInner.isVisible().catch(() => false)) {
|
||||
await expect(firstRowInner.getByText(/동기화/).first()).toBeVisible();
|
||||
// 카드에서 별도 열(소속/신청일/동기화일 셀)은 숨는다 — grid 클래스가 아닌 flex 컨테이너
|
||||
const rowClass = (await firstRowInner.getAttribute('class')) ?? '';
|
||||
expect(rowClass).toContain('flex-wrap');
|
||||
expect(rowClass).not.toContain('grid-cols-12');
|
||||
}
|
||||
await page.setViewportSize({ width: 1280, height: 800 });
|
||||
});
|
||||
|
||||
});
|
||||
+40
@@ -146,4 +146,44 @@ class SeedChannelTemplatesListenerTest extends PluginTestCase
|
||||
$alimtalk = collect($result['generic']['templates'])->firstWhere('channel', 'alimtalk');
|
||||
$this->assertSame('trigger_user', $alimtalk['recipients'][0]['type']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 코어 [기본값 복원] 경로(getDefaultTemplateData)가 통과하는 필터에도 같은 증강을 건다
|
||||
* (#597 §18.7 C2 — 시드만 하고 복원 출처에 빠져 있어 "기본 템플릿 데이터를 찾을 수 없습니다" 로 실패했다).
|
||||
*
|
||||
* @effects core_reset_restores_seeded_channel_template_defaults
|
||||
*/
|
||||
public function test_기본값_복원_필터를_시딩_훅과_같은_메서드로_구독한다(): void
|
||||
{
|
||||
$hooks = SeedChannelTemplatesListener::getSubscribedHooks();
|
||||
|
||||
$this->assertArrayHasKey('core.notification.filter_default_definitions', $hooks);
|
||||
$this->assertSame('augment', $hooks['core.notification.filter_default_definitions']['method']);
|
||||
$this->assertSame('filter', $hooks['core.notification.filter_default_definitions']['type'], '반환값을 쓰는 필터다 — type 누락 시 증강이 버려진다.');
|
||||
$this->assertGreaterThan(20, $hooks['core.notification.filter_default_definitions']['priority'], '게시판·이커머스가 자기 정의를 보태는 priority 20 뒤에 돌아야 모듈 정의도 증강된다.');
|
||||
|
||||
// 시딩 3훅과 동일 메서드 — 시드 출처와 복원 출처가 갈리면 복원값이 시드값과 달라진다.
|
||||
foreach (['seed.notifications.translations', 'seed.sirsoft-board.notifications.translations', 'seed.sirsoft-ecommerce.notifications.translations'] as $seedHook) {
|
||||
$this->assertSame($hooks[$seedHook]['method'], $hooks['core.notification.filter_default_definitions']['method']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @effects core_reset_restores_seeded_channel_template_defaults
|
||||
*/
|
||||
public function test_기본값_복원_경로의_순차_정의_배열에서_alimtalk_기본값을_찾을_수_있다(): void
|
||||
{
|
||||
// getDefaultTemplateData 는 config/core.php 정의에 type/extension_* 를 붙인 순차 배열을 필터에 넘긴다
|
||||
$definitions = [
|
||||
array_merge($this->coreDefinition()['welcome'], ['type' => 'welcome', 'extension_type' => 'core', 'extension_identifier' => 'core']),
|
||||
];
|
||||
|
||||
$result = $this->listener()->augment($definitions, ['type' => 'welcome', 'channel' => 'alimtalk']);
|
||||
|
||||
$alimtalk = collect($result[0]['templates'])->firstWhere('channel', 'alimtalk');
|
||||
$this->assertNotNull($alimtalk, '복원 경로가 찾는 channel=alimtalk template 이 있어야 한다.');
|
||||
$this->assertSame([['type' => 'trigger_user']], $alimtalk['recipients']);
|
||||
$this->assertSame('{name}님 환영합니다', $alimtalk['body']['ko'], '시딩과 같은 database 평문 body 가 복원값이다.');
|
||||
$this->assertSame('welcome', $result[0]['type'], '기존 필드는 보존된다.');
|
||||
}
|
||||
}
|
||||
+52
@@ -733,4 +733,56 @@ class BizppurioTemplateServiceTest extends PluginTestCase
|
||||
|
||||
app()->setLocale('ko');
|
||||
}
|
||||
|
||||
/**
|
||||
* 검수자 전달 의견은 kapi request 의 comment 로만 실린다 (#597 §18.7 — PO 결정 2026-08-23).
|
||||
*
|
||||
* 카카오 심사 가이드가 요구하는 변수 '예시 텍스트' 를 전할 유일한 통로가 request comment 다.
|
||||
* 등록(add) 페이로드에는 섞이지 않고, 행에도 남지 않는다.
|
||||
*
|
||||
* @effects inspection_request_carries_reviewer_comment
|
||||
*/
|
||||
public function test_검수_신청의_comment는_kapi_request에만_실린다(): void
|
||||
{
|
||||
Http::fake([self::KAPI => Http::response($this->kapiResponse())]);
|
||||
$template = $this->row();
|
||||
|
||||
$this->makeService()->requestInspection($template, ' 변수 예시: #{name}=홍길동, #{order_number}=20260823-0001 ');
|
||||
|
||||
Http::assertSent(function ($request) {
|
||||
if (parse_url($request->url(), PHP_URL_PATH) !== '/v3/kakao/template/request') {
|
||||
return false;
|
||||
}
|
||||
$this->assertSame('변수 예시: #{name}=홍길동, #{order_number}=20260823-0001', $request->data()['comment'] ?? null, '앞뒤 공백만 제거하고 원문 그대로 싣는다.');
|
||||
|
||||
return true;
|
||||
});
|
||||
Http::assertSent(function ($request) {
|
||||
if (parse_url($request->url(), PHP_URL_PATH) !== '/v3/kakao/template/add') {
|
||||
return false;
|
||||
}
|
||||
$this->assertArrayNotHasKey('comment', $request->data(), 'comment 는 등록(add) 페이로드에 섞이지 않는다.');
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @effects inspection_request_carries_reviewer_comment
|
||||
*/
|
||||
public function test_검수_신청의_comment가_공백이면_kapi_request에_comment_키를_싣지_않는다(): void
|
||||
{
|
||||
Http::fake([self::KAPI => Http::response($this->kapiResponse())]);
|
||||
|
||||
$this->makeService()->requestInspection($this->row(), ' ');
|
||||
|
||||
Http::assertSent(function ($request) {
|
||||
if (parse_url($request->url(), PHP_URL_PATH) !== '/v3/kakao/template/request') {
|
||||
return false;
|
||||
}
|
||||
$this->assertArrayNotHasKey('comment', $request->data(), '공백만 있는 의견은 미전달 — 클라이언트가 빈 comment 를 생략한다.');
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
+31
-6
@@ -15,7 +15,8 @@ description: |
|
||||
- 동기화: 스케줄러(30분, requested 있을 때만 list 일괄 대조) + 수동 새로고침(detail 1건).
|
||||
승인 전이 시 content 를 approved_content 로 동결(발송 SSoT), 반려 시 comments 저장
|
||||
- 화면: 3면(코어/게시판/이커머스) '비즈뿌리오' 통합 탭(sms 탭 숨김 + tab_channels 규칙)
|
||||
행 하단 라이프사이클 UI + 작성 모달(4×4 유형) + 플러그인 관리 화면(DB 목록)
|
||||
행 하단 상태 요약(승인 2단 배지) + 코어 [편집] 모달에 녹인 알림톡·SMS 섹션(통합 저장,
|
||||
4×4 유형) + 플러그인 관리 화면(DB 목록). PO 결정 2026-08-23: 별도 작성/SMS 모달 폐지
|
||||
|
||||
axis 설계 노트:
|
||||
- content_variant 는 카카오 메시지유형×강조유형의 대표 변형 4종이다 — 유형별 조건부
|
||||
@@ -45,6 +46,7 @@ effects:
|
||||
- rerequest_calls_update_not_add
|
||||
- request_without_content_rejected_422
|
||||
- request_snapshots_sender_key
|
||||
- inspection_request_carries_reviewer_comment
|
||||
- kapi_failure_reason_surfaced_in_errors_bizppurio_message
|
||||
# 전이 가드 (S2)
|
||||
- content_edit_locked_outside_draft_rejected
|
||||
@@ -73,14 +75,22 @@ effects:
|
||||
- approval_transition_freezes_content_into_approved_content
|
||||
- rejection_transition_stores_comments_detail
|
||||
- manual_sync_updates_single_row
|
||||
# 화면 (S5)
|
||||
# 화면 (S5 — PO 결정 2026-08-23: 편집 모달 통합)
|
||||
- bizppurio_tab_replaces_sms_and_alimtalk_tabs
|
||||
- tab_visible_when_any_of_tab_channels_active
|
||||
- row_footer_shows_status_badge_and_lifecycle_actions
|
||||
- row_footer_shows_status_summary_only
|
||||
- approval_badge_two_tier
|
||||
- edit_modal_hosts_alimtalk_and_sms_sections
|
||||
- core_modal_hides_editor_for_hidden_template_editor_channel
|
||||
- unified_save_chain_alimtalk_then_core_recipients
|
||||
- compose_modal_switches_conditional_fields_by_type
|
||||
- manage_screen_lists_db_rows_with_merge_query_round_trip
|
||||
# 관리 목록 반응형 (PO 지시 2026-08-24) — portable 카드 전환 + 도구줄 btn 계열 통일
|
||||
- manage_list_mobile_card_view_and_unified_toolbar
|
||||
- sms_modal_saves_body_via_delivery_upsert
|
||||
- sms_modal_edits_body_per_locale_tab
|
||||
# 코어 [기본값 복원] — 플러그인이 시드한 alimtalk/sms 행도 복원된다 (§18.7 C2 실측 결함)
|
||||
- core_reset_restores_seeded_channel_template_defaults
|
||||
# 업로드 진행 상태 배선 (라운드 5 — 이 축이 effect 에 없어 배선 단언만 지우면 룰이 조용했다)
|
||||
- upload_in_progress_locks_save_buttons_not_cancel
|
||||
- upload_rejects_concurrent_selection_while_in_flight
|
||||
@@ -92,12 +102,20 @@ effects:
|
||||
|
||||
scenarios:
|
||||
- id: bizppurio_tab_integration_e2e
|
||||
description: 코어 알림 설정에서 문자·알림톡 개별 탭이 사라지고 '비즈뿌리오' 통합 탭이 노출되며, 행 하단에 알림톡·SMS 라이프사이클 UI 가 렌더된다 (i18n 원문 노출 0)
|
||||
description: 코어 알림 설정에서 문자·알림톡 개별 탭이 사라지고 '비즈뿌리오' 통합 탭이 노출되며, 행 하단에 승인 2단 배지 + SMS 설정 요약만 렌더된다 (버튼 0, i18n 원문 노출 0)
|
||||
effects:
|
||||
- bizppurio_tab_replaces_sms_and_alimtalk_tabs
|
||||
- row_footer_shows_status_badge_and_lifecycle_actions
|
||||
- row_footer_shows_status_summary_only
|
||||
- approval_badge_two_tier
|
||||
- id: bizppurio_edit_modal_e2e
|
||||
description: 행 [편집]을 누르면 코어 모달의 제목/본문이 숨고 알림톡 템플릿·문자(SMS) 섹션이 렌더되며, 하단 [저장] 한 번으로 알림톡 내용·발송 설정·SMS 본문(·바뀐 수신자 규칙)이 저장된다
|
||||
effects:
|
||||
- edit_modal_hosts_alimtalk_and_sms_sections
|
||||
- core_modal_hides_editor_for_hidden_template_editor_channel
|
||||
- unified_save_chain_alimtalk_then_core_recipients
|
||||
- inspection_request_carries_reviewer_comment
|
||||
- id: bizppurio_compose_modal_e2e
|
||||
description: 작성 모달을 열고 강조 유형(NONE→TEXT→IMAGE→ITEM_LIST)을 전환하면 조건부 필드 블록이 등장/소멸한다
|
||||
description: 편집 모달의 알림톡 섹션에서 강조 유형(NONE→TEXT→IMAGE→ITEM_LIST)을 전환하면 조건부 필드 블록이 등장/소멸한다
|
||||
effects:
|
||||
- compose_modal_switches_conditional_fields_by_type
|
||||
- id: bizppurio_manage_round_trip_e2e
|
||||
@@ -105,6 +123,7 @@ scenarios:
|
||||
effects:
|
||||
- manage_screen_lists_db_rows_with_merge_query_round_trip
|
||||
- sms_modal_saves_body_via_delivery_upsert
|
||||
- manage_list_mobile_card_view_and_unified_toolbar
|
||||
|
||||
test_files:
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Unit/Enums/BizppurioTemplateStatusTest.php
|
||||
@@ -112,6 +131,8 @@ test_files:
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Unit/Services/BizppurioTemplateServiceTest.php
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Feature/Template/BizppurioTemplateControllerTest.php
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Feature/Template/SyncTemplateStatusCommandTest.php
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Feature/Notification/CoreTemplateResetDefaultsTest.php
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Unit/Listeners/SeedChannelTemplatesListenerTest.php
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/resources/js/__tests__/handlers/uploadTemplateImage.test.ts
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/resources/js/__tests__/layouts/notification_tab_lifecycle.test.tsx
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/resources/js/__tests__/layouts/plugin_settings_manage.test.tsx
|
||||
@@ -119,6 +140,10 @@ test_files:
|
||||
# 3면 패리티(오버레이 전문 동일성) — 파일째 지워도 룰이 울지 않던 사각을 닫는다.
|
||||
# plugin_settings.test.tsx 는 plugin-settings.yaml 이 소유하므로 여기에 중복 등재하지 않는다.
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/resources/js/__tests__/layouts/notification_tab_board_ecommerce.test.tsx
|
||||
# 코어 [편집] 모달의 확장 지점 2종 + hidden_template_editor 게이트 — 소유 확장(템플릿/모듈)의 자기 러너가 수집한다
|
||||
- templates/_bundled/sirsoft-admin_basic/__tests__/layouts/admin-settings-notification-template-modal-extension.test.ts
|
||||
- modules/_bundled/sirsoft-board/resources/js/__tests__/layouts/admin-board-notification-template-modal-extension.test.ts
|
||||
- modules/_bundled/sirsoft-ecommerce/resources/js/__tests__/layouts/admin-ecommerce-notification-template-modal-extension.test.ts
|
||||
# E2E spec — 통합 탭 노출(tab_channels 활성 규칙 포함)은 브라우저 실측이 SSoT 라 여기에도 선언
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Playwright/specs/admin/template-lifecycle-matrix.spec.ts
|
||||
- plugins/_bundled/sirsoft-message_bizppurio/tests/Playwright/specs/admin/template-lifecycle.spec.ts
|
||||
|
||||
Reference in new issue
Block a user