Browse Source

SONAR-16248 Fix Quality Profile selection issue

tags/9.5.0.56709
Philippe Perrin 2 years ago
parent
commit
5c723a0914

+ 5
- 3
server/sonar-web/src/main/js/apps/projectQualityProfiles/components/SetQualityProfileModal.tsx View File

@@ -110,9 +110,11 @@ export default function SetQualityProfileModal(props: SetQualityProfileModalProp
className="display-flex-start"
checked={!hasSelectedSysDefault}
disabled={submitting}
onCheck={() =>
setSelected(!hasSelectedSysDefault ? selected : currentProfile.key)
}
onCheck={value => {
if (hasSelectedSysDefault) {
setSelected(value);
}
}}
value={currentProfile.key}>
<div className="spacer-left">
<div className="little-spacer-bottom">

+ 5
- 1
server/sonar-web/src/main/js/apps/projectQualityProfiles/components/__tests__/SetQualityProfileModal-test.tsx View File

@@ -49,8 +49,12 @@ it('should correctly handle changes', () => {
.at(1)
.props()
.onCheck('');
diveIntoSimpleModal(wrapper)
.find(Select)
.props()
.onChange({ value: 'bar' });
submitSimpleModal(wrapper);
expect(onSubmit).toHaveBeenLastCalledWith('foo', 'foo');
expect(onSubmit).toHaveBeenLastCalledWith('bar', 'foo');

const change = diveIntoSimpleModal(wrapper)
.find(Select)

Loading…
Cancel
Save