<!--

    Copyright © 2016-2020 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<tb-grid grid-configuration="vm.dashboardGridConfig">
	<details-buttons tb-help="'dashboards'" help-container-id="help-container">
		<div id="help-container"></div>
	</details-buttons>
	<md-tabs ng-class="{'tb-headless': vm.grid.detailsConfig.isDetailsEditMode}"
			 id="tabs" md-border-bottom flex class="tb-absolute-fill">
		<md-tab label="{{ 'dashboard.details' | translate }}">
			<tb-dashboard-details dashboard="vm.grid.operatingItem()"
								  is-edit="vm.grid.detailsConfig.isDetailsEditMode"
								  dashboard-scope="vm.dashboardsScope"
								  customer-id="vm.customerId"
								  the-form="vm.grid.detailsForm"
								  on-make-public="vm.makePublic(event, vm.grid.detailsConfig.currentItem)"
								  on-make-private="vm.makePrivate(event, vm.grid.detailsConfig.currentItem)"
								  on-manage-assigned-customers="vm.manageAssignedCustomers(event, vm.grid.detailsConfig.currentItem)"
								  on-unassign-from-customer="vm.unassignFromCustomer(event, vm.grid.detailsConfig.currentItem, vm.customerId)"
								  on-export-dashboard="vm.exportDashboard(event, vm.grid.detailsConfig.currentItem)"
								  on-delete-dashboard="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)"></tb-dashboard-details>
		</md-tab>
		<md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.grid.isTenantAdmin()" md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
			<tb-audit-log-table flex entity-type="vm.types.entityType.dashboard"
								entity-id="vm.grid.operatingItem().id.id"
								audit-log-mode="{{vm.types.auditLogMode.entity}}">
			</tb-audit-log-table>
		</md-tab>
	</md-tabs>
</tb-grid>
