How to Hide or Remove a Group for Doctype links at Dashboard for any doctype

I could remove doctype links by putting the following custom script at the onload function of doctype.

$(“[data-doctype=‘Sales Invoice’]”).hide();

I need assistance with how to remove the group as all doctype links for that group was removed so Group is not required, see below pictures where I want to remove/hide Purchase, Material and Sales too.

I achieved it by overriding override_doctype_dashboards !

and it can be achieved