Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Remove 'Add' button from WSD Search Widget Schedule View

hardikpanch_433
ServiceNow Employee
ServiceNow Employee

Hello All,

There is a widget 'WSD Search' which has 2 views 'Card view' and 'Schedule View'.

So from 'Schedule View', I want to remove the 'Add' buttons as shown below.

hardikpanch_433_0-1714474736188.png

But the problem is that I cannot find the exact configuration from where this buttons can be removed.

HTML:

	<!-- ELSE: schedule view -->
			<div ng-class="{'col-md-9': c.showReservableFilter && c.activeView.type === 'schedule'}" ng-if="!c.searching && c.wasSearched">
				<div class="schedule-view" ng-if="c.activeView.type === 'schedule' && c.mappedReservables.length > 0">
					<wsd-schedule-view
            			primary-building-tz="c.prBuildingTz"
            			secondary-building-tz="c.secBuildingTz"
						start="c.scheduleViewStart"
						end="c.scheduleViewEnd"
						reservables="c.mappedReservables"
						disable-reserve-single="c.isMultiItemSelection"
						disable-reserve-multi="(c.isOccurrence || c.isRecurring) && c.isAnyItemSelected"
						reserve-reservable="c.reserveReservable(sys_id)"
						toggle-reservable-selection="c.toggleReservableSelection(item, event)"
						total-steps="c.scheduleViewTotalStep"
						sort-by="c.sortBy"
						display-rsv-card="true"
						aria-controls="itemsInfo"
						is-favorites-enabled="c.data.isFavoritesEnabled"
            schedule-view-date="c.scheduleViewDate">
					</wsd-schedule-view>
				</div>
			</div>
    

The widget is calling the provider 'wsdScheduleView' which in then calling the ui Macro 'sn_wsd_rsv_wsd-schedule-view'.

 

Provider - wsdScheduleView:

templateUrl: getTemplateUrl('sn_wsd_rsv_wsd-schedule-view') 

UI Macro :

<div class="schedule-details">
	<div id="{{item.sys_id}}" class="schedule-row row--item" 
		ng-class="{'is-reserved': item.is_reserved, 'is-selected': item.is_selected, 'unavailable': !item.is_available}" 
		ng-repeat="item in reservables track by item.sys_id">
		<div class="schedule-col col-left-pad col-xs-3" ng-if="displayRsvCard">
			<div class="item-info col-xs-12 col-sm-12 col-lg-12">
				<div class="pull-right" ng-if="isFavoritesEnabled">
					<sp-widget widget="item.favoriteWidget"></sp-widget>
				</div>
				<div class="reservable-title text-muted text-overflow-ellipsis" ng-attr-title="{{::item.name}}">
					<span ng-if="item.require_approval" class="highlighted-label">
						<i class="fa fa-lock" aria-label="{{scheduleViewLabels.requireApproval}}" ng-attr-title="{{scheduleViewLabels.requireApproval}}"></i>
					</span>
					{{::item.name}}
				</div>
				<div class="subtitle text-overflow-ellipsis" ng-attr-title="{{::item.subtitle}}">{{::item.subtitle}}</div>
				<div class="reservable-details">
					<div class="col-xs-12 col-md-4 text-muted p-l-0" ng-repeat="item in item.body" ng-class="'reservable-details-' + item.field">
						<i class="reservable-icon fa" data-toggle="tooltip" ng-class="::item.icon" aria-label="{{::item.label}}" title="{{::item.iconLabel}}"></i>
						<span class="reservable-value" data-toggle="tooltip" data-container=".wsd-search" data-placement="top" title="{{::item.iconTooltipText}}">
							{{item.iconTooltipText ? '+' + item.amount : item.displayValue}}
						</span>
					</div>
				</div>
			</div>
		</div>
        <div ng-if="!displayRsvCard" class="col-xs-1"></div>
		<div class="schedule-col col-middle" ng-class="displayRsvCard? 'col-xs-8' : 'col-xs-10'"
			aria-label="{{::item.availability_label}}">
			<div class="drawing-canvas gantt">
				<div class="reserved"
					ng-style="{left: reservation.gantt.left, width: reservation.gantt.width}"
					ng-repeat="reservation in item.reservations track by reservation.sys_id"
					aria-label="{{::reservation.title}}"
					ng-attr-title="{{::reservation.title}}">
				</div>
			</div>
		</div>
		<div class="schedule-col col-right text-center col-xs-1" ng-if="!displayRsvCard" > abcd
			<div class="reservable-action" ng-class="displayRsvCard? 'col-xs-8' : 'col-xs-10'">
				<button class="btn btn-default btn-add btn-reserve form-control text-overflow-ellipsis" ng-show="displayRsvCard"
					ng-class="{'btn-remove': item.is_selected, 'btn-reserved': reservable.is_reserved, 'btn-selected': reservable.is_selected}"
					ng-disabled="!item.is_available || (disableReserveMulti &amp;&amp; !item.is_selected)"
					aria-label="{{item.is_selected ? item.deselect_label : item.select_label}}"
					ng-attr-title="{{item.is_selected ? scheduleViewLabels.remove : scheduleViewLabels.add}}"
					ng-click="toggleReservableSelection({item: item, event: $event})">
					<label class="btn-label-reserve">{{item.is_selected ? scheduleViewLabels.remove : scheduleViewLabels.add}}</label>
					<i ng-class="!item.is_selected? 'fa fa-shopping-cart btn-icon-reserve' : 'fa fa-trash btn-icon-reserve'"></i>
				</button>
			</div>
		</div>
	</div>
</div>

 

Tried many things like applying ng-if = "false" in the ui macro for the button, but it is not working.

Please help.

Thanks in Advance.

0 REPLIES 0