Hi Ranjithkumar,
your problem is quite similar to this one How to disable Apply dashboard to devices of type option.
There isn’t an out-of-the-box solution to easily remove these elements from the component, as the component is a Cumulocity core component. You would need to override the Cockpit application and hide the elements either by extending the branding/styling or by modifiying them directly in the c8y sdk.
Similar to the other post, I suggest to implement these changes as a patch. The alarms list is still implemented in AngularJS and therefore can be found in @c8y/ng1-modules
package. The files you want to change are .\node_modules\@c8y\ng1-modules\core\ui\views\alarmList.html
and .\node_modules\@c8y\ng1-modules\core\ui\views\auditList.html
.
- Clone cockpit application
- remove following snippet from
.\node_modules\@c8y\ng1-modules\core\ui\views\alarmList.html
<li ng-if="smartRules">
<c8y-if-allowed cfg="smartRulesSvc.permissionsCfgs.create">
<a
title="{{ 'Create smart rule' | translate }}"
href=""
ng-click="createSmartRule(alarm)"
>
<i c8y-icon="cogs"></i> {{ 'Create smart rule' | translate }}
</a>
</c8y-if-allowed>
</li>
- remove following snippet from
.\node_modules\@c8y\ng1-modules\core\ui\views\auditList.html
<span ng-if="audit.user" class="m-r-16">
<span class="text-label-small">
{{ 'By`user`' | translate }}
</span>
{{ audit.user }}
</span>
- Test your cloned Cockpit application locally to see whether the changes have been applied
- install patch-package by running:
npm install patch-package --save-dev
- Create patch by running
npx patch-package @c8y/ng1-modules
- Add
patch-package
ot postinstall script in thepackage.json
:"postinstall": "patch-package && ngcc"
Best regards
Christian