Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend] fix file name in fintel template export form (#8336) #9807

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,6 @@ const StixCoreObjectFileExportForm = ({
[defaultTemplate] = templates ?? [];
}
const defaultFileToExport = fileOptions?.find((f) => f.value === defaultValues?.fileToExport);
let defaultExportFileName = null;
if (defaultTemplate) defaultExportFileName = defaultTemplate.label;
if (defaultFileToExport) {
defaultExportFileName = defaultFileToExport.value === 'mappableContent' && scoName
? scoName
: defaultFileToExport.label.split('.')[0];
}
if (defaultTemplate || defaultFileToExport) {
defaultExportFileName = `${defaultExportFileName}_${now()}`;
}
let defaultFormat = '';
if (defaultValues?.format) {
defaultFormat = defaultValues.format;
Expand All @@ -164,7 +154,7 @@ const StixCoreObjectFileExportForm = ({
type: null,
template: defaultTemplate ?? null,
fileToExport: defaultFileToExport ?? null,
exportFileName: defaultExportFileName,
exportFileName: null,
contentMaxMarkings: [],
fileMarkings: defaultFileToExport?.fileMarkings.map(({ id, name }) => ({ label: name, value: id })) ?? [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const FintelTemplatePopover = ({
const onHandleCloseDelete = (e: UIEvent) => {
stopEvent(e);
handleCloseDelete();
setAnchorEl(null);
setAnchorEl(undefined);
};

const update = (e: UIEvent) => {
Expand All @@ -84,6 +84,7 @@ const FintelTemplatePopover = ({

const onExport = async (e: UIEvent) => {
stopEvent(e);
setAnchorEl(undefined);
await exportFintel(templateId);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ const executiveSummaryContent = (containerType: string) => {
<ul>
<li>The timeline of the incident/risk </li>
<li>The attribution of the incident/risk: pick the main threats from this list.</li>
<div>$threats</div>
<li>The main victims of the incident/risk: pick the main form the list.</li>
<div>$victims</div>
</ul>
</blockquote>
<div>$threats</div>
<div>$victims</div>

<div class="page-break" style="page-break-after:always;">
<span style="display:none;">&nbsp;</span>
Expand Down