Skip to content

Commit e763330

Browse files
authored
Fix/sonar code smells webapp (#583)
* fix: typescript:S6848 * fix: sonar code smells in webapp * chore: changeset * fix: sonar code smells in webapp
1 parent 28221ca commit e763330

File tree

6 files changed

+7
-13
lines changed

6 files changed

+7
-13
lines changed

.changeset/six-dogs-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sap/guided-answers-extension-webapp': patch
3+
---
4+
5+
Fix code smells in webapp

packages/webapp/src/webview/ui/components/FeedbackSection/NotSolvedMessage/NotSolvedMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function NotSolvedMessage(): ReactElement {
3535
isCircularNavigation={true}>
3636
{options.map((btn) => (
3737
<div className="guided-answer__node" key={btn.link}>
38-
<a className="guided-answer__node__edge not-solved-link" href={btn.link} role="button">
38+
<a className="guided-answer__node__edge not-solved-link" href={btn.link}>
3939
{i18next.t(btn.text)}
4040
</a>
4141
</div>

packages/webapp/src/webview/ui/components/GuidedAnswerNavPath/GuidedAnswerNavPath.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export function GuidedAnswerNavPath(): ReactElement {
2828
<nav className="container">
2929
<FocusZone
3030
direction={FocusZoneDirection.vertical}
31-
role="tree"
3231
onFocus={() => {
3332
if (firstTimeFocus) {
3433
focusOnElement('.timeline-content');
@@ -38,7 +37,7 @@ export function GuidedAnswerNavPath(): ReactElement {
3837
isCircularNavigation={true}>
3938
{nodes.map((node, i) => {
4039
return (
41-
<div key={`timeline-block-${node.TITLE}`} className="timeline-block" role="treeitem">
40+
<div key={`timeline-block-${node.TITLE}`} className="timeline-block">
4241
<button
4342
id="timeline-content"
4443
className={`timeline-content ${i === lastIndex ? lastBlockBorderStyle : ''}`}

packages/webapp/test/FeedbackSection/__snapshots__/NotSolvedMessage.test.tsx.snap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ exports[`<NotSolvedMessage/> Should render a NotSolvedMessage component 1`] = `
3939
<a
4040
class="guided-answer__node__edge not-solved-link"
4141
href="https://launchpad.support.sap.com/#/expertchat/create"
42-
role="button"
4342
tabindex="0"
4443
>
4544
Start an Expert Chat
@@ -51,7 +50,6 @@ exports[`<NotSolvedMessage/> Should render a NotSolvedMessage component 1`] = `
5150
<a
5251
class="guided-answer__node__edge not-solved-link"
5352
href="https://launchpad.support.sap.com/#/sae"
54-
role="button"
5553
tabindex="-1"
5654
>
5755
Schedule an Expert
@@ -63,7 +61,6 @@ exports[`<NotSolvedMessage/> Should render a NotSolvedMessage component 1`] = `
6361
<a
6462
class="guided-answer__node__edge not-solved-link"
6563
href="https://launchpad.support.sap.com/#/incident/create"
66-
role="button"
6764
tabindex="-1"
6865
>
6966
Open an Incident
@@ -75,7 +72,6 @@ exports[`<NotSolvedMessage/> Should render a NotSolvedMessage component 1`] = `
7572
<a
7673
class="guided-answer__node__edge not-solved-link"
7774
href="https://answers.sap.com/index.html"
78-
role="button"
7975
tabindex="-1"
8076
>
8177
Ask the SAP Community

packages/webapp/test/GuidedAnswerNode/__snapshots__/Middle.test.tsx.snap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ exports[`<Middle /> Should render a Middle component with NotSolvedMessage 1`] =
173173
<a
174174
class="guided-answer__node__edge not-solved-link"
175175
href="https://launchpad.support.sap.com/#/expertchat/create"
176-
role="button"
177176
tabindex="0"
178177
>
179178
Start an Expert Chat
@@ -185,7 +184,6 @@ exports[`<Middle /> Should render a Middle component with NotSolvedMessage 1`] =
185184
<a
186185
class="guided-answer__node__edge not-solved-link"
187186
href="https://launchpad.support.sap.com/#/sae"
188-
role="button"
189187
tabindex="-1"
190188
>
191189
Schedule an Expert
@@ -197,7 +195,6 @@ exports[`<Middle /> Should render a Middle component with NotSolvedMessage 1`] =
197195
<a
198196
class="guided-answer__node__edge not-solved-link"
199197
href="https://launchpad.support.sap.com/#/incident/create"
200-
role="button"
201198
tabindex="-1"
202199
>
203200
Open an Incident
@@ -209,7 +206,6 @@ exports[`<Middle /> Should render a Middle component with NotSolvedMessage 1`] =
209206
<a
210207
class="guided-answer__node__edge not-solved-link"
211208
href="https://answers.sap.com/index.html"
212-
role="button"
213209
tabindex="-1"
214210
>
215211
Ask the SAP Community

packages/webapp/test/__snapshots__/GuidedAnswerNavPath.test.tsx.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ exports[`<GuidedAnswerNavPath /> Should render a GuidedAnswerNavPath component 1
88
<div
99
class="ms-FocusZone css-101"
1010
data-focuszone-id="FocusZone0"
11-
role="tree"
1211
>
1312
<div
1413
class="timeline-block"
15-
role="treeitem"
1614
>
1715
<button
1816
class="timeline-content timeline-content-bottom-border"

0 commit comments

Comments
 (0)