Skip to content

Commit 001af73

Browse files
authored
Merge pull request #1267 from O-sura/devportal-scope-fix
Display Full Scope Names in DevPortal
2 parents 7807ac0 + 63132e3 commit 001af73

File tree

1 file changed

+26
-11
lines changed
  • portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/ApiConsole

1 file changed

+26
-11
lines changed

portals/devportal/src/main/webapp/source/src/app/components/Apis/Details/ApiConsole/CustomPadLock.jsx

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const StyledTableCell = styled(TableCell)(() => ({
3232
paddingLeft: '0',
3333
paddingTop: '0',
3434
textAlign: 'left',
35+
verticalAlign: 'top',
3536
}));
3637

3738
const StyledScopeCell = styled(TableCell)(() => ({
@@ -40,8 +41,15 @@ const StyledScopeCell = styled(TableCell)(() => ({
4041
textAlign: 'left',
4142
borderBottom: 'none',
4243
overflow: 'hidden',
43-
textOverflow: 'ellipsis',
44-
whiteSpace: 'nowrap',
44+
wordBreak: 'break-word',
45+
whiteSpace: 'normal',
46+
}));
47+
48+
const ScrollContainer = styled('div')(() => ({
49+
maxHeight: '150px',
50+
overflowY: 'scroll',
51+
display: 'block',
52+
width: '100%',
4553
}));
4654

4755
/**
@@ -136,16 +144,23 @@ function CustomPadLock(props) {
136144
defaultMessage='Scopes'
137145
/>
138146
</StyledTableCell>
139-
<StyledTableCell style={{ maxWidth: 100, paddingRight: 0 }}>
147+
<StyledTableCell style={{ maxWidth: 250, paddingRight: 0 }}>
140148
{scopes.length > 0 && (
141-
scopes.map((scope, index) => (
142-
// eslint-disable-next-line react/no-array-index-key
143-
<TableRow key={index}>
144-
<StyledScopeCell style={{ maxWidth: 100 }}>
145-
{scope}
146-
</StyledScopeCell>
147-
</TableRow>
148-
))
149+
<ScrollContainer
150+
style={scopes.length <= 5 ? { overflowY: 'visible', maxHeight: 'none' } : {}}
151+
>
152+
<Table>
153+
<TableBody>
154+
{scopes.map((scope) => (
155+
<TableRow key={scope}>
156+
<StyledScopeCell style={{ maxWidth: 240 }}>
157+
{scope}
158+
</StyledScopeCell>
159+
</TableRow>
160+
))}
161+
</TableBody>
162+
</Table>
163+
</ScrollContainer>
149164
)}
150165
</StyledTableCell>
151166
</TableRow>

0 commit comments

Comments
 (0)