| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one or more |
| ~ contributor license agreements. See the NOTICE file distributed with |
| ~ this work for additional information regarding copyright ownership. |
| ~ The ASF licenses this file to You 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. |
| ~ |
| --> |
| |
| @if (dataViewLoaded) { |
| <sp-basic-view [backLinkTarget]="['chart']" [showBackLink]="true"> |
| <div |
| nav |
| fxFlex="100" |
| fxLayoutAlign="start center" |
| fxLayout="row" |
| class="pl-10" |
| > |
| <sp-chart-view-toolbar |
| [timeSettings]="timeSettings" |
| [editMode]="editMode" |
| [createMode]="createMode" |
| [configuredWidget]="dataView" |
| [hasDataExplorerWritePrivileges]=" |
| hasDataExplorerWritePrivileges |
| " |
| (downloadFileEmitter)="downloadDataAsFile()" |
| (updateDateRangeEmitter)="updateDateRange($event)" |
| (saveDataViewEmitter)="saveDataView()" |
| (discardDataViewEmitter)="discardChanges()" |
| (addToAssetEmitter)="addAssetDialog()" |
| (manageChartEmitter)="manageChart()" |
| (deleteChartEmitter)="deleteChart()" |
| fxFlex="100" |
| > |
| </sp-chart-view-toolbar> |
| </div> |
| <div fxFlex="100" fxLayout="column"> |
| @if (chartNotFound) { |
| <div class="text-xl" fxFlex="100" fxLayoutAlign="center center"> |
| {{ 'The desired chart was not found!' | translate }} |
| </div> |
| } @else { |
| @if (legacyMultiSourceChart) { |
| <div class="p-10"> |
| <sp-alert-banner |
| type="warning" |
| icon="warning" |
| [title]="'Legacy multi-source chart' | translate" |
| [description]=" |
| 'This chart uses multiple data sources and cannot be edited in this release. Please migrate it manually before making changes.' |
| | translate |
| " |
| > |
| </sp-alert-banner> |
| </div> |
| } |
| @if (showRequiresAttentionWarning) { |
| <div |
| class="p-10" |
| data-cy="chart-requires-attention-warning" |
| > |
| <sp-alert-banner |
| type="warning" |
| icon="warning" |
| [title]="'Chart requires attention' | translate" |
| [description]="requiresAttentionDescription" |
| ></sp-alert-banner> |
| </div> |
| } |
| <mat-drawer-container |
| fxFlex="100" |
| fxLayout="column" |
| class="h-100" |
| style="width: 100%; min-height: 0" |
| > |
| <mat-drawer |
| [opened]="editMode" |
| [style.width.px]="drawerWidth" |
| mode="side" |
| position="end" |
| class="designer-panel" |
| > |
| <sp-sidebar-resize |
| [minWidth]="450" |
| [maxWidth]="1000" |
| (widthChanged)="onWidthChanged($event)" |
| > |
| <div fxLayout="column" fxFlex="100"> |
| <sp-chart-designer-panel |
| [currentlyConfiguredWidget]="dataView" |
| [dataLakeMeasure]="dataLakeMeasure" |
| (addWidgetEmitter)="onAddWidget($event)" |
| fxFlex="100" |
| > |
| </sp-chart-designer-panel> |
| </div> |
| </sp-sidebar-resize> |
| </mat-drawer> |
| <mat-drawer-content |
| class="h-100" |
| fxFlex |
| fxLayout="column" |
| style="min-height: 0" |
| > |
| <div |
| fxFlex |
| fxLayout="column" |
| style="min-height: 0; overflow: hidden" |
| > |
| <div |
| #panel |
| fxLayout="column" |
| fxFlex |
| style="min-height: 0; overflow: hidden" |
| > |
| @if ( |
| dataView && |
| dataView.dataConfig?.sourceConfigs?.length > |
| 0 |
| ) { |
| <sp-chart-container |
| fxFlex |
| style="display: block; min-height: 0" |
| [dataViewMode]="true" |
| [editMode]="editMode" |
| [configuredWidget]="dataView" |
| [timeSettings]="timeSettings" |
| [observableGenerator]=" |
| observableGenerator |
| " |
| [dataLakeMeasure]=" |
| dataView.dataConfig.sourceConfigs[0] |
| .measure |
| " |
| (startEditModeEmitter)="editDataView()" |
| (queryResultsEmitter)=" |
| onQueryResultsChanged($event) |
| " |
| > |
| </sp-chart-container> |
| } |
| </div> |
| |
| <sp-chart-data-preview |
| [queryResults]="latestQueryResults" |
| (sizeChanged)="onDataPreviewSizeChanged()" |
| > |
| </sp-chart-data-preview> |
| </div> |
| </mat-drawer-content> |
| </mat-drawer-container> |
| } |
| </div> |
| </sp-basic-view> |
| } |