Skip to content

Commit d726d7c

Browse files
committed
PR comments addressed
1 parent 6895a97 commit d726d7c

File tree

11 files changed

+40
-59
lines changed

11 files changed

+40
-59
lines changed

assets/css/sdkCssVars.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CSS Variables used in SDK components
1+
/* CSS Variables used in SDK components */
22
:root {
33

44
/* svg filter colors that match above, go here to generate https://codepen.io/sosuke/pen/Pjoqqp */

packages/react-sdk-components/src/common.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,11 @@
7979
.tox .tox-dialog {
8080
background-color: var(--modal-top-color) !important;
8181
color: var(--app-text-color) !important;
82-
/* border-radius: 8px !important; */
83-
/* box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5) !important; */
8482
border: 1px solid var(--modal-border-color) !important;
85-
/* border-radius: 10px; */
8683
padding: 20px !important;
8784
box-shadow: 0 0 10px 3px var(--modal-box-shadow-color) !important;
8885
}
8986

90-
/* .tox-dialog__body input{
91-
92-
} */
93-
9487
.tox .tox-dialog__header {
9588
background-color: var(--modal-top-color) !important;
9689
color: var(--app-text-color) !important;

packages/react-sdk-components/src/components/infra/MultiStep/MultiStep.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
.psdk-current-svg-icon {
1919
width: 1rem;
20-
/* filter: var(--app-primary-color-filter); */
2120
filter: var(--svg-color);
2221
}
2322

packages/react-sdk-components/src/components/template/AppShell/AppShell.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ interface AppShellProps extends PConnProps {
2828
pageMessages: string[];
2929
}
3030

31-
const useStyles = makeStyles((theme) => ({
32-
root: {
33-
// backgroundColor: theme.backgroundColor
34-
},
31+
const useStyles = makeStyles(theme => ({
32+
root: {},
3533
content: {
3634
flexGrow: 1,
3735
height: '100vh',
@@ -153,8 +151,8 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
153151
else {
154152
PCore.getAssetLoader()
155153
.getSvcImage(portalLogo)
156-
.then((blob) => window.URL.createObjectURL(blob))
157-
.then((data) => {
154+
.then(blob => window.URL.createObjectURL(blob))
155+
.then(data => {
158156
setIconURL(data);
159157
setFullIconURL(data);
160158
})
@@ -169,8 +167,8 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
169167
if (imageKey && portalTemplate === 'wss') {
170168
PCore.getAssetLoader()
171169
.getSvcImage(imageKey)
172-
.then((blob) => window.URL.createObjectURL(blob))
173-
.then((imagePath) => setImageBlobUrl(imagePath));
170+
.then(blob => window.URL.createObjectURL(blob))
171+
.then(imagePath => setImageBlobUrl(imagePath));
174172
}
175173
}, []);
176174

@@ -192,7 +190,7 @@ export default function AppShell(props: PropsWithChildren<AppShellProps>) {
192190

193191
const links = !pages
194192
? []
195-
: pages.map((page) => {
193+
: pages.map(page => {
196194
const name = localizedVal(page.pyLabel, '', localeReference);
197195
return {
198196
text: name,

packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const useStyles = makeStyles((/* theme */) => ({
7474
fontSize: '14px'
7575
},
7676
header: {
77-
background: 'var(--table-header-background'
77+
background: 'var(--table-header-background)'
7878
},
7979
tableCell: {
8080
borderRight: '1px solid lightgray',

packages/react-sdk-components/src/components/template/WssNavBar/WssNavBar.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface WssNavBarProps extends PConnProps {
2525
appName: any;
2626
}
2727

28-
const useStyles = makeStyles((theme) => ({
28+
const useStyles = makeStyles(theme => ({
2929
root: {
3030
display: 'flex'
3131
},
@@ -40,7 +40,6 @@ const useStyles = makeStyles((theme) => ({
4040
filter: 'var(--svg-color)'
4141
},
4242
appName: {
43-
// color: 'var(--app-text-color)',
4443
marginLeft: theme.spacing(2),
4544
marginRight: theme.spacing(4),
4645
fontSize: '1.5rem'
@@ -75,7 +74,7 @@ export default function WssNavBar(props: WssNavBarProps) {
7574

7675
const navLinksContent = (
7776
<Box id='nav-links' sx={{ flexGrow: 1, display: { xs: 'none', md: 'flex' } }} style={{ justifyContent: alignment }}>
78-
{navLinks.map((link) => (
77+
{navLinks.map(link => (
7978
<Button className='link-style' key={link.text} onClick={link.onClick}>
8079
{link.text}
8180
</Button>
@@ -118,7 +117,7 @@ export default function WssNavBar(props: WssNavBarProps) {
118117
open={Boolean(anchorElNav)}
119118
onClose={handleCloseNavMenu}
120119
>
121-
{navLinks.map((link) => (
120+
{navLinks.map(link => (
122121
<MenuItem key={link.text} onClick={link.onClick}>
123122
<Typography>{link.text}</Typography>
124123
</MenuItem>

packages/react-sdk-components/src/components/widget/FileUtility/FileUtility/FileUtility.tsx

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default function FileUtility(props: FileUtilityProps) {
8484
const [vaItems, setFullAttachments] = useState([]);
8585

8686
function addAttachments(attsFromResp: any[] = []) {
87-
attsFromResp = attsFromResp.map((respAtt) => {
87+
attsFromResp = attsFromResp.map(respAtt => {
8888
const updatedAtt = {
8989
...respAtt,
9090
meta: `${respAtt.category} . ${Utils.generateDateTime(respAtt.createTime, 'DateTime-Since')}, ${respAtt.createdBy}`
@@ -219,7 +219,7 @@ export default function FileUtility(props: FileUtilityProps) {
219219
attPromise.then((resp: any) => {
220220
const arFullListAttachments = addAttachments(resp);
221221
const attachmentsCount = arFullListAttachments.length;
222-
const arItems: any = arFullListAttachments.slice(0, 3).map((att) => {
222+
const arItems: any = arFullListAttachments.slice(0, 3).map(att => {
223223
return getListUtilityItemProps({
224224
att,
225225
downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
@@ -228,7 +228,7 @@ export default function FileUtility(props: FileUtilityProps) {
228228
removeFile: null
229229
});
230230
});
231-
const viewAllarItems: any = arFullListAttachments.map((att) => {
231+
const viewAllarItems: any = arFullListAttachments.map(att => {
232232
return getListUtilityItemProps({
233233
att,
234234
downloadFile: !att.progress ? () => downloadAttachedFile(att) : null,
@@ -238,7 +238,7 @@ export default function FileUtility(props: FileUtilityProps) {
238238
});
239239
});
240240
setProgress(false);
241-
setList((current) => {
241+
setList(current => {
242242
return { ...current, count: attachmentsCount, data: arItems };
243243
});
244244
setFullAttachments(viewAllarItems);
@@ -299,12 +299,12 @@ export default function FileUtility(props: FileUtilityProps) {
299299
removeFile: null
300300
});
301301
});
302-
setFileData((current) => {
302+
setFileData(current => {
303303
return { ...current, fileList: arFileList$, attachedFiles: myFiles };
304304
});
305305
}
306306

307-
const handleClick = (event) => {
307+
const handleClick = event => {
308308
setAnchorEl(event.currentTarget);
309309
};
310310

@@ -313,7 +313,7 @@ export default function FileUtility(props: FileUtilityProps) {
313313
};
314314

315315
function onAddFilesClick() {
316-
setFileData((current) => {
316+
setFileData(current => {
317317
return { ...current, showfileModal: true };
318318
});
319319
setAnchorEl(null);
@@ -323,16 +323,16 @@ export default function FileUtility(props: FileUtilityProps) {
323323
let attachedFiles: any = fileData.attachedFiles;
324324
let fileList: any = fileData.fileList;
325325
if (item !== null) {
326-
attachedFiles = attachedFiles.filter((ele) => ele.ID !== item.id);
327-
fileList = fileList.filter((ele) => ele.id !== item.id);
328-
setFileData((current) => {
326+
attachedFiles = attachedFiles.filter(ele => ele.ID !== item.id);
327+
fileList = fileList.filter(ele => ele.id !== item.id);
328+
setFileData(current => {
329329
return { ...current, fileList, attachedFiles };
330330
});
331331
}
332332
}
333333

334334
function closeFilePopup() {
335-
setFileData((current) => {
335+
setFileData(current => {
336336
return { ...current, showfileModal: false };
337337
});
338338
}
@@ -348,19 +348,19 @@ export default function FileUtility(props: FileUtilityProps) {
348348
}
349349

350350
Promise.allSettled(
351-
fileData.attachedFiles.map((file) => attachmentUtils.uploadAttachment(file, onUploadProgress, errorHandler, thePConn.getContextName()))
351+
fileData.attachedFiles.map(file => attachmentUtils.uploadAttachment(file, onUploadProgress, errorHandler, thePConn.getContextName()))
352352
)
353353
.then((fileResponses: any) => {
354354
const uploadedFiles: any = [];
355-
fileResponses.forEach((fileResponse) => {
355+
fileResponses.forEach(fileResponse => {
356356
if (fileResponse.status === 'fulfilled') {
357357
uploadedFiles.push(fileResponse.value);
358358
}
359359
});
360360
if (uploadedFiles.length > 0) {
361361
(attachmentUtils.linkAttachmentsToCase(caseID, uploadedFiles, 'File', thePConn.getContextName()) as Promise<any>)
362362
.then(() => {
363-
setFileData((current) => {
363+
setFileData(current => {
364364
return { ...current, fileList: [], attachedFiles: [] };
365365
});
366366
getAttachments();
@@ -372,21 +372,21 @@ export default function FileUtility(props: FileUtilityProps) {
372372
}
373373

374374
function onAddLinksClick() {
375-
setLinkData((current) => {
375+
setLinkData(current => {
376376
return { ...current, showLinkModal: true };
377377
});
378378
setAnchorEl(null);
379379
}
380380

381381
function closeAddLinksPopup() {
382-
setLinkData((current) => {
382+
setLinkData(current => {
383383
return { ...current, showLinkModal: false };
384384
});
385385
}
386386

387-
const fieldlinkOnChange = (event) => {
387+
const fieldlinkOnChange = event => {
388388
const title = event.target.value;
389-
setLink((current) => {
389+
setLink(current => {
390390
const updatedData = { ...current, title };
391391
updatedData.disable = !(updatedData.title && updatedData.url);
392392
return updatedData;
@@ -395,7 +395,7 @@ export default function FileUtility(props: FileUtilityProps) {
395395

396396
function fieldurlOnChange(event) {
397397
const url = event.target.value;
398-
setLink((current) => {
398+
setLink(current => {
399399
const updatedData = { ...current, url };
400400
updatedData.disable = !(updatedData.title && updatedData.url);
401401
return updatedData;
@@ -439,7 +439,7 @@ export default function FileUtility(props: FileUtilityProps) {
439439
attachedLink.url = url;
440440

441441
attachedListTemp.push(attachedLink);
442-
setLinkData((current) => {
442+
setLinkData(current => {
443443
return {
444444
...current,
445445
linksList: localList,
@@ -454,9 +454,9 @@ export default function FileUtility(props: FileUtilityProps) {
454454
let attachedLinks: any = linkData.attachedLinks;
455455
let linksList: any = linkData.linksList;
456456
if (item !== null) {
457-
attachedLinks = attachedLinks.filter((ele) => ele.id !== item.id);
458-
linksList = linksList.filter((ele) => ele.id !== item.id);
459-
setLinkData((current) => {
457+
attachedLinks = attachedLinks.filter(ele => ele.id !== item.id);
458+
linksList = linksList.filter(ele => ele.id !== item.id);
459+
setLinkData(current => {
460460
return { ...current, linksList, attachedLinks };
461461
});
462462
}
@@ -478,7 +478,7 @@ export default function FileUtility(props: FileUtilityProps) {
478478
setProgress(true);
479479
(attachmentUtils.linkAttachmentsToCase(caseID, linksToAttach, 'URL', thePConn.getContextName()) as Promise<any>)
480480
.then(() => {
481-
setLinkData((current) => {
481+
setLinkData(current => {
482482
return { ...current, linksList: [], attachedLinks: [] };
483483
});
484484
getAttachments();
@@ -495,10 +495,7 @@ export default function FileUtility(props: FileUtilityProps) {
495495
</div>
496496
)}
497497
<div className='psdk-header'>
498-
{/* <IconButton> */}
499498
<img className='psdk-file-utility-card-svg-icon' src={headerSvgIcon$} />
500-
{/* <AttachmentIcon /> */}
501-
{/* </IconButton> */}
502499
<div className='header-text'>{header}</div>
503500
<div className='psdk-utility-count' id='attachments-count'>
504501
{list.count}

packages/react-sdk-components/src/components/widget/SummaryItem/SummaryItem.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
display: inline-block;
6565
vertical-align: middle;
6666
filter: var(--svg-color);
67-
/* filter: invert(28%) sepia(20%) saturate(3903%) hue-rotate(209deg) brightness(101%) contrast(87%); */
6867
}
6968

7069
.psdk-utility-link-button {

packages/react-sdk-components/src/samples/Embedded/Header/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const useStyles = makeStyles(theme => ({
1212
},
1313
embedTopIcon: {
1414
width: '40px',
15-
// filter: 'invert(100%)'
1615
filter: 'var(--svg-color)'
1716
}
1817
}));

packages/react-sdk-components/src/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { createTheme } from '@mui/material';
33
import { Theme } from '@mui/material/styles';
44

5-
const sdkConfig = require('../../../sdk-config.json');
5+
import { getSdkConfig } from '@pega/auth/lib/sdk-auth-manager';
66

77
/**
88
* Since makeStyles is now exported from @mui/styles package which does not know about Theme in the core package.
@@ -258,4 +258,4 @@ const darkTheme = createTheme({
258258
});
259259

260260
// eslint-disable-next-line import/prefer-default-export
261-
export const theme = sdkConfig.sdkConfig.theme === 'dark' ? darkTheme : lightTheme;
261+
export const theme = getSdkConfig().theme === 'dark' ? darkTheme : lightTheme;

0 commit comments

Comments
 (0)