@viswa-test/creative-workspace-ui-component 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AssignReminders/AssignReminderWrapper.js +1 -1
- package/dist/cjs/components/AssignReminders/components/ReviewStatus.js +1 -1
- package/dist/components/AssignReminders/AssignReminderWrapper.js +1 -1
- package/dist/components/AssignReminders/components/ReviewStatus.js +1 -1
- package/dist/types/components/AssignReminders/AssignReminderWrapper.d.ts +1 -1
- package/dist/types/components/AssignReminders/AssignReminderWrapper.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/components/ReviewStatus.d.ts.map +1 -1
- package/dist/types/components/AssignReminders/types/types.d.ts +23 -2
- package/dist/types/components/AssignReminders/types/types.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),i=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),a=require("./AssignReminderLevels.js"),r=require("./AssignReminderTest.js"),t=require("./components/ReviewStatus.js"),l=require("./components/CustomDatePicker.js"),o=require("./ManageReminders.js"),_=require("./styles/AssignReminderWrapperStyles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(n),c=[{tabName:"Assignees & Approvers",tabIcon:i.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[i.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),i.jsx("circle",{cx:"9",cy:"7",r:"4"}),i.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),i.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:i.jsx(s.Bell,{size:15})},{tabName:"Review Status",tabIcon:i.jsx(s.ClipboardList,{size:15})}],v=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];exports.AssignReminderWrapper=function(d){var m,p,E,R=d.metadata,S=void 0===R?{}:R,g=d.reviewData,f=void 0===g?{}:g,A=d.levels,D=d.setLevels,y=d.requireFinalApproval,L=d.setRequireFinalApproval,T=d.approvalDueDate,b=d.setApprovalDueDate,h=d.onClose,N=d.fetchUsers,I=d.onSave,x=d.onValidationError,P=d.totalLevels,j=d.customStyles,F=void 0===j?{}:j,w=d.isSaving,q=void 0!==w&&w,M=d.onRequireFinalApproval,C=d.isOwner,W=void 0===C||C;d.remindersData;var U,B=d.remainderOwners,Y=d.setRemainderOwners,G=d.schedules,O=d.setSchedules,k=d.handelSendNow,H=d.showPreviewEmail,z=d.reminderLabels,V=d.reminderColors,X=d.reminderChipColor,J=d.reminderAssignees,K=d.reminderFallbackRecipients,Q=d.reminderRecipientsColor,Z=d.manualReminderTitle,$=d.manualReminderDescription,ee=d.lastReminderText,ie=d.selectRecipientsLabel,se=d.previewEmailButtonLabel,ne=d.sendNowButtonLabel,ae=d.reminderSuccessTitle,re=d.reminderSuccessDescription,te=d.escalationTitle,le=d.escalationTitleTooltip,oe=d.escalationDescription,_e=d.configureAutoReminderText,de=d.getDynamicStatement,ue=d.reminderStartDateLabel,ce=d.documentDueDateLabel,ve=d.reminderFrequencyLabel,me=d.escalationRemindersLabel,pe=d.escalationTooltip,Ee=d.escalationConditionText,Re=d.daysText,Se=d.dueDataAndRepeatText,ge=d.reminderFrequencyOptions,fe=d.escalationFrequencyOptions,Ae=d.beforeAfterOptions,De=(null===(m=S.tabData)||void 0===m?void 0:m.length)?S.tabData:c,ye=W?De:De.filter(function(e,i){return 0!==i}),Le=n.useState(null!==(E=null===(p=ye[0])||void 0===p?void 0:p.tabName)&&void 0!==E?E:""),Te=Le[0],be=Le[1],he=(U=Te.toLowerCase()).includes("reminder")?"reminders":U.includes("review")?"review":"assignees",Ne=n.useState(A||r.INITIAL_LEVELS),Ie=Ne[0],xe=Ne[1],Pe=n.useState(y||!1),je=Pe[0],Fe=Pe[1],we=n.useState(T||null),qe=we[0],Me=we[1],Ce=n.useState(null),We=Ce[0],Ue=Ce[1],Be=n.useState([]),Ye=Be[0],Ge=Be[1],Oe=n.useState(B||v),ke=Oe[0],He=Oe[1],ze=void 0!==G?G:Ye,Ve=void 0!==O?O:Ge,Xe=void 0!==B?B:ke,Je=u.default.useMemo(function(){return{due_at:qe?qe.toISOString():"",assignee:Ie.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(i,s,n){var a;return e.__assign(e.__assign({},i),((a={})[n]=s,a))},{})}},[qe,Ie]);n.useEffect(function(){void 0!==B&&He(B)},[B]),n.useEffect(function(){M&&M().then(function(e){Array.isArray(e)&&e.length>0?Ue(e[0]):e&&!Array.isArray(e)&&Ue(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),n.useEffect(function(){var e,i;ye.some(function(e){return e.tabName===Te})||be(null!==(i=null===(e=ye[0])||void 0===e?void 0:e.tabName)&&void 0!==i?i:"")},[ye,Te]),n.useEffect(function(){A&&xe(function(i){var s=i.find(function(e){return e.isHidden});return s?e.__spreadArray(e.__spreadArray([],A,!0),[s],!1):A})},[A]),n.useEffect(function(){void 0!==y&&Fe(y)},[y]),n.useEffect(function(){void 0!==T&&Me(T)},[T]),n.useEffect(function(){xe(function(i){var s=i.filter(function(e){return!e.isHidden});if(je){var n={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==We?void 0:We.id)||"me",email:(null==We?void 0:We.email)||"",name:(null==We?void 0:We.name)?"".concat(We.name," (You)"):"Username (You)",accessLevel:"Approve"}]};return e.__spreadArray(e.__spreadArray([],s,!0),[n],!1)}return s})},[je,We]),n.useEffect(function(){var e=Ie.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});He(function(i){return e.map(function(e,s){var n=i.find(function(i){return i.email===e.email});return n||{id:s+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[Ie]);var Ke=S.wrapperTitle||"Assign Redline and Manage Reminders",Qe=S.wrapperSubTitle||"Sec 4.1 - Technical Security Information",Ze=S.wrapperPriority||"High",$e=S.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.overlay),F.overlay)},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===he?{width:"1250px",maxWidth:"95vw"}:{}),F.modal)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.header),F.header)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.headerLeft),F.headerLeft)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modalTitle),F.modalTitle)},{children:Ke})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineRow),F.redlineRow)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineName),F.redlineName)},{children:Qe})),i.jsx("span",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineBadge),$e),F.redlineBadge)},{children:Ze}))]}))]})),i.jsx("button",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.closeBtn),F.closeBtn),onClick:h},{children:i.jsx(s.X,{size:20,color:"#6B7280"})}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabBar),F.tabBar)},{children:ye.map(function(s){var n=Te===s.tabName;return i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tab),F.tab),n?e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabActive),F.tabActive):{}),onClick:function(){return be(s.tabName)}},{children:[s.tabIcon," ",s.tabName]}),s.tabName)})})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.body),F.body)},{children:["assignees"===he&&i.jsxs(i.Fragment,{children:[!1!==S.showFinalApprovalDueDate&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateBar),F.dueDateBar)},{children:[i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateLabel),F.dueDateLabel)},{children:["Final Approval due date"," ",i.jsx("sup",e.__assign({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateInputWrap),F.dueDateInputWrap)},{children:i.jsx(l.default,{value:qe?qe.toISOString().slice(0,10):"",onChange:Me})})),i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.requiredToProceeed),F.requiredToProceeed)},{children:[i.jsx(s.CircleAlert,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),i.jsx(a.AssignReminderLevels,{levels:Ie,totalLevels:P,requireFinalApproval:je,setLevels:xe,setRequireFinalApproval:function(e){Fe(e)},fetchUsers:N,onValidationError:x,customStyles:F})]}),"reminders"===he&&i.jsx(o.ManageReminders,e.__assign({data:Je,schedules:ze,setSchedules:Ve,remainderOwners:Xe,setRemainderOwners:function(e){var i="function"==typeof e?e(Xe):e;Y&&Y(i),He(i)},handelSendNow:function(e,i){k&&k(e||ze,i||Xe)},showPreviewEmail:null!=H&&H},void 0!==z&&{labels:z},void 0!==V&&{colors:V},void 0!==X&&{chipColor:X},void 0!==J&&{assignees:J},void 0!==K&&{fallbackRecipients:K},void 0!==Q&&{recipientsColor:Q},void 0!==Z&&{manualReminderTitle:Z},void 0!==$&&{manualReminderDescription:$},void 0!==ee&&{lastReminderText:ee},void 0!==ie&&{selectRecipientsLabel:ie},void 0!==se&&{previewEmailButtonLabel:se},void 0!==ne&&{sendNowButtonLabel:ne},void 0!==ae&&{reminderSuccessTitle:ae},void 0!==re&&{reminderSuccessDescription:re},void 0!==te&&{escalationTitle:te},void 0!==le&&{escalationTitleTooltip:le},void 0!==oe&&{escalationDescription:oe},void 0!==_e&&{configureAutoReminderText:_e},void 0!==de&&{getDynamicStatement:de},void 0!==ue&&{reminderStartDateLabel:ue},void 0!==ce&&{documentDueDateLabel:ce},void 0!==ve&&{reminderFrequencyLabel:ve},void 0!==me&&{escalationRemindersLabel:me},void 0!==pe&&{escalationTooltip:pe},void 0!==Ee&&{escalationConditionText:Ee},void 0!==Re&&{daysText:Re},void 0!==Se&&{dueDataAndRepeatText:Se},void 0!==ge&&{reminderFrequencyOptions:ge},void 0!==fe&&{escalationFrequencyOptions:fe},void 0!==Ae&&{beforeAfterOptions:Ae})),"review"===he&&i.jsx(t.default,{levels:Ie,reviewData:f})]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.footer),F.footer)},{children:[i.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.clearBtn),F.clearBtn),q?F.actionBtnDisabled:{}),onClick:function(){xe(r.INITIAL_LEVELS.map(function(i){return e.__assign(e.__assign({},i),{assignees:[],dueDate:null})})),Fe(!1),Me(null)},disabled:q},{children:"Clear"})),i.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.saveBtn),F.saveBtn),q?F.actionBtnDisabled:{}),onClick:function(){var e=Ie.filter(function(e){return!e.isHidden});null==D||D(e),null==L||L(je),null==b||b(qe),null==I||I({levels:e,requireFinalApproval:je,finalApprovalDueDate:qe,activeTab:he,schedules:ze,remainderOwners:Xe})},disabled:q},{children:"Save Changes"}))]}))]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),i=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),a=require("./AssignReminderLevels.js"),r=require("./AssignReminderTest.js"),t=require("./components/ReviewStatus.js"),l=require("./components/CustomDatePicker.js"),o=require("./ManageReminders.js"),_=require("./styles/AssignReminderWrapperStyles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(n),c=[{tabName:"Assignees & Approvers",tabIcon:i.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[i.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),i.jsx("circle",{cx:"9",cy:"7",r:"4"}),i.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),i.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:i.jsx(s.Bell,{size:15})},{tabName:"Review Status",tabIcon:i.jsx(s.ClipboardList,{size:15})}],v=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];exports.AssignReminderWrapper=function(d){var m,p,E,R=d.metadata,S=void 0===R?{}:R,g=d.reviewData,f=void 0===g?{}:g,A=d.levels,D=d.setLevels,y=d.requireFinalApproval,L=d.setRequireFinalApproval,T=d.approvalDueDate,b=d.setApprovalDueDate,h=d.onClose,N=d.fetchUsers,I=d.onSave,x=d.onValidationError,P=d.totalLevels,j=d.customStyles,F=void 0===j?{}:j,w=d.isSaving,q=void 0!==w&&w,M=d.onRequireFinalApproval,C=d.isOwner,W=void 0===C||C;d.remindersData;var U,B=d.remainderOwners,Y=d.setRemainderOwners,G=d.schedules,O=d.setSchedules,k=d.handelSendNow,H=d.showPreviewEmail,z=d.tabName,V=d.reminderLabels,X=d.reminderColors,J=d.reminderChipColor,K=d.reminderAssignees,Q=d.reminderFallbackRecipients,Z=d.reminderRecipientsColor,$=d.manualReminderTitle,ee=d.manualReminderDescription,ie=d.lastReminderText,se=d.selectRecipientsLabel,ne=d.previewEmailButtonLabel,ae=d.sendNowButtonLabel,re=d.reminderSuccessTitle,te=d.reminderSuccessDescription,le=d.escalationTitle,oe=d.escalationTitleTooltip,_e=d.escalationDescription,de=d.configureAutoReminderText,ue=d.getDynamicStatement,ce=d.reminderStartDateLabel,ve=d.documentDueDateLabel,me=d.reminderFrequencyLabel,pe=d.escalationRemindersLabel,Ee=d.escalationTooltip,Re=d.escalationConditionText,Se=d.daysText,ge=d.dueDataAndRepeatText,fe=d.reminderFrequencyOptions,Ae=d.escalationFrequencyOptions,De=d.beforeAfterOptions,ye=(null===(m=S.tabData)||void 0===m?void 0:m.length)?S.tabData:c,Le=W?ye:ye.filter(function(e,i){return 0!==i}),Te=n.useState(null!==(E=null===(p=Le[0])||void 0===p?void 0:p.tabName)&&void 0!==E?E:""),be=Te[0],he=Te[1],Ne=(U=be.toLowerCase()).includes("reminder")?"reminders":U.includes("review")?"review":"assignees",Ie=n.useState(A||r.INITIAL_LEVELS),xe=Ie[0],Pe=Ie[1],je=n.useState(y||!1),Fe=je[0],we=je[1],qe=n.useState(T||null),Me=qe[0],Ce=qe[1],We=n.useState(null),Ue=We[0],Be=We[1],Ye=n.useState([]),Ge=Ye[0],Oe=Ye[1],ke=n.useState(B||v),He=ke[0],ze=ke[1],Ve=void 0!==G?G:Ge,Xe=void 0!==O?O:Oe,Je=void 0!==B?B:He,Ke=u.default.useMemo(function(){return{due_at:Me?Me.toISOString():"",assignee:xe.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(i,s,n){var a;return e.__assign(e.__assign({},i),((a={})[n]=s,a))},{})}},[Me,xe]);n.useEffect(function(){void 0!==B&&ze(B)},[B]),n.useEffect(function(){M&&M().then(function(e){Array.isArray(e)&&e.length>0?Be(e[0]):e&&!Array.isArray(e)&&Be(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),n.useEffect(function(){z&&he(z)},[z]),n.useEffect(function(){var e,i;Le.some(function(e){return e.tabName===be})||he(null!==(i=null===(e=Le[0])||void 0===e?void 0:e.tabName)&&void 0!==i?i:"")},[Le,be]),n.useEffect(function(){A&&Pe(function(i){var s=i.find(function(e){return e.isHidden});return s?e.__spreadArray(e.__spreadArray([],A,!0),[s],!1):A})},[A]),n.useEffect(function(){void 0!==y&&we(y)},[y]),n.useEffect(function(){void 0!==T&&Ce(T)},[T]),n.useEffect(function(){Pe(function(i){var s=i.filter(function(e){return!e.isHidden});if(Fe){var n={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==Ue?void 0:Ue.id)||"me",email:(null==Ue?void 0:Ue.email)||"",name:(null==Ue?void 0:Ue.name)?"".concat(Ue.name," (You)"):"Username (You)",accessLevel:"Approve"}]};return e.__spreadArray(e.__spreadArray([],s,!0),[n],!1)}return s})},[Fe,Ue]),n.useEffect(function(){var e=xe.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});ze(function(i){return e.map(function(e,s){var n=i.find(function(i){return i.email===e.email});return n||{id:s+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[xe]);var Qe=S.wrapperTitle||"Assign Redline and Manage Reminders",Ze=S.wrapperSubTitle||"Sec 4.1 - Technical Security Information",$e=S.wrapperPriority||"High",ei=S.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return i.jsx("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.overlay),F.overlay)},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===Ne?{width:"1250px",maxWidth:"95vw"}:{}),F.modal)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.header),F.header)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.headerLeft),F.headerLeft)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.modalTitle),F.modalTitle)},{children:Qe})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineRow),F.redlineRow)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineName),F.redlineName)},{children:Ze})),i.jsx("span",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.redlineBadge),ei),F.redlineBadge)},{children:$e}))]}))]})),i.jsx("button",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.closeBtn),F.closeBtn),onClick:h},{children:i.jsx(s.X,{size:20,color:"#6B7280"})}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabBar),F.tabBar)},{children:Le.map(function(s){var n=be===s.tabName;return i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tab),F.tab),n?e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.tabActive),F.tabActive):{}),onClick:function(){return he(s.tabName)}},{children:[s.tabIcon," ",s.tabName]}),s.tabName)})})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.body),F.body)},{children:["assignees"===Ne&&i.jsxs(i.Fragment,{children:[!1!==S.showFinalApprovalDueDate&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateBar),F.dueDateBar)},{children:[i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateLabel),F.dueDateLabel)},{children:["Final Approval due date"," ",i.jsx("sup",e.__assign({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.dueDateInputWrap),F.dueDateInputWrap)},{children:i.jsx(l.default,{value:Me?Me.toISOString().slice(0,10):"",onChange:Ce})})),i.jsxs("span",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.requiredToProceeed),F.requiredToProceeed)},{children:[i.jsx(s.CircleAlert,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),i.jsx(a.AssignReminderLevels,{levels:xe,totalLevels:P,requireFinalApproval:Fe,setLevels:Pe,setRequireFinalApproval:function(e){we(e)},fetchUsers:N,onValidationError:x,customStyles:F})]}),"reminders"===Ne&&i.jsx(o.ManageReminders,e.__assign({data:Ke,schedules:Ve,setSchedules:Xe,remainderOwners:Je,setRemainderOwners:function(e){var i="function"==typeof e?e(Je):e;Y&&Y(i),ze(i)},handelSendNow:function(e,i){k&&k(e||Ve,i||Je)},showPreviewEmail:null!=H&&H},void 0!==V&&{labels:V},void 0!==X&&{colors:X},void 0!==J&&{chipColor:J},void 0!==K&&{assignees:K},void 0!==Q&&{fallbackRecipients:Q},void 0!==Z&&{recipientsColor:Z},void 0!==$&&{manualReminderTitle:$},void 0!==ee&&{manualReminderDescription:ee},void 0!==ie&&{lastReminderText:ie},void 0!==se&&{selectRecipientsLabel:se},void 0!==ne&&{previewEmailButtonLabel:ne},void 0!==ae&&{sendNowButtonLabel:ae},void 0!==re&&{reminderSuccessTitle:re},void 0!==te&&{reminderSuccessDescription:te},void 0!==le&&{escalationTitle:le},void 0!==oe&&{escalationTitleTooltip:oe},void 0!==_e&&{escalationDescription:_e},void 0!==de&&{configureAutoReminderText:de},void 0!==ue&&{getDynamicStatement:ue},void 0!==ce&&{reminderStartDateLabel:ce},void 0!==ve&&{documentDueDateLabel:ve},void 0!==me&&{reminderFrequencyLabel:me},void 0!==pe&&{escalationRemindersLabel:pe},void 0!==Ee&&{escalationTooltip:Ee},void 0!==Re&&{escalationConditionText:Re},void 0!==Se&&{daysText:Se},void 0!==ge&&{dueDataAndRepeatText:ge},void 0!==fe&&{reminderFrequencyOptions:fe},void 0!==Ae&&{escalationFrequencyOptions:Ae},void 0!==De&&{beforeAfterOptions:De})),"review"===Ne&&i.jsx(t.default,{levels:xe,reviewData:f})]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.footer),F.footer)},{children:[i.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.clearBtn),F.clearBtn),q?F.actionBtnDisabled:{}),onClick:function(){Pe(r.INITIAL_LEVELS.map(function(i){return e.__assign(e.__assign({},i),{assignees:[],dueDate:null})})),we(!1),Ce(null)},disabled:q},{children:"Clear"})),i.jsx("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},_.DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES.saveBtn),F.saveBtn),q?F.actionBtnDisabled:{}),onClick:function(){var e=xe.filter(function(e){return!e.isHidden});null==D||D(e),null==L||L(Fe),null==b||b(Me),null==I||I({levels:e,requireFinalApproval:Fe,finalApprovalDueDate:Me,activeTab:Ne,schedules:Ve,remainderOwners:Je})},disabled:q},{children:"Save Changes"}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=AssignReminderWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),l=require("../styles/ReviewStatusStyles.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(i),a=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},o=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return s[Math.abs(i)%s.length]};function d(i){var l=i.reviewLevel,r=l.level,t=l.assigneeStatuses,a=l.extendedStatus,o="approved"===a,d={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"}}[a],g=o?"1px solid #D1FAE5":"1px solid #E5E7EB",x=o?"#F0FDF4":"#F8FAFC";return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:g,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:x,borderBottom:g,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(c,{name:r.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:r.title}))]})),s.jsxs("div",e.__assign({style:{backgroundColor:d.bg,color:d.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[d.icon,d.text]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:t.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:t.map(function(e,i){var n;return s.jsx(p,{assigneeStatus:e,extendedStatus:a},null!==(n=e.user.id)&&void 0!==n?n:i)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function g(i){var l,r,t,d=i.reviewLevel,g=d.assigneeStatuses,p=d.extendedStatus,c={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"}}[p],x=null===(l=g[0])||void 0===l?void 0:l.user;return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[x?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:o(null!==(r=x.id)&&void 0!==r?r:x.name).bg,color:o(null!==(t=x.id)&&void 0!==t?t:x.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:a(x.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:x.name})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:c.bg,color:c.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[c.icon,c.text]}))]}))}function p(i){var l,r=i.assigneeStatus,t=i.extendedStatus,d=r.user,g=a(d.name),p=o(null!==(l=d.id)&&void 0!==l?l:d.name);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:p.bg,color:p.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:g})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:d.name})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:d.email}))]}))]})),s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:["pending"===t&&s.jsxs(s.Fragment,{children:[s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#4B5563"}},{children:"Notified 1h ago"})),s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}),"approved"===t&&s.jsx(n.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5})]}))]}))}function c(i){var n=i.name,l=o(n);return s.jsx("span",e.__assign({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var x=function(e){switch(e){case 0:return s.jsx(n.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(n.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(n.User,{size:16,color:"#475569"});default:return s.jsx(n.CheckCircle,{size:16,color:"#475569"})}};function _(i){var r=i.levels,a=r.some(function(e){var s,i;return(null!==(i=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==i?i:0)>0});return s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),a?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:r.map(function(i,a){var o,d=i.isHidden,g=null===(o=i.assignees)||void 0===o?void 0:o.map(function(e){return e.name}).join(" / ");if(!g)return null;var p=d?s.jsx(n.User,{size:16,color:"#475569"}):x(a);return s.jsxs(t.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"6px"})},{children:[p,s.jsx("span",e.__assign({style:{fontSize:13,color:"#374151"}},{children:g}))]})),a<r.length-1&&s.jsx(n.ArrowRight,{size:16,color:"#9CA3AF"})]},a)})})):s.jsx("p",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(i){var r=i.levels,a=i.reviewData,o=void 0===a?{}:a,p=r.map(function(e,s){var i,n,l=null!==(i=o[s])&&void 0!==i?i:{},r=(null!==(n=e.assignees)&&void 0!==n?n:[]).map(function(e){var s;return{user:e,approved:null!==(s=l[String(e.id)])&&void 0!==s&&s}}),t=r.length>0&&r.every(function(e){return e.approved});return{level:e,assigneeStatuses:r,status:t?"approved":"not_started"}}),c=!1,x=p.map(function(s){var i="waiting";"approved"===s.status?i="approved":c||(i="pending",c=!0);var n=!0===s.level.isHidden;return e.__assign(e.__assign({},s),{extendedStatus:i,isFinalApproval:n})}),u=function(e){return e.filter(function(e){return"approved"===e.status}).length}(p),f=p.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[u," of ",f," level",1!==f?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:p.map(function(i,n){var r="approved"===i.status,t=0===n,a=n===f-1;return s.jsx("div",{style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:r?"#6366F1":"#E5E7EB",borderRadius:t&&a?"999px":t?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},n)})})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:p.map(function(i,n){return s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===i.status?"#6366F1":"#9CA3AF",fontWeight:"approved"===i.status?600:400})},{children:[i.level.headerName," - ",i.level.title]}),n)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(n.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(i,n){var l,r=n===x.length-1,a=i.isFinalApproval,o=null===(l=x[n+1])||void 0===l?void 0:l.isFinalApproval;return a?s.jsxs(t.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(g,{reviewLevel:i})]},n):s.jsxs(t.default.Fragment,{children:[s.jsx(d,{reviewLevel:i}),!r&&!o&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},n)})}))]})),s.jsx(_,{levels:r})]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),t=require("../styles/ReviewStatusStyles.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(i),o=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},a=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return s[Math.abs(i)%s.length]};function d(i){var t=i.reviewLevel,r=t.level,l=t.assigneeStatuses,o=t.extendedStatus,a={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"}}[o]||{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},d="approved"===o?"1px solid #D1FAE5":"rejected"===o?"1px solid #FCA5A5":"1px solid #E5E7EB",c="approved"===o?"#F0FDF4":"rejected"===o?"#FEF2F2":"#F8FAFC";return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:d,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:c,borderBottom:d,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(p,{name:r.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:r.title}))]})),s.jsxs("div",e.__assign({style:{backgroundColor:a.bg,color:a.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[a.icon,a.text]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:l.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:l.map(function(e,i){var n;return s.jsx(g,{assigneeStatus:e,extendedStatus:o},null!==(n=e.user.id)&&void 0!==n?n:i)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function c(i){var t,r,l,d=i.reviewLevel,c=d.assigneeStatuses,g=d.extendedStatus,p={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(n.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(n.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(n.X,{size:14}),text:"Rejected"}}[g]||{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(n.Hourglass,{size:14}),text:"Waiting"},x=null===(t=c[0])||void 0===t?void 0:t.user;return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[x?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:a(null!==(r=x.id)&&void 0!==r?r:x.name).bg,color:a(null!==(l=x.id)&&void 0!==l?l:x.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:o(x.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:x.name})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:p.bg,color:p.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[p.icon,p.text]}))]}))}function g(i){var t,r=i.assigneeStatus,l=i.extendedStatus,d=r,c=d.user,g=d.approved,p=d.rejected,x=o(c.name),_=a(null!==(t=c.id)&&void 0!==t?t:c.name);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:_.bg,color:_.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:g||"approved"===c.action?s.jsx(n.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):p||"rejected"===c.action?s.jsx(n.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===l?s.jsxs(s.Fragment,{children:[s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#4B5563"}},{children:"Notified 1h ago"})),s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):s.jsx(n.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function p(i){var n=i.name,t=a(n);return s.jsx("span",e.__assign({style:{backgroundColor:t.bg,color:t.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var x=function(e){switch(e){case 0:return s.jsx(n.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(n.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(n.User,{size:16,color:"#475569"});default:return s.jsx(n.CheckCircle,{size:16,color:"#475569"})}};function _(i){var r=i.levels,o=r.some(function(e){var s,i;return(null!==(i=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==i?i:0)>0});return s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),o?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:r.map(function(i,o){var a,d=i.isHidden,c=null===(a=i.assignees)||void 0===a?void 0:a.map(function(e){return e.name}).join(" / ");if(!c)return null;var g=d?s.jsx(n.User,{size:16,color:"#475569"}):x(o);return s.jsxs(l.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"6px"})},{children:[g,s.jsx("span",e.__assign({style:{fontSize:13,color:"#374151"}},{children:c}))]})),o<r.length-1&&s.jsx(n.ArrowRight,{size:16,color:"#9CA3AF"})]},o)})})):s.jsx("p",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(i){var r=i.levels,o=i.reviewData,a=void 0===o?{}:o,g=r.map(function(e,s){var i,n,t,r=null!==(n=null!==(i=a[s])&&void 0!==i?i:a[e.headerName])&&void 0!==n?n:{},l=(null!==(t=e.assignees)&&void 0!==t?t:[]).map(function(e){return{user:e,approved:!0===r[String(e.id)]||!0===r[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===r[String(e.id)]||"rejected"===r[String(e.email)]||"rejected"===e.action}}),o=e.isApproved||l.length>0&&l.every(function(e){return e.approved}),d=e.isRejected||l.some(function(e){return e.rejected}),c="not_started";return o?c="approved":d&&(c="rejected"),{level:e,assigneeStatuses:l,status:c}}),p=!1,x=g.map(function(s){var i="waiting";"approved"===s.status?i="approved":"rejected"===s.status?(i="rejected",p=!0):p||(i="pending",p=!0);var n=!0===s.level.isHidden;return e.__assign(e.__assign({},s),{extendedStatus:i,isFinalApproval:n})}),u=function(e){return e.filter(function(e){return"approved"===e.status}).length}(g),v=g.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[u," of ",v," level",1!==v?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:x.map(function(i,n){var r="approved"===i.extendedStatus,l="rejected"===i.extendedStatus,o=0===n,a=n===v-1;return s.jsx("div",{style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:r?"#6366F1":l?"#EF4444":"#E5E7EB",borderRadius:o&&a?"999px":o?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},n)})})),s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:x.map(function(i,n){return s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},t.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===i.extendedStatus?"#6366F1":"rejected"===i.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===i.extendedStatus||"rejected"===i.extendedStatus?600:400})},{children:[i.level.headerName," - ",i.level.title]}),n)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:t.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(n.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(i,n){var t,r=n===x.length-1,o=i.isFinalApproval,a=null===(t=x[n+1])||void 0===t?void 0:t.isFinalApproval;return o?s.jsxs(l.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(c,{reviewLevel:i})]},n):s.jsxs(l.default.Fragment,{children:[s.jsx(d,{reviewLevel:i}),!r&&!a&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},n)})}))]})),s.jsx(_,{levels:r})]}))};
|
|
2
2
|
//# sourceMappingURL=ReviewStatus.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as i}from"../../_virtual/_tslib.js";import{jsxs as r,jsx as n,Fragment as t}from"react/jsx-runtime";import{Bell as a,ClipboardList as o,X as l,CircleAlert as s}from"lucide-react";import d,{useState as c,useEffect as u}from"react";import{AssignReminderLevels as m}from"./AssignReminderLevels.js";import{INITIAL_LEVELS as v}from"./AssignReminderTest.js";import p from"./components/ReviewStatus.js";import f from"./components/CustomDatePicker.js";import{ManageReminders as y}from"./ManageReminders.js";import{DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES as b}from"./styles/AssignReminderWrapperStyles.js";var h=[{tabName:"Assignees & Approvers",tabIcon:r("svg",e({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[n("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),n("circle",{cx:"9",cy:"7",r:"4"}),n("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),n("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:n(a,{size:15})},{tabName:"Review Status",tabIcon:n(o,{size:15})}],D=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];function _(a){var o,_,w,g=a.metadata,R=void 0===g?{}:g,A=a.reviewData,T=void 0===A?{}:A,S=a.levels,L=a.setLevels,C=a.requireFinalApproval,q=a.setRequireFinalApproval,B=a.approvalDueDate,x=a.setApprovalDueDate,F=a.onClose,N=a.fetchUsers,O=a.onSave,k=a.onValidationError,M=a.totalLevels,I=a.customStyles,j=void 0===I?{}:I,H=a.isSaving,P=void 0!==H&&H,E=a.onRequireFinalApproval,W=a.isOwner,z=void 0===W||W;a.remindersData;var U,V=a.remainderOwners,Y=a.setRemainderOwners,G=a.schedules,J=a.setSchedules,K=a.handelSendNow,Q=a.showPreviewEmail,X=a.
|
|
1
|
+
import{__assign as e,__spreadArray as i}from"../../_virtual/_tslib.js";import{jsxs as r,jsx as n,Fragment as t}from"react/jsx-runtime";import{Bell as a,ClipboardList as o,X as l,CircleAlert as s}from"lucide-react";import d,{useState as c,useEffect as u}from"react";import{AssignReminderLevels as m}from"./AssignReminderLevels.js";import{INITIAL_LEVELS as v}from"./AssignReminderTest.js";import p from"./components/ReviewStatus.js";import f from"./components/CustomDatePicker.js";import{ManageReminders as y}from"./ManageReminders.js";import{DEFAULT_ASSIGN_REMINDER_WRAPPER_STYLES as b}from"./styles/AssignReminderWrapperStyles.js";var h=[{tabName:"Assignees & Approvers",tabIcon:r("svg",e({width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},{children:[n("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),n("circle",{cx:"9",cy:"7",r:"4"}),n("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),n("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}))},{tabName:"Manage Reminders",tabIcon:n(a,{size:15})},{tabName:"Review Status",tabIcon:n(o,{size:15})}],D=[{id:1,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:2,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}},{id:3,name:"",email:"",reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}];function _(a){var o,_,w,g=a.metadata,R=void 0===g?{}:g,A=a.reviewData,T=void 0===A?{}:A,S=a.levels,L=a.setLevels,C=a.requireFinalApproval,q=a.setRequireFinalApproval,B=a.approvalDueDate,x=a.setApprovalDueDate,F=a.onClose,N=a.fetchUsers,O=a.onSave,k=a.onValidationError,M=a.totalLevels,I=a.customStyles,j=void 0===I?{}:I,H=a.isSaving,P=void 0!==H&&H,E=a.onRequireFinalApproval,W=a.isOwner,z=void 0===W||W;a.remindersData;var U,V=a.remainderOwners,Y=a.setRemainderOwners,G=a.schedules,J=a.setSchedules,K=a.handelSendNow,Q=a.showPreviewEmail,X=a.tabName,Z=a.reminderLabels,$=a.reminderColors,ee=a.reminderChipColor,ie=a.reminderAssignees,re=a.reminderFallbackRecipients,ne=a.reminderRecipientsColor,te=a.manualReminderTitle,ae=a.manualReminderDescription,oe=a.lastReminderText,le=a.selectRecipientsLabel,se=a.previewEmailButtonLabel,de=a.sendNowButtonLabel,ce=a.reminderSuccessTitle,ue=a.reminderSuccessDescription,me=a.escalationTitle,ve=a.escalationTitleTooltip,pe=a.escalationDescription,fe=a.configureAutoReminderText,ye=a.getDynamicStatement,be=a.reminderStartDateLabel,he=a.documentDueDateLabel,De=a.reminderFrequencyLabel,_e=a.escalationRemindersLabel,we=a.escalationTooltip,ge=a.escalationConditionText,Re=a.daysText,Ae=a.dueDataAndRepeatText,Te=a.reminderFrequencyOptions,Se=a.escalationFrequencyOptions,Le=a.beforeAfterOptions,Ce=(null===(o=R.tabData)||void 0===o?void 0:o.length)?R.tabData:h,qe=z?Ce:Ce.filter(function(e,i){return 0!==i}),Be=c(null!==(w=null===(_=qe[0])||void 0===_?void 0:_.tabName)&&void 0!==w?w:""),xe=Be[0],Fe=Be[1],Ne=(U=xe.toLowerCase()).includes("reminder")?"reminders":U.includes("review")?"review":"assignees",Oe=c(S||v),ke=Oe[0],Me=Oe[1],Ie=c(C||!1),je=Ie[0],He=Ie[1],Pe=c(B||null),Ee=Pe[0],We=Pe[1],ze=c(null),Ue=ze[0],Ve=ze[1],Ye=c([]),Ge=Ye[0],Je=Ye[1],Ke=c(V||D),Qe=Ke[0],Xe=Ke[1],Ze=void 0!==G?G:Ge,$e=void 0!==J?J:Je,ei=void 0!==V?V:Qe,ii=d.useMemo(function(){return{due_at:Ee?Ee.toISOString():"",assignee:ke.filter(function(e){return!e.isHidden}).flatMap(function(e){return e.assignees||[]}).reduce(function(i,r,n){var t;return e(e({},i),((t={})[n]=r,t))},{})}},[Ee,ke]);u(function(){void 0!==V&&Xe(V)},[V]),u(function(){E&&E().then(function(e){Array.isArray(e)&&e.length>0?Ve(e[0]):e&&!Array.isArray(e)&&Ve(e)}).catch(function(e){return console.error("Failed to fetch user:",e)})},[]),u(function(){X&&Fe(X)},[X]),u(function(){var e,i;qe.some(function(e){return e.tabName===xe})||Fe(null!==(i=null===(e=qe[0])||void 0===e?void 0:e.tabName)&&void 0!==i?i:"")},[qe,xe]),u(function(){S&&Me(function(e){var r=e.find(function(e){return e.isHidden});return r?i(i([],S,!0),[r],!1):S})},[S]),u(function(){void 0!==C&&He(C)},[C]),u(function(){void 0!==B&&We(B)},[B]),u(function(){Me(function(e){var r=e.filter(function(e){return!e.isHidden});if(je){var n={headerName:"Final",title:"Final Approval",isMandatory:!0,hasDueDate:!1,dueDate:null,isHidden:!0,assignees:[{id:(null==Ue?void 0:Ue.id)||"me",email:(null==Ue?void 0:Ue.email)||"",name:(null==Ue?void 0:Ue.name)?"".concat(Ue.name," (You)"):"Username (You)",accessLevel:"Approve"}]};return i(i([],r,!0),[n],!1)}return r})},[je,Ue]),u(function(){var e=ke.flatMap(function(e){return e.assignees||[]}).filter(function(e){return e.email});Xe(function(i){return e.map(function(e,r){var n=i.find(function(i){return i.email===e.email});return n||{id:r+1,name:e.name,email:e.email,reminder_start_date:"",reminder_frequency:{type:"preset",value:""},is_escalation_reminder:!1,days:{type:"preset",value:""},before_or_after:"",escalation_reminder_frequency:{type:"preset",value:""}}})})},[ke]);var ri=R.wrapperTitle||"Assign Redline and Manage Reminders",ni=R.wrapperSubTitle||"Sec 4.1 - Technical Security Information",ti=R.wrapperPriority||"High",ai=R.wrapperPriorityStyles||{backgroundColor:"#DC262618",color:"#DC2626",border:"1px solid #DC262640"};return n("div",e({style:e(e({},b.overlay),j.overlay)},{children:r("div",e({style:e(e(e(e({},b.modal),{transition:"width 0.3s ease, max-width 0.3s ease"}),"reminders"===Ne?{width:"1250px",maxWidth:"95vw"}:{}),j.modal)},{children:[r("div",e({style:e(e({},b.header),j.header)},{children:[r("div",e({style:e(e({},b.headerLeft),j.headerLeft)},{children:[n("span",e({style:e(e({},b.modalTitle),j.modalTitle)},{children:ri})),r("div",e({style:e(e({},b.redlineRow),j.redlineRow)},{children:[n("span",e({style:e(e({},b.redlineName),j.redlineName)},{children:ni})),n("span",e({style:e(e(e({},b.redlineBadge),ai),j.redlineBadge)},{children:ti}))]}))]})),n("button",e({style:e(e({},b.closeBtn),j.closeBtn),onClick:F},{children:n(l,{size:20,color:"#6B7280"})}))]})),n("div",e({style:e(e({},b.tabBar),j.tabBar)},{children:qe.map(function(i){var n=xe===i.tabName;return r("button",e({style:e(e(e({},b.tab),j.tab),n?e(e({},b.tabActive),j.tabActive):{}),onClick:function(){return Fe(i.tabName)}},{children:[i.tabIcon," ",i.tabName]}),i.tabName)})})),r("div",e({style:e(e({},b.body),j.body)},{children:["assignees"===Ne&&r(t,{children:[!1!==R.showFinalApprovalDueDate&&r("div",e({style:e(e({},b.dueDateBar),j.dueDateBar)},{children:[r("span",e({style:e(e({},b.dueDateLabel),j.dueDateLabel)},{children:["Final Approval due date"," ",n("sup",e({style:{color:"#DC2626",marginLeft:2}},{children:"*"}))]})),n("div",e({style:e(e({},b.dueDateInputWrap),j.dueDateInputWrap)},{children:n(f,{value:Ee?Ee.toISOString().slice(0,10):"",onChange:We})})),r("span",e({style:e(e({},b.requiredToProceeed),j.requiredToProceeed)},{children:[n(s,{size:14,color:"#6B7280"})," Required to proceed"]}))]})),n(m,{levels:ke,totalLevels:M,requireFinalApproval:je,setLevels:Me,setRequireFinalApproval:function(e){He(e)},fetchUsers:N,onValidationError:k,customStyles:j})]}),"reminders"===Ne&&n(y,e({data:ii,schedules:Ze,setSchedules:$e,remainderOwners:ei,setRemainderOwners:function(e){var i="function"==typeof e?e(ei):e;Y&&Y(i),Xe(i)},handelSendNow:function(e,i){K&&K(e||Ze,i||ei)},showPreviewEmail:null!=Q&&Q},void 0!==Z&&{labels:Z},void 0!==$&&{colors:$},void 0!==ee&&{chipColor:ee},void 0!==ie&&{assignees:ie},void 0!==re&&{fallbackRecipients:re},void 0!==ne&&{recipientsColor:ne},void 0!==te&&{manualReminderTitle:te},void 0!==ae&&{manualReminderDescription:ae},void 0!==oe&&{lastReminderText:oe},void 0!==le&&{selectRecipientsLabel:le},void 0!==se&&{previewEmailButtonLabel:se},void 0!==de&&{sendNowButtonLabel:de},void 0!==ce&&{reminderSuccessTitle:ce},void 0!==ue&&{reminderSuccessDescription:ue},void 0!==me&&{escalationTitle:me},void 0!==ve&&{escalationTitleTooltip:ve},void 0!==pe&&{escalationDescription:pe},void 0!==fe&&{configureAutoReminderText:fe},void 0!==ye&&{getDynamicStatement:ye},void 0!==be&&{reminderStartDateLabel:be},void 0!==he&&{documentDueDateLabel:he},void 0!==De&&{reminderFrequencyLabel:De},void 0!==_e&&{escalationRemindersLabel:_e},void 0!==we&&{escalationTooltip:we},void 0!==ge&&{escalationConditionText:ge},void 0!==Re&&{daysText:Re},void 0!==Ae&&{dueDataAndRepeatText:Ae},void 0!==Te&&{reminderFrequencyOptions:Te},void 0!==Se&&{escalationFrequencyOptions:Se},void 0!==Le&&{beforeAfterOptions:Le})),"review"===Ne&&n(p,{levels:ke,reviewData:T})]})),r("div",e({style:e(e({},b.footer),j.footer)},{children:[n("button",e({style:e(e(e({},b.clearBtn),j.clearBtn),P?j.actionBtnDisabled:{}),onClick:function(){Me(v.map(function(i){return e(e({},i),{assignees:[],dueDate:null})})),He(!1),We(null)},disabled:P},{children:"Clear"})),n("button",e({style:e(e(e({},b.saveBtn),j.saveBtn),P?j.actionBtnDisabled:{}),onClick:function(){var e=ke.filter(function(e){return!e.isHidden});null==L||L(e),null==q||q(je),null==x||x(Ee),null==O||O({levels:e,requireFinalApproval:je,finalApprovalDueDate:Ee,activeTab:Ne,schedules:Ze,remainderOwners:ei})},disabled:P},{children:"Save Changes"}))]}))]}))}))}export{_ as AssignReminderWrapper};
|
|
2
2
|
//# sourceMappingURL=AssignReminderWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as
|
|
1
|
+
import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as i,Fragment as n}from"react/jsx-runtime";import r from"react";import{Info as l,Check as o,Hourglass as d,X as s,CircleCheck as a,MinusCircle as c,User as p,ArrowRight as g,CheckCircle as u,FileCheck as v,LucidePen as f}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as x}from"../styles/ReviewStatusStyles.js";var h=function(e){var t=e.trim().split(/\s+/);return 1===t.length?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()},y=function(e){for(var t=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],i=0,n=0;n<e.length;n++)i=e.charCodeAt(n)+((i<<5)-i);return t[Math.abs(i)%t.length]};function F(n){var o=n.levels,d=n.reviewData,s=void 0===d?{}:d,a=o.map(function(e,t){var i,n,r,l=null!==(n=null!==(i=s[t])&&void 0!==i?i:s[e.headerName])&&void 0!==n?n:{},o=(null!==(r=e.assignees)&&void 0!==r?r:[]).map(function(e){return{user:e,approved:!0===l[String(e.id)]||!0===l[String(e.email)]||"approved"===e.action||!0===e.approved,rejected:"rejected"===l[String(e.id)]||"rejected"===l[String(e.email)]||"rejected"===e.action}}),d=e.isApproved||o.length>0&&o.every(function(e){return e.approved}),a=e.isRejected||o.some(function(e){return e.rejected}),c="not_started";return d?c="approved":a&&(c="rejected"),{level:e,assigneeStatuses:o,status:c}}),c=!1,p=a.map(function(t){var i="waiting";"approved"===t.status?i="approved":"rejected"===t.status?(i="rejected",c=!0):c||(i="pending",c=!0);var n=!0===t.level.isHidden;return e(e({},t),{extendedStatus:i,isFinalApproval:n})}),g=function(e){return e.filter(function(e){return"approved"===e.status}).length}(a),u=a.length;return t("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[t("div",{children:[t("div",e({style:x.progressHeader},{children:[i("span",e({style:x.progressTitle},{children:"Approval Progress"})),t("span",e({style:x.progressCount},{children:[g," of ",u," level",1!==u?"s":""," complete"]}))]})),i("div",e({style:x.progressBarTrack},{children:p.map(function(t,n){var r="approved"===t.extendedStatus,l="rejected"===t.extendedStatus,o=0===n,d=n===u-1;return i("div",{style:e(e({},x.progressSegment),{backgroundColor:r?"#6366F1":l?"#EF4444":"#E5E7EB",borderRadius:o&&d?"999px":o?"999px 0 0 999px":d?"0 999px 999px 0":"0",marginRight:d?0:3})},n)})})),i("div",e({style:x.progressLabels},{children:p.map(function(i,n){return t("span",e({style:e(e({},x.progressLabel),{color:"approved"===i.extendedStatus?"#6366F1":"rejected"===i.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===i.extendedStatus||"rejected"===i.extendedStatus?600:400})},{children:[i.level.headerName," - ",i.level.title]}),n)})}))]}),t("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[i("div",e({style:x.sectionHeadingRow},{children:t("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",e({style:x.sectionTitle},{children:"Approval Levels"})),i(l,{size:15,color:"#9CA3AF"})]}))})),i("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:p.map(function(n,l){var o,d=l===p.length-1,s=n.isFinalApproval,a=null===(o=p[l+1])||void 0===o?void 0:o.isFinalApproval;return t(r.Fragment,s?{children:[t("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),i("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),i(b,{reviewLevel:n})]}:{children:[i(m,{reviewLevel:n}),!d&&!a&&t("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),i("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),i("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},l)})}))]})),i(z,{levels:o})]}))}function m(n){var r=n.reviewLevel,l=r.level,a=r.assigneeStatuses,c=r.extendedStatus,p={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(s,{size:14}),text:"Rejected"}}[c]||{bg:"#F3F4F6",color:"#4B5563",icon:i(d,{size:14}),text:"Waiting"},g="approved"===c?"1px solid #D1FAE5":"rejected"===c?"1px solid #FCA5A5":"1px solid #E5E7EB";return t("div",e({style:{backgroundColor:"#FFFFFF",border:g,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[t("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"approved"===c?"#F0FDF4":"rejected"===c?"#FEF2F2":"#F8FAFC",borderBottom:g,padding:"12px 16px"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[i(C,{name:l.headerName}),i("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:l.title}))]})),t("div",e({style:{backgroundColor:p.bg,color:p.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[p.icon,p.text]}))]})),i("div",e({style:{padding:"16px"}},{children:a.length>0?i("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:a.map(function(e,t){var n;return i(E,{assigneeStatus:e,extendedStatus:c},null!==(n=e.user.id)&&void 0!==n?n:t)})})):i("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function b(n){var r,l,a,c=n.reviewLevel,p=c.assigneeStatuses,g=c.extendedStatus,u={approved:{bg:"#ECFDF5",color:"#059669",icon:i(o,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:i(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:i(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:i(s,{size:14}),text:"Rejected"}}[g]||{bg:"#F3F4F6",color:"#4B5563",icon:i(d,{size:14}),text:"Waiting"},v=null===(r=p[0])||void 0===r?void 0:r.user;return t("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[v?t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(l=v.id)&&void 0!==l?l:v.name).bg,color:y(null!==(a=v.id)&&void 0!==a?a:v.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(v.name)})),t("div",e({style:{display:"flex",flexDirection:"column"}},{children:[i("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:v.name})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):i("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),t("div",e({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function E(r){var l,o=r.assigneeStatus,d=r.extendedStatus,p=o,g=p.user,u=p.approved,v=p.rejected,f=h(g.name),x=y(null!==(l=g.id)&&void 0!==l?l:g.name);return t("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[t("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[i("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:x.bg,color:x.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:f})),t("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[i("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:g.name})),i("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:g.email}))]}))]})),i("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:u||"approved"===g.action?i(a,{size:20,color:"#16A34A",strokeWidth:1.5}):v||"rejected"===g.action?i(s,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===d?t(n,{children:[i("span",e({style:{fontSize:"13px",color:"#4B5563"}},{children:"Notified 1h ago"})),i(c,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):i(c,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function C(t){var n=t.name,r=y(n);return i("span",e({style:{backgroundColor:r.bg,color:r.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:n}))}var S=function(e){switch(e){case 0:return i(f,{size:16,color:"#475569"});case 1:return i(v,{size:16,color:"#475569"});case 2:return i(p,{size:16,color:"#475569"});default:return i(u,{size:16,color:"#475569"})}};function z(n){var l=n.levels,o=l.some(function(e){var t,i;return(null!==(i=null===(t=e.assignees)||void 0===t?void 0:t.length)&&void 0!==i?i:0)>0});return t("div",e({style:x.flowBox},{children:[i("span",e({style:x.flowTitle},{children:"Current Approval Flow"})),o?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:l.map(function(n,o){var d,s=n.isHidden,a=null===(d=n.assignees)||void 0===d?void 0:d.map(function(e){return e.name}).join(" / ");if(!a)return null;var c=s?i(p,{size:16,color:"#475569"}):S(o);return t(r.Fragment,{children:[t("span",e({style:e(e({},x.flowChip),{display:"flex",alignItems:"center",gap:"6px"})},{children:[c,i("span",e({style:{fontSize:13,color:"#374151"}},{children:a}))]})),o<l.length-1&&i(g,{size:16,color:"#9CA3AF"})]},o)})})):i("p",e({style:x.flowEmpty},{children:"No owners assigned yet."}))]}))}export{F as default};
|
|
2
2
|
//# sourceMappingURL=ReviewStatus.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AssignReminderWrapperProps } from "./types/types";
|
|
3
|
-
declare function AssignReminderWrapper({ metadata, reviewData, levels, setLevels, requireFinalApproval, setRequireFinalApproval, approvalDueDate, setApprovalDueDate, onClose, fetchUsers, onSave, onValidationError, totalLevels, customStyles, isSaving, onRequireFinalApproval, isOwner, remindersData, remainderOwners: remainderOwnersProp, setRemainderOwners: setRemainderOwnersProp, schedules: schedulesProp, setSchedules: setSchedulesProp, handelSendNow, showPreviewEmail, reminderLabels, reminderColors, reminderChipColor, reminderAssignees, reminderFallbackRecipients, reminderRecipientsColor, manualReminderTitle, manualReminderDescription, lastReminderText, selectRecipientsLabel, previewEmailButtonLabel, sendNowButtonLabel, reminderSuccessTitle, reminderSuccessDescription, escalationTitle, escalationTitleTooltip, escalationDescription, configureAutoReminderText, getDynamicStatement, reminderStartDateLabel, documentDueDateLabel, reminderFrequencyLabel, escalationRemindersLabel, escalationTooltip, escalationConditionText, daysText, dueDataAndRepeatText, reminderFrequencyOptions, escalationFrequencyOptions, beforeAfterOptions, }: AssignReminderWrapperProps): React.JSX.Element;
|
|
3
|
+
declare function AssignReminderWrapper({ metadata, reviewData, levels, setLevels, requireFinalApproval, setRequireFinalApproval, approvalDueDate, setApprovalDueDate, onClose, fetchUsers, onSave, onValidationError, totalLevels, customStyles, isSaving, onRequireFinalApproval, isOwner, remindersData, remainderOwners: remainderOwnersProp, setRemainderOwners: setRemainderOwnersProp, schedules: schedulesProp, setSchedules: setSchedulesProp, handelSendNow, showPreviewEmail, tabName, reminderLabels, reminderColors, reminderChipColor, reminderAssignees, reminderFallbackRecipients, reminderRecipientsColor, manualReminderTitle, manualReminderDescription, lastReminderText, selectRecipientsLabel, previewEmailButtonLabel, sendNowButtonLabel, reminderSuccessTitle, reminderSuccessDescription, escalationTitle, escalationTitleTooltip, escalationDescription, configureAutoReminderText, getDynamicStatement, reminderStartDateLabel, documentDueDateLabel, reminderFrequencyLabel, escalationRemindersLabel, escalationTooltip, escalationConditionText, daysText, dueDataAndRepeatText, reminderFrequencyOptions, escalationFrequencyOptions, beforeAfterOptions, }: AssignReminderWrapperProps): React.JSX.Element;
|
|
4
4
|
export { AssignReminderWrapper };
|
|
5
5
|
//# sourceMappingURL=AssignReminderWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssignReminderWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAMnE,OAAO,EACH,0BAA0B,EAK7B,MAAM,eAAe,CAAC;AAwDvB,iBAAS,qBAAqB,CAAC,EAC3B,QAAa,EACb,UAAe,EACf,MAAM,EACN,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,YAAiB,EACjB,QAAgB,EAChB,sBAAsB,EACtB,OAAc,EAGd,aAAa,EACb,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,sBAAsB,EAC1C,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EACb,gBAAgB,
|
|
1
|
+
{"version":3,"file":"AssignReminderWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/AssignReminders/AssignReminderWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAMnE,OAAO,EACH,0BAA0B,EAK7B,MAAM,eAAe,CAAC;AAwDvB,iBAAS,qBAAqB,CAAC,EAC3B,QAAa,EACb,UAAe,EACf,MAAM,EACN,SAAS,EACT,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,YAAiB,EACjB,QAAgB,EAChB,sBAAsB,EACtB,OAAc,EAGd,aAAa,EACb,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,sBAAsB,EAC1C,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EACb,gBAAgB,EAChB,OAAO,EAGP,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,GACrB,EAAE,0BAA0B,qBA8X5B;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/ReviewStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ReviewStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/ReviewStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAKH,iBAAiB,EACpB,MAAM,gBAAgB,CAAC;AAmCxB,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,UAAe,EAAE,EAAE,iBAAiB,qBA0KlF"}
|
|
@@ -5,6 +5,10 @@ export interface AssigneeUser {
|
|
|
5
5
|
name: string;
|
|
6
6
|
id: any;
|
|
7
7
|
accessLevel?: string;
|
|
8
|
+
/** Runtime: set when the user takes an action on this redline */
|
|
9
|
+
action?: "approved" | "rejected" | "iterated";
|
|
10
|
+
/** ISO datetime string of when action was taken */
|
|
11
|
+
action_taken_at?: string;
|
|
8
12
|
}
|
|
9
13
|
export interface Level {
|
|
10
14
|
headerName: string;
|
|
@@ -14,6 +18,10 @@ export interface Level {
|
|
|
14
18
|
dueDate?: Date | null;
|
|
15
19
|
isHidden?: boolean;
|
|
16
20
|
assignees?: AssigneeUser[];
|
|
21
|
+
isApproved?: boolean;
|
|
22
|
+
isRejected?: boolean;
|
|
23
|
+
/** Granular status propagated from the backend via mapApprovalLevelsToUI */
|
|
24
|
+
status?: "approved" | "rejected" | "completed" | "pending" | "waiting" | "not_started";
|
|
17
25
|
}
|
|
18
26
|
export type DropdownOption = {
|
|
19
27
|
label: string;
|
|
@@ -62,6 +70,7 @@ export interface AssignReminderWrapperProps {
|
|
|
62
70
|
isSaving?: boolean;
|
|
63
71
|
onRequireFinalApproval?: () => Promise<AssigneeUser>;
|
|
64
72
|
remindersData?: ManageRemindersProps["data"];
|
|
73
|
+
tabName?: string;
|
|
65
74
|
remainderOwners?: remainderOwnerValue[];
|
|
66
75
|
setRemainderOwners?: React.Dispatch<React.SetStateAction<remainderOwnerValue[]>>;
|
|
67
76
|
schedules?: any[];
|
|
@@ -128,7 +137,7 @@ export interface LevelAccordionProps {
|
|
|
128
137
|
onDueDateChange: (date: Date | null) => void;
|
|
129
138
|
onAssigneesChange: (assignees: AssigneeUser[]) => void;
|
|
130
139
|
}
|
|
131
|
-
export type ApprovalStatus = "approved" | "
|
|
140
|
+
export type ApprovalStatus = "approved" | "rejected" | "not_started";
|
|
132
141
|
export interface LevelReviewStatus {
|
|
133
142
|
level: Level;
|
|
134
143
|
assigneeStatuses: AssigneeApprovalStatus[];
|
|
@@ -137,10 +146,22 @@ export interface LevelReviewStatus {
|
|
|
137
146
|
export interface AssigneeApprovalStatus {
|
|
138
147
|
user: AssigneeUser;
|
|
139
148
|
approved: boolean;
|
|
149
|
+
/** Populated inside ReviewStatus — not part of the public Level contract */
|
|
150
|
+
rejected?: boolean;
|
|
140
151
|
}
|
|
141
152
|
export interface ReviewStatusProps {
|
|
142
153
|
levels: Level[];
|
|
143
|
-
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated
|
|
156
|
+
* reviewData is no longer the primary status source.
|
|
157
|
+
* Status is now derived directly from `level.isApproved`, `level.isRejected`,
|
|
158
|
+
* and `level.status` — which are kept in sync by mapApprovalLevelsToUI and
|
|
159
|
+
* the approve/reject submitAction handlers.
|
|
160
|
+
*
|
|
161
|
+
* This prop is kept for backward compatibility only and is used as a last-resort
|
|
162
|
+
* fallback when none of the level status fields are set.
|
|
163
|
+
*/
|
|
164
|
+
reviewData?: Record<string | number, any>;
|
|
144
165
|
}
|
|
145
166
|
export interface ColorConfig {
|
|
146
167
|
bg: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,YAAY;IACzB,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,YAAY;IACzB,KAAK,EA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AE,MAAM,EAAE,CAAC;IACpC,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viswa-test/creative-workspace-ui-component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"author": "Viswa Koduru",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -138,6 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
"dependencies": {
|
|
140
140
|
"@craco/craco": "^7.1.0",
|
|
141
|
-
"@radix-ui/react-tooltip": "^1.2.8"
|
|
141
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
142
|
+
"@viswa-test/requirement-ai": "^0.0.28"
|
|
142
143
|
}
|
|
143
144
|
}
|