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

enterprise fixes #1270

Merged
merged 5 commits into from
Dec 27, 2024
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 @@ -115,7 +115,7 @@
bind:cachedValue={formDataCache['ref_id']}
/>
<AutocompleteSelect
{form}
{form}
options={getOptions({ objects: model.foreignKeys['reference_entity'] })}
field="reference_entity"
cacheLock={cacheLocks['reference_entity']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
export let initialData: Record<string, any> = {};
</script>


<AutocompleteSelect
{form}
options={getOptions({ objects: model.foreignKeys['parent_folder'] })}
Expand Down
287 changes: 287 additions & 0 deletions enterprise/frontend/src/lib/components/SideBar/navData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
export const navData = {
items: [
{
name: 'overview',
items: [
{
name: 'analytics',
fa_icon: 'fa-solid fa-gauge',
href: '/analytics',
permissions: [
'view_project',
'view_riskscenario',
'view_referencecontrol',
'view_assessment',
'view_riskassessment'
]
},
{
name: 'myAssignments',
fa_icon: 'fa-solid fa-list-check',
href: '/my-assignments',
permissions: [
'view_project',
'view_riskscenario',
'view_referencecontrol',
'view_assessment',
'view_riskassessment'
]
}
]
},
{
name: 'insights',
items: [
{
name: 'impactAnalysis',
fa_icon: 'fa-solid fa-hexagon-nodes',
href: '/insights/impact-analysis',
permissions: [
'view_project',
'view_riskscenario',
'view_referencecontrol',
'view_assessment',
'view_riskassessment'
]
},
{
name: 'priorityReview',
fa_icon: 'fa-solid fa-ranking-star',
href: '/insights/priority-review',
permissions: [
'view_project',
'view_riskscenario',
'view_referencecontrol',
'view_assessment',
'view_riskassessment'
]
},
{
name: 'timelineView',
fa_icon: 'fa-solid fa-table-columns',
href: '/insights/timeline-view',
permissions: [
'view_project',
'view_riskscenario',
'view_referencecontrol',
'view_assessment',
'view_riskassessment'
]
}
]
},
{
name: 'organization',
items: [
{
name: 'domains',
fa_icon: 'fa-solid fa-sitemap',
href: '/folders',
exclude: ['BI-RL-TPR']
},
{
name: 'projects',
fa_icon: 'fa-solid fa-cubes',
href: '/projects'
},
{
name: 'users',
fa_icon: 'fa-solid fa-user',
href: '/users'
},
{
name: 'userGroups',
fa_icon: 'fa-solid fa-users',
href: '/user-groups'
},
{
name: 'roleAssignments',
fa_icon: 'fa-solid fa-user-tag',
href: '/role-assignments'
},
{
name: 'assets',
fa_icon: 'fa-solid fa-gem',
href: '/assets'
}
]
},
{
name: 'catalog',
items: [
{
name: 'frameworks',
fa_icon: 'fa-solid fa-book',
href: '/frameworks'
},
{
name: 'threats',
fa_icon: 'fa-solid fa-biohazard',
href: '/threats'
},
{
name: 'referenceControls',
fa_icon: 'fa-solid fa-gears',
href: '/reference-controls'
},
{
name: 'requirementMappingSets',
fa_icon: 'fa-solid fa-diagram-project',
href: '/requirement-mapping-sets'
},
{
name: 'riskMatrices',
fa_icon: 'fa-solid fa-table-cells-large',
href: '/risk-matrices'
}
]
},
{
name: 'operations',
items: [
{
name: 'appliedControls',
fa_icon: 'fa-solid fa-fire-extinguisher',
href: '/applied-controls'
},
{
name: 'calendar',
fa_icon: 'fa-solid fa-calendar-days',
href: '/calendar',
permissions: ['view_appliedcontrol', 'view_riskacceptance', 'view_riskassessment']
},
{
name: 'xRays',
fa_icon: 'fa-solid fa-bolt',
href: '/x-rays',
permissions: ['view_riskassessment', 'view_assessment']
}
]
},
{
name: 'governance',
items: [
{
name: 'libraries',
fa_icon: 'fa-solid fa-folder-plus',
href: '/libraries',
permissions: ['add_threat', 'add_riskmatrix', 'add_referencecontrol', 'add_framework']
},
{
name: 'policies',
fa_icon: 'fa-solid fa-book',
href: '/policies',
permissions: ['view_appliedcontrol']
},
{
name: 'riskAcceptances',
fa_icon: 'fa-solid fa-signature',
href: '/risk-acceptances'
}
]
},
{
name: 'risk',
items: [
{
name: 'riskAssessments',
fa_icon: 'fa-solid fa-magnifying-glass-chart',
href: '/risk-assessments'
},
{
name: 'ebiosRM',
fa_icon: 'fa-solid fa-gopuram',
href: '/ebios-rm'
},
{
name: 'riskScenarios',
fa_icon: 'fa-solid fa-clone',
href: '/risk-scenarios'
},
{
name: 'scoringAssistant',
fa_icon: 'fa-solid fa-star-half-stroke',
href: '/scoring-assistant',
permissions: ['view_riskmatrix']
},
{
name: 'vulnerabilities',
// What is the best icon between "fa-triangle-exclamation" and "fa-skull-crossbones" for a vulnerability ?
fa_icon: 'fa-solid fa-triangle-exclamation',
href: '/vulnerabilities'
}
]
},

{
name: 'compliance',
items: [
{
name: 'complianceAssessments',
fa_icon: 'fa-solid fa-certificate',
href: '/compliance-assessments'
},
{
name: 'evidences',
fa_icon: 'fa-solid fa-receipt',
href: '/evidences'
}
]
},

{
name: 'thirdPartyCategory',
items: [
{
name: 'entities',
fa_icon: 'fa-solid fa-building',
href: '/entities'
},
{
name: 'entityAssessments',
fa_icon: 'fa-solid fa-clipboard-list',
href: '/entity-assessments'
},
{
name: 'representatives',
fa_icon: 'fa-solid fa-user-tie',
href: '/representatives'
},
{
name: 'solutions',
fa_icon: 'fa-solid fa-box',
href: '/solutions'
}
]
},
{
name: 'extra',
items: [
{
name: 'labels',
fa_icon: 'fa-solid fa-tag',
href: '/filtering-labels',
permissions: ['view_filteringlabel']
},
{
name: 'settings',
fa_icon: 'fa-solid fa-cog',
href: '/settings',
permissions: ['change_globalsettings']
},
{
name: 'backupRestore',
fa_icon: 'fa-solid fa-floppy-disk',
href: '/backup-restore',
permissions: ['backup']
},
{
name: 'Experimental',
fa_icon: 'fa-solid fa-flask',
href: '/experimental',
permissions: ['change_globalsettings']
}
]
}
]
};
2 changes: 1 addition & 1 deletion enterprise/frontend/src/lib/utils/client-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const ClientSettingsSchema = z.object({
name: z.string().optional().nullable().default(''),
logo: z.any().optional().nullable(),
favicon: z.any().optional().nullable(),
show_images_unauthenticated: z.boolean().default(true),
show_images_unauthenticated: z.boolean().default(true)
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import PriorityRadarChart from '$lib/components/Chart/PriorityRadarChart.svelte';
</script>

{@debug data}
<div class="bg-white shadow flex overflow-x-auto">
<div class="w-full h-screen">
<PriorityRadarChart title="" name="c_priority" data={data.data} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const load: PageServerLoad = async ({ fetch }) => {
});

const URLModel = 'client-settings';
const attachmentDeleteSchema = z.object({ urlmodel: z.string(), id: z.string().uuid() });
const attachmentDeleteSchema = z.object({
urlmodel: z.string(),
id: z.string().uuid()
});
const attachmentDeleteForm = await superValidate(
{
urlmodel: URLModel,
Expand All @@ -36,7 +39,7 @@ export const load: PageServerLoad = async ({ fetch }) => {
zod(attachmentDeleteSchema)
);

return { settings, form, model, attachmentDeleteForm};
return { settings, form, model, attachmentDeleteForm };
};

export const actions: Actions = {
Expand Down Expand Up @@ -110,14 +113,12 @@ export const actions: Actions = {
}
}


return setFlash(
{
type: 'success',
message: m.successfullyUpdatedClientSettings()
},
event

);
},

Expand All @@ -129,8 +130,8 @@ export const actions: Actions = {
const endpoint = `${BASE_API_URL}/client-settings/${form.data.id}/logo/delete/`;

await event.fetch(endpoint, { method: 'PUT' });
return { success: true , form };
},
return { success: true, form };
},

deleteFavicon: async (event) => {
const formData = await event.request.formData();
Expand All @@ -140,8 +141,6 @@ export const actions: Actions = {
const endpoint = `${BASE_API_URL}/client-settings/${form.data.id}/favicon/delete/`;

await event.fetch(endpoint, { method: 'PUT' });
return { success: true , form };
}


return { success: true, form };
}
};
Loading
Loading