- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
In ServiceNow Portal, I try to add all supported files list under the "Copy and past clipboard files here" in an Add Attachment Pop up. Any OOB is there or how can we make it
#portal #widget
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
You can actually see in the DOM (and in the controller that calls the modal) that the modal template comes from the file "sp_attachment_modal.html" and that it actually has a ng-if directive that shows the supported extensions
<script type="text/ng-template" id="sp_attachment_modal.html"><div class="modal-attachment-picker">
<div class="modal-attachment-picker">
<div class="modal-attachment-picker__header">
<h1 class="attachment-header-title modal-attachment-picker__header-title h4" id="attachment-header-title">Add
no viruses</h1><button type="button" class="close pull-right" ng-click="$dismiss()" title="Close modal"
data-toggle="tooltip" data-placement="bottom" aria-label="Close modal" autofocus="autofocus">×</button>
</div>
<div class="attachment-body modal-attachment-picker__body"><sp-attachment-picker
on-file-pick="fileSelectHandler($files)" ng-show="!loadingIndicator"></sp-attachment-picker>
<div class="modal-attachment-picker__progress-info" ng-show="loadingIndicator"><progress
class="modal-attachment-picker__progress"></progress><label>Uploading</label></div>
<div ng-if="supportedExtensions !== ''" ng-show="!loadingIndicator" class="modal-attachment-picker__supported">
<span>Supported:</span><span class="break-all">{{supportedExtensions}}</span></div>
</div>
</div>
</script>
So you can either create an angular ng-template (related list on widgets) with ID sp_attachment_modal.html and do your alterations in the template to override whatever you want in this modal.
Or add an attribute called supported-extensions with a string of your wanted extensions to your spAttachmentButton directive in your widget template
<sp-attachment-button modal="true" supported-extensions="exe, bat, sh"></sp-attachment-button>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
You can actually see in the DOM (and in the controller that calls the modal) that the modal template comes from the file "sp_attachment_modal.html" and that it actually has a ng-if directive that shows the supported extensions
<script type="text/ng-template" id="sp_attachment_modal.html"><div class="modal-attachment-picker">
<div class="modal-attachment-picker">
<div class="modal-attachment-picker__header">
<h1 class="attachment-header-title modal-attachment-picker__header-title h4" id="attachment-header-title">Add
no viruses</h1><button type="button" class="close pull-right" ng-click="$dismiss()" title="Close modal"
data-toggle="tooltip" data-placement="bottom" aria-label="Close modal" autofocus="autofocus">×</button>
</div>
<div class="attachment-body modal-attachment-picker__body"><sp-attachment-picker
on-file-pick="fileSelectHandler($files)" ng-show="!loadingIndicator"></sp-attachment-picker>
<div class="modal-attachment-picker__progress-info" ng-show="loadingIndicator"><progress
class="modal-attachment-picker__progress"></progress><label>Uploading</label></div>
<div ng-if="supportedExtensions !== ''" ng-show="!loadingIndicator" class="modal-attachment-picker__supported">
<span>Supported:</span><span class="break-all">{{supportedExtensions}}</span></div>
</div>
</div>
</script>
So you can either create an angular ng-template (related list on widgets) with ID sp_attachment_modal.html and do your alterations in the template to override whatever you want in this modal.
Or add an attribute called supported-extensions with a string of your wanted extensions to your spAttachmentButton directive in your widget template
<sp-attachment-button modal="true" supported-extensions="exe, bat, sh"></sp-attachment-button>
