Skip to content

Commit a0a2193

Browse files
JEAxerotumms2021389vishalshrm5394manasamanasa
authored
Mod/spr/merge main to release8.8.10 (#311)
* update react_pconnect to match dxcomponents (#303) * update react_pconnect to match dxcomponents * Added tests for TextInput, added a couple of tests in the unit test, and updated the structure of the tests folder (#307) * fix: view has no child text (#310) * fix: view has no child text * Added support for two-column and narrow-wide templates in Banner temp… (#306) * Added support for two-column and narrow-wide templates in Banner template Co-authored-by: manasa <[email protected]> --------- Co-authored-by: tumms2021389 <[email protected]> Co-authored-by: Vishal Sharma <[email protected]> Co-authored-by: 4manasa <[email protected]> Co-authored-by: manasa <[email protected]>
1 parent e8f8877 commit a0a2193

File tree

18 files changed

+458
-274
lines changed

18 files changed

+458
-274
lines changed

src/bridge/react_pconnect.jsx

Lines changed: 196 additions & 199 deletions
Large diffs are not rendered by default.

src/components/ToDo/index.tsx

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -222,29 +222,27 @@ export default function ToDo(props) {
222222
)}
223223
<List>
224224
{assignments.map(assignment => (
225-
<>
226-
<div className='psdk-todo-avatar-header'>
227-
<Avatar className={classes.avatar} style={{ marginRight: '16px' }}>
228-
{currentUserInitials}
229-
</Avatar>
230-
<div style={{ display: 'block' }}>
231-
<Typography variant='h6'>{assignment?.name}</Typography>
232-
{`Task in ${renderTaskId(
233-
type,
234-
getPConnect,
235-
showTodoList,
236-
assignment
237-
)} \u2022 Urgency ${getPriority(assignment)}`}
238-
</div>
239-
{!isConfirm && (
240-
<div style={{ marginLeft: 'auto' }}>
241-
<IconButton onClick={() => clickGo(assignment)}>
242-
<ArrowForwardIosOutlinedIcon />
243-
</IconButton>
244-
</div>
245-
)}
225+
<div key={getAssignmentId(assignment)} className='psdk-todo-avatar-header'>
226+
<Avatar className={classes.avatar} style={{ marginRight: '16px' }}>
227+
{currentUserInitials}
228+
</Avatar>
229+
<div style={{ display: 'block' }}>
230+
<Typography variant='h6'>{assignment?.name}</Typography>
231+
{`Task in ${renderTaskId(
232+
type,
233+
getPConnect,
234+
showTodoList,
235+
assignment
236+
)} \u2022 Urgency ${getPriority(assignment)}`}
246237
</div>
247-
</>
238+
{!isConfirm && (
239+
<div style={{ marginLeft: 'auto' }}>
240+
<IconButton onClick={() => clickGo(assignment)}>
241+
<ArrowForwardIosOutlinedIcon />
242+
</IconButton>
243+
</div>
244+
)}
245+
</div>
248246
))}
249247
</List>
250248
</>

src/components/View/index.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const NO_HEADER_TEMPLATES = [
5353
];
5454

5555
export default function View(props) {
56-
const { children, template, getPConnect, mode } = props;
56+
const { children, template, getPConnect, mode, visibility, name: pageName } = props;
5757
let { label, showLabel = false } = props;
5858

5959
// Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
@@ -68,6 +68,13 @@ export default function View(props) {
6868
showLabel = true;
6969
}
7070

71+
const key = `${getPConnect().getContextName()}_${getPConnect().getPageReference()}_${pageName}`;
72+
// As long as the template is defined in the dependencies of the view
73+
// it will be loaded, otherwise fall back to single column
74+
if (visibility === false) {
75+
return '';
76+
}
77+
7178
// As long as the template is defined in the dependencies of the view
7279
// it will be loaded, otherwise fall back to single column
7380
// JA - React SDK not using LazyComponentMap yet
@@ -197,7 +204,7 @@ export default function View(props) {
197204
// console.log(`View rendering template: ${template}`);
198205

199206
// spreading because all props should go to the template
200-
let RenderedTemplate = <ViewTemplate {...props}>{children}</ViewTemplate>;
207+
let RenderedTemplate = <ViewTemplate key={key} {...props}>{children}</ViewTemplate>;
201208

202209
if (FORMTEMPLATES.includes(template) && showLabel) {
203210
// Original:
@@ -236,9 +243,9 @@ export default function View(props) {
236243

237244
if (children) {
238245
return <>{children}</>;
239-
} else {
240-
return <div id='View'>View has no children.</div>;
241246
}
247+
248+
return null;
242249
}
243250

244251
View.defaultProps = {

src/components/designSystemExtensions/Banner/Banner.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@
3333
font-size: 1rem;
3434
font-weight: 400;
3535
}
36+
37+
.banner-layout {
38+
padding: 1rem;
39+
}

src/components/designSystemExtensions/Banner/index.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ import Grid from '@material-ui/core/Grid';
33
import './Banner.css';
44

55
export default function Banner(props) {
6-
const { a, b, banner } = props;
6+
const { a, b, banner, variant} = props;
77
const { title, message, backgroundImage } = banner;
8+
const variantMap = {
9+
'two-column': [6, 6],
10+
'narrow-wide': [4, 8],
11+
'wide-narrow': [8, 4]
12+
};
813
return (
914
<div style={{ marginBottom: '2rem' }}>
1015
<div
@@ -18,16 +23,14 @@ export default function Banner(props) {
1823
</div>
1924
</div>
2025
</div>
21-
<div style={{ padding: '1rem' }}>
22-
<Grid container item xs={12} spacing={1}>
23-
<Grid item xs={8} style={{ padding: '1em' }}>
24-
{a}
25-
</Grid>
26-
<Grid item xs={4} style={{ padding: '1em' }}>
27-
{b}
28-
</Grid>
26+
<Grid container item xs={12} className='banner-layout' spacing={1}>
27+
<Grid item xs={variantMap[variant][0]} style={{ padding: '1em' }}>
28+
{a}
2929
</Grid>
30-
</div>
30+
<Grid item xs={variantMap[variant][1]} style={{ padding: '1em' }}>
31+
{b}
32+
</Grid>
33+
</Grid>
3134
</div>
3235
);
3336
}

src/components/designSystemExtensions/WssQuickCreate/WssQuickCreate.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.quick-link-ul-list {
22
list-style: none;
33
padding: 0;
4-
grid-template-columns: repeat(3, 1fr);
4+
grid-template-columns: repeat(auto-fill, minmax(min(40ch, 100%), 1fr));
55
display: grid;
66
gap: calc(1rem);
77
}
@@ -33,4 +33,8 @@
3333
display: flex;
3434
align-items: center;
3535
gap: 0.5rem;
36-
}
36+
}
37+
38+
.quick-link-heading {
39+
margin-top: 8px;
40+
}

src/components/designSystemExtensions/WssQuickCreate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function WssQuickCreate(props) {
77

88
return (
99
<div>
10-
<h1>{heading}</h1>
10+
<h1 className='quick-link-heading'>{heading}</h1>
1111
<ul className='quick-link-ul-list'>
1212
{actions &&
1313
actions.map(element => {

src/components/templates/FieldGroupTemplate/index.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,17 @@ export default function FieldGroupTemplate(props) {
7979

8080
pConn.setInheritedProp('displayMode', 'LABELS_LEFT');
8181
const memoisedReadOnlyList = useMemo(() => {
82-
return referenceList.map((item, index) => (
83-
<FieldGroup
84-
key={item[heading]}
85-
name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}
86-
>
87-
{buildView(pConn, index, lookForChildInConfig)}
88-
</FieldGroup>
89-
));
82+
return referenceList.map((item, index) => {
83+
const key = item[heading] || `field-group-row-${index}`;
84+
return (
85+
<FieldGroup
86+
key={key}
87+
name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}
88+
>
89+
{buildView(pConn, index, lookForChildInConfig)}
90+
</FieldGroup>
91+
);
92+
});
9093
}, []);
9194

9295
return <div>{memoisedReadOnlyList}</div>;

src/components/templates/WssNavBar/index.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const useStyles = makeStyles(theme => ({
3434

3535
export default function WssNavBar(props) {
3636
const { appInfo, navLinks, operator, navDisplayOptions } = props;
37-
const { alignment } = navDisplayOptions;
37+
const { alignment, position } = navDisplayOptions;
3838
const classes = useStyles();
3939

4040
const [anchorElNav, setAnchorElNav] = useState<null | HTMLElement>(null);
@@ -55,11 +55,24 @@ export default function WssNavBar(props) {
5555
setAnchorElUser(null);
5656
};
5757

58+
const navLinksContent = (
59+
<Box
60+
sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }}
61+
style={{ justifyContent: alignment }}
62+
>
63+
{navLinks.map(link => (
64+
<Button className='link-style' key={link.text} onClick={link.onClick}>
65+
{link.text}
66+
</Button>
67+
))}
68+
</Box>
69+
);
70+
5871
return (
5972
<div id='NavBar' className='nav-bar'>
6073
<AppBar position='static' color='primary'>
6174
<Container maxWidth='xl'>
62-
<Toolbar disableGutters>
75+
<Toolbar disableGutters style={{ justifyContent: 'space-between' }}>
6376
<Button style={{ textTransform: 'capitalize' }} onClick={appInfo.onClick}>
6477
<img src={appInfo.imageSrc} className={classes.appListLogo} />
6578
<span className={classes.appName}>{appInfo.appName}</span>
@@ -98,16 +111,7 @@ export default function WssNavBar(props) {
98111
</Menu>
99112
</Box>
100113

101-
<Box
102-
sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }}
103-
style={{ justifyContent: alignment }}
104-
>
105-
{navLinks.map(link => (
106-
<Button className='link-style' key={link.text} onClick={link.onClick}>
107-
{link.text}
108-
</Button>
109-
))}
110-
</Box>
114+
{position === 'inline' && <>{navLinksContent}</>}
111115

112116
<Box sx={{ flexGrow: 0 }}>
113117
<IconButton onClick={handleOpenUserMenu}>
@@ -134,6 +138,7 @@ export default function WssNavBar(props) {
134138
</Menu>
135139
</Box>
136140
</Toolbar>
141+
{position === 'below' && <>{navLinksContent}</>}
137142
</Container>
138143
</AppBar>
139144
</div>

tests/e2e/Digv2/CaseReference.spec.js renamed to tests/e2e/Digv2/ComplexFields/CaseReference.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/* eslint-disable no-undef */
33

44
const { test, expect } = require('@playwright/test');
5-
const config = require('../../config');
6-
const common = require('../../common');
5+
const config = require('../../../config');
6+
const common = require('../../../common');
77

88
test.beforeEach(async ({ page }) => {
99
await page.goto('http://localhost:3502/portal');

0 commit comments

Comments
 (0)