Hi,
- How do I remove the Create Smart Rule option from the alarm action menu?
- How do I remove the source option from the alarm I created and updated in the change log page?
Please help me with the solutions. ASAP
Hi,
Please help me with the solutions. ASAP
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
.
.\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>
.\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>
npm install patch-package --save-dev
npx patch-package @c8y/ng1-modules
patch-package
ot postinstall script in the package.json
: "postinstall": "patch-package && ngcc"
Best regards
Christian
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.