Skip to content

Commit f2e96ba

Browse files
authored
Merge branch 'master' into test/build/0.25.1
2 parents 3957e4e + 56e8ca2 commit f2e96ba

File tree

4 files changed

+36
-96
lines changed

4 files changed

+36
-96
lines changed

packages/react-sdk-components/src/bridge/react_pconnect.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ const connectRedux = (component, c11nEnv) => {
100100
}
101101
}
102102
}
103+
// For CaseSummary, we need to compare changes in
104+
// primaryFields and secondary Fields
105+
if (next.template === 'CaseSummary') {
106+
for (const key of Object.keys(prev)) {
107+
if (!PCore.isDeepEqual(next[key], prev[key])) {
108+
return false;
109+
}
110+
}
111+
}
103112
/* TODO For some rawConfig we are not getting routingInfo under allStateProps */
104113
return !routingInfoCompare(next, prev);
105114
}

packages/react-sdk-components/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,8 @@ export default function CaseSummaryFields(props: CaseSummaryFieldsProps) {
123123
slotProps={{
124124
input: {
125125
readOnly: true,
126-
inputProps: {
127-
style: { cursor: 'pointer' },
128-
disableUnderline: true
129-
}
126+
disableUnderline: true,
127+
inputProps: { style: { cursor: 'pointer' } }
130128
}
131129
}}
132130
/>

packages/react-sdk-components/src/components/infra/Containers/FlowContainer/FlowContainer.tsx

Lines changed: 12 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
5858
const AlertBanner = getComponentFromMap('AlertBanner');
5959

6060
const pCoreConstants = PCore.getConstants();
61-
const PCoreVersion = PCore.getPCoreVersion();
6261
const { TODO } = pCoreConstants;
6362
const todo_headerText = 'To do';
6463

@@ -78,6 +77,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
7877
const getPConnect = getPConnectOfActiveContainerItem || getPConnectOfFlowContainer;
7978
const thePConn = getPConnect();
8079
const containerName = assignmentNames && assignmentNames.length > 0 ? assignmentNames[0] : '';
80+
const bShowBanner = showBanner(getPConnect);
8181
// const [init, setInit] = useState(true);
8282
// const [fcState, setFCState] = useState({ hasError: false });
8383

@@ -104,7 +104,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
104104
function getBuildName(): string {
105105
const ourPConn = getPConnect();
106106

107-
// let { getPConnect, name } = this.pConn$.pConn;
108107
const context = ourPConn.getContextName();
109108
let viewContainerName = ourPConn.getContainerName();
110109

@@ -113,7 +112,7 @@ export const FlowContainer = (props: FlowContainerProps) => {
113112
}
114113

115114
function getTodoVisibility() {
116-
const caseViewMode = getPConnect().getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
115+
const caseViewMode = getPConnect().getValue('context_data.caseViewMode');
117116
if (caseViewMode && caseViewMode === 'review') {
118117
return true;
119118
}
@@ -123,16 +122,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
123122
function initComponent() {
124123
const ourPConn = getPConnect();
125124

126-
// debugging/investigation help
127-
// console.log(`${ourPConn.getComponentName()}: children update for main draw`);
128-
129-
// const oData = ourPConn.getDataObject();
130-
131-
// const activeActionLabel = "";
132-
// const child0_getPConnect = arNewChildren[0].getPConnect();
133-
134-
// this.templateName$ = this.configProps$["template"];
135-
136125
// debugger;
137126
setShowTodo(getTodoVisibility());
138127

@@ -156,63 +145,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
156145
}
157146
}, [isInitialized, hasItems]);
158147

159-
function isCaseWideLocalAction() {
160-
const ourPConn = getPConnect();
161-
162-
const actionID = ourPConn.getValue(pCoreConstants.CASE_INFO.ACTIVE_ACTION_ID, ''); // 2nd arg empty string until typedefs properly allow optional
163-
const caseActions = ourPConn.getValue(pCoreConstants.CASE_INFO.AVAILABLEACTIONS, ''); // 2nd arg empty string until typedefs properly allow optional
164-
let bCaseWideAction = false;
165-
if (caseActions && actionID) {
166-
const actionObj = caseActions.find(caseAction => caseAction.ID === actionID);
167-
if (actionObj) {
168-
bCaseWideAction = actionObj.type === 'Case';
169-
}
170-
}
171-
return bCaseWideAction;
172-
}
173-
174-
function hasChildCaseAssignments() {
175-
const ourPConn = getPConnect();
176-
177-
const childCases = ourPConn.getValue(pCoreConstants.CASE_INFO.CHILD_ASSIGNMENTS, ''); // 2nd arg empty string until typedefs properly allow optional
178-
// const allAssignments = [];
179-
return !!(childCases && childCases.length > 0);
180-
}
181-
182-
function hasAssignments() {
183-
const ourPConn = getPConnect();
184-
185-
let bHasAssignments = false;
186-
const assignmentsList: any[] = ourPConn.getValue(pCoreConstants.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS, ''); // 2nd arg empty string until typedefs properly allow optional
187-
const isEmbedded = window.location.href.includes('embedded');
188-
let bAssignmentsForThisOperator = false;
189-
// 8.7 includes assignments in Assignments List that may be assigned to
190-
// a different operator. So, see if there are any assignments for
191-
// the current operator
192-
if (PCoreVersion?.includes('8.7') || isEmbedded) {
193-
const thisOperator = PCore.getEnvironmentInfo().getOperatorIdentifier();
194-
for (const assignment of assignmentsList) {
195-
if (assignment.assigneeInfo.ID === thisOperator) {
196-
bAssignmentsForThisOperator = true;
197-
}
198-
}
199-
} else {
200-
bAssignmentsForThisOperator = true;
201-
}
202-
// Bail out if there isn't an assignmentsList
203-
if (!assignmentsList) {
204-
return bHasAssignments;
205-
}
206-
207-
const bHasChildCaseAssignments = hasChildCaseAssignments();
208-
209-
if (bAssignmentsForThisOperator || bHasChildCaseAssignments || isCaseWideLocalAction()) {
210-
bHasAssignments = true;
211-
}
212-
213-
return bHasAssignments;
214-
}
215-
216148
// From SDK-WC updateSelf - so do this in useEffect that's run only when the props change...
217149
useEffect(() => {
218150
setBuildName(getBuildName());
@@ -222,29 +154,21 @@ export const FlowContainer = (props: FlowContainerProps) => {
222154

223155
let loadingInfo: any;
224156
try {
225-
loadingInfo = thePConn.getLoadingStatus(''); // 1st arg empty string until typedefs properly allow optional
157+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
158+
loadingInfo = thePConn.getLoadingStatus();
226159
} catch (ex) {
227160
// eslint-disable-next-line no-console
228161
console.error(`${thePConn.getComponentName()}: loadingInfo catch block`);
229162
}
230163

231-
// let configProps = this.thePConn.resolveConfigProps(this.thePConn.getConfigProps());
232-
233-
if (!loadingInfo) {
234-
// turn off spinner
235-
// this.psService.sendMessage(false);
236-
}
237-
238-
const caseViewMode = thePConn.getValue('context_data.caseViewMode', ''); // 2nd arg empty string until typedefs properly allow optional
164+
const caseViewMode = thePConn.getValue('context_data.caseViewMode');
239165
const { CASE_INFO: CASE_CONSTS } = pCoreConstants;
240166
if (caseViewMode && caseViewMode === 'review') {
241167
setTimeout(() => {
242168
// updated for 8.7 - 30-Mar-2022
243169
const todoAssignments = getToDoAssignments(thePConn);
244-
if (todoAssignments && todoAssignments.length > 0) {
245-
setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID, '')); // 2nd arg empty string until typedefs properly allow optional
246-
setTodoDatasource({ source: todoAssignments });
247-
}
170+
setCaseInfoID(thePConn.getValue(CASE_CONSTS.CASE_INFO_ID));
171+
setTodoDatasource({ source: todoAssignments });
248172
setShowTodo(true);
249173
setShowTodoList(false);
250174
}, 100);
@@ -255,11 +179,12 @@ export const FlowContainer = (props: FlowContainerProps) => {
255179
}
256180

257181
// if have caseMessage show message and end
258-
const theCaseMessages = localizedVal(thePConn.getValue('caseMessages', ''), localeCategory); // 2nd arg empty string until typedefs properly allow optional
182+
const theCaseMessages = localizedVal(thePConn.getValue('caseMessages'), localeCategory);
259183

260-
// caseMessages's behavior has changed in 24.2, and hence it doesn't let Optional Action work.
261-
// Changing the below condition for now. Was: (theCaseMessages || !hasAssignments())
262-
if (!hasAssignments()) {
184+
const rootInfo = PCore.getContainerUtils().getContainerItemData(getPConnect().getTarget(), itemKey);
185+
const bConfirmView = rootInfo && bShowBanner;
186+
187+
if (bConfirmView) {
263188
// Temp fix for 8.7 change: confirmationNote no longer coming through in caseMessages$.
264189
// So, if we get here and caseMessages$ is empty, use default value in DX API response
265190
setCaseMessages(theCaseMessages || localizedVal('Thank you! The next step in this case has been routed appropriately.', localeCategory));
@@ -279,8 +204,6 @@ export const FlowContainer = (props: FlowContainerProps) => {
279204
const urgency = getPConnect().getCaseSummary().assignments ? getPConnect().getCaseSummary().assignments?.[0].urgency : '';
280205
const operatorInitials = Utils.getInitials(PCore.getEnvironmentInfo().getOperatorName() || '');
281206

282-
const bShowBanner = showBanner(getPConnect);
283-
284207
const displayPageMessages = () => {
285208
let hasBanner = false;
286209
const messages = pageMessages ? pageMessages.map(msg => localizedVal(msg.message, 'Messages')) : pageMessages;

packages/react-sdk-components/tests/e2e/MediaCo/portal.spec.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ test.describe('E2E test', () => {
2323
await newServiceCase.click();
2424
caseID = await page.locator('#caseId').textContent();
2525

26-
const firstNameInput = page.locator('input[data-test-id="BC910F8BDF70F29374F496F05BE0330C"]');
26+
let firstNameInput = page.locator('input[data-test-id="BC910F8BDF70F29374F496F05BE0330C"]');
2727
await firstNameInput.click();
2828
await firstNameInput.fill('John');
2929

3030
const middleNameInput = page.locator('input[data-test-id="D3691D297D95C48EF1A2B7D6523EF3F0"]');
3131
await middleNameInput.click();
3232
await middleNameInput.fill('');
3333

34-
const lastNameInput = page.locator('input[data-test-id="77587239BF4C54EA493C7033E1DBF636"]');
34+
let lastNameInput = page.locator('input[data-test-id="77587239BF4C54EA493C7033E1DBF636"]');
3535
await lastNameInput.click();
3636
await lastNameInput.fill('Doe');
3737

3838
const suffix = page.locator('div[data-test-id="56E6DDD1CB6CEC596B433440DFB21C17"]');
3939
await suffix.locator('button[title="Open"]').click();
4040
await page.locator('li:has-text("Jr")').click();
4141

42-
const emailInput = page.locator('input[data-test-id="CE8AE9DA5B7CD6C3DF2929543A9AF92D"]');
42+
let emailInput = page.locator('input[data-test-id="CE8AE9DA5B7CD6C3DF2929543A9AF92D"]');
4343
await emailInput.click();
4444
await emailInput.fill('[email protected]');
4545

@@ -52,6 +52,16 @@ test.describe('E2E test', () => {
5252

5353
await page.locator('button:has-text("submit")').click();
5454

55+
const caseSummary = page.locator('div[id="CaseSummary"]');
56+
firstNameInput = caseSummary.locator('input').first();
57+
await expect(firstNameInput).toHaveValue('John');
58+
59+
lastNameInput = caseSummary.locator('input').nth(2);
60+
await expect(lastNameInput).toHaveValue('Doe');
61+
62+
emailInput = caseSummary.locator('input').nth(3);
63+
await expect(emailInput).toHaveValue('[email protected]');
64+
5565
const streetInput = page.locator('input[data-test-id="D61EBDD8A0C0CD57C22455E9F0918C65"]');
5666
await streetInput.click();
5767
await streetInput.fill('Main St');

0 commit comments

Comments
 (0)