<Suggestions
suggestions="security_hotspots"
/>
- <HelmetWrapper
+ <Helmet
defer={true}
encodeSpecialCharacters={true}
title="hotspots.page"
<Suggestions
suggestions="security_hotspots"
/>
- <HelmetWrapper
+ <Helmet
defer={true}
encodeSpecialCharacters={true}
title="hotspots.page"
<Suggestions
suggestions="security_hotspots"
/>
- <HelmetWrapper
+ <Helmet
defer={true}
encodeSpecialCharacters={true}
title="hotspots.page"
<Suggestions
suggestions="security_hotspots"
/>
- <HelmetWrapper
+ <Helmet
defer={true}
encodeSpecialCharacters={true}
title="hotspots.page"
import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
import { PopupPlacement } from 'sonar-ui-common/components/ui/popups';
import { translate } from 'sonar-ui-common/helpers/l10n';
-import { Hotspot, HotspotUpdateFields } from '../../../types/security-hotspots';
+import { Hotspot } from '../../../types/security-hotspots';
import HotspotActionsForm from './HotspotActionsForm';
export interface HotspotActionsProps {
hotspot: Hotspot;
- onSubmit: (hotspot: HotspotUpdateFields) => void;
+ onSubmit: () => void;
}
const ESCAPE_KEY = 'Escape';
<DropdownOverlay placement={PopupPlacement.BottomRight}>
<HotspotActionsForm
hotspot={hotspot}
- onSubmit={data => {
+ onSubmit={() => {
setOpen(false);
- props.onSubmit(data);
+ props.onSubmit();
}}
/>
</DropdownOverlay>
Hotspot,
HotspotResolution,
HotspotStatus,
- HotspotStatusOption,
- HotspotUpdateFields
+ HotspotStatusOption
} from '../../../types/security-hotspots';
import HotspotActionsFormRenderer from './HotspotActionsFormRenderer';
interface Props {
hotspot: Hotspot;
- onSubmit: (data: HotspotUpdateFields) => void;
+ onSubmit: () => void;
}
interface State {
.then(() => this.updateAssignee(hotspot, selectedOption, selectedUser))
.then(() => this.addComment(hotspot, comment))
.then(() => {
- this.props.onSubmit({ status, resolution });
+ this.props.onSubmit();
// No need to set "submitting", we are closing the window
})
.catch(() => {
import * as React from 'react';
import { getSecurityHotspotDetails } from '../../../api/security-hotspots';
import { BranchLike } from '../../../types/branch-like';
-import { Hotspot, HotspotUpdate, HotspotUpdateFields } from '../../../types/security-hotspots';
+import { Hotspot, HotspotUpdate } from '../../../types/security-hotspots';
import HotspotViewerRenderer from './HotspotViewerRenderer';
interface Props {
fetchHotspot() {
this.setState({ loading: true });
return getSecurityHotspotDetails(this.props.hotspotKey)
- .then(hotspot => this.mounted && this.setState({ hotspot, loading: false }))
+ .then(hotspot => {
+ if (this.mounted) {
+ this.setState({ hotspot, loading: false });
+ }
+ return hotspot;
+ })
.catch(() => this.mounted && this.setState({ loading: false }));
}
- handleHotspotUpdate = (data?: HotspotUpdateFields) => {
- if (data) {
- this.props.onUpdateHotspot({ key: this.props.hotspotKey, ...data });
- }
-
- this.fetchHotspot();
+ handleHotspotUpdate = () => {
+ return this.fetchHotspot().then((hotspot?: Hotspot) => {
+ if (hotspot) {
+ this.props.onUpdateHotspot({
+ key: hotspot.key,
+ status: hotspot.status,
+ resolution: hotspot.resolution
+ });
+ }
+ });
};
render() {
import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
import { isLoggedIn } from '../../../helpers/users';
import { BranchLike } from '../../../types/branch-like';
-import { Hotspot, HotspotUpdateFields } from '../../../types/security-hotspots';
+import { Hotspot } from '../../../types/security-hotspots';
import HotspotActions from './HotspotActions';
import HotspotSnippetContainer from './HotspotSnippetContainer';
import HotspotViewerTabs from './HotspotViewerTabs';
currentUser: T.CurrentUser;
hotspot?: Hotspot;
loading: boolean;
- onUpdateHotspot: (data?: HotspotUpdateFields) => void;
+ onUpdateHotspot: () => void;
securityCategories: T.StandardSecurityCategories;
}