Skip to content

Commit

Permalink
[#877] apply formatting and linting to data-explorer module
Browse files Browse the repository at this point in the history
  • Loading branch information
bossenti committed Jan 20, 2023
1 parent db127e9 commit 1d3cd42
Show file tree
Hide file tree
Showing 131 changed files with 7,502 additions and 5,445 deletions.
1 change: 0 additions & 1 deletion ui/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cypress/fixtures/**/*.csv
src/app/core-ui
src/app/CustomMaterial
src/app/dashboard
src/app/data-explorer
src/app/editor
src/app/files
src/app/info
Expand Down
1 change: 0 additions & 1 deletion ui/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cypress/fixtures/**/*.csv
src/app/core-ui
src/app/CustomMaterial
src/app/dashboard
src/app/data-explorer
src/app/editor
src/app/files
src/app/info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
<div fxFlex="100" fxLayout="row">
<mat-form-field color="accent" fxFlex="100">
<mat-label>Widget Title</mat-label>
<input matInput
[(ngModel)]="baseAppearanceConfig.widgetTitle"/>
<input
matInput
[(ngModel)]="baseAppearanceConfig.widgetTitle"
/>
</mat-form-field>
</div>
</div>
Expand All @@ -33,27 +35,32 @@
<div fxFlex="100" fxLayout="row">
<mat-form-field color="accent" fxFlex="100">
<mat-label>Background Color</mat-label>
<input matInput
[(colorPicker)]="baseAppearanceConfig.backgroundColor"
[cpPosition]="'bottom'"
[style.background]="baseAppearanceConfig.backgroundColor" required
[cpPresetColors]="presetColors"
(colorPickerSelect)="triggerViewUpdate()"
autocomplete="off"/>
<input
matInput
[(colorPicker)]="baseAppearanceConfig.backgroundColor"
[cpPosition]="'bottom'"
[style.background]="baseAppearanceConfig.backgroundColor"
required
[cpPresetColors]="presetColors"
(colorPickerSelect)="triggerViewUpdate()"
autocomplete="off"
/>
</mat-form-field>
</div>

<div fxFlex="100" fxLayout="row">
<mat-form-field color="accent" fxFlex="100">
<mat-label>Text Color</mat-label>
<input matInput
[(colorPicker)]="baseAppearanceConfig.textColor"
[cpPosition]="'bottom'"
[style.background]="baseAppearanceConfig.textColor"
required
[cpPresetColors]="presetColors"
(colorPickerSelect)="triggerViewUpdate()"
autocomplete="off"/>
<input
matInput
[(colorPicker)]="baseAppearanceConfig.textColor"
[cpPosition]="'bottom'"
[style.background]="baseAppearanceConfig.textColor"
required
[cpPresetColors]="presetColors"
(colorPickerSelect)="triggerViewUpdate()"
autocomplete="off"
/>
</mat-form-field>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,42 @@ import { WidgetBaseAppearanceConfig } from '../../../models/dataview-dashboard.m
import { WidgetConfigurationService } from '../../../services/widget-configuration.service';

@Component({
selector: 'sp-data-explorer-widget-appearance-settings',
templateUrl: './data-explorer-widget-appearance-settings.component.html',
styleUrls: ['./data-explorer-widget-appearance-settings.component.scss'],
selector: 'sp-data-explorer-widget-appearance-settings',
templateUrl: './data-explorer-widget-appearance-settings.component.html',
styleUrls: ['./data-explorer-widget-appearance-settings.component.scss'],
})
export class DataExplorerWidgetAppearanceSettingsComponent implements OnInit {

@Input() baseAppearanceConfig: WidgetBaseAppearanceConfig;
@Input() widgetId: string;

presetColors: string[] = ['#39B54A', '#1B1464', '#f44336', '#4CAF50', '#FFEB3B', '#FFFFFF', '#000000'];


constructor(private widgetConfigurationService: WidgetConfigurationService) {

}

ngOnInit(): void {
if (!this.baseAppearanceConfig.backgroundColor) {
this.baseAppearanceConfig.backgroundColor = '#FFFFFF';
}
if (!this.baseAppearanceConfig.textColor) {
this.baseAppearanceConfig.textColor = '#3e3e3e';
@Input() baseAppearanceConfig: WidgetBaseAppearanceConfig;
@Input() widgetId: string;

presetColors: string[] = [
'#39B54A',
'#1B1464',
'#f44336',
'#4CAF50',
'#FFEB3B',
'#FFFFFF',
'#000000',
];

constructor(
private widgetConfigurationService: WidgetConfigurationService,
) {}

ngOnInit(): void {
if (!this.baseAppearanceConfig.backgroundColor) {
this.baseAppearanceConfig.backgroundColor = '#FFFFFF';
}
if (!this.baseAppearanceConfig.textColor) {
this.baseAppearanceConfig.textColor = '#3e3e3e';
}
}
}

triggerViewUpdate() {
this.widgetConfigurationService.notify({widgetId: this.widgetId, refreshView: true, refreshData: false });
}


triggerViewUpdate() {
this.widgetConfigurationService.notify({
widgetId: this.widgetId,
refreshView: true,
refreshData: false,
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,67 +17,131 @@
-->

<div fxFlex="100" fxLayout="column">
<div fxFlex="100" fxLayout="column" class="designer-panel-content" *ngIf="currentlyConfiguredWidget">
<div
fxFlex="100"
fxLayout="column"
class="designer-panel-content"
*ngIf="currentlyConfiguredWidget"
>
<div fxLayout="row" class="sp-tab-bg designer-panel-header">
<div fxLayoutAlign="start center" class="designer-panel-title"><h4>{{ currentlyConfiguredWidget.baseAppearanceConfig.widgetTitle }}</h4></div>
<div fxLayoutAlign="start center" class="designer-panel-title">
<h4>
{{
currentlyConfiguredWidget.baseAppearanceConfig
.widgetTitle
}}
</h4>
</div>
<div fxFlex fxLayoutAlign="end end">
<button mat-button mat-icon-button
matTooltip="Close Widget Configuration"
(click)="closeDesignerPanel()">
<button
mat-button
mat-icon-button
matTooltip="Close Widget Configuration"
(click)="closeDesignerPanel()"
>
<mat-icon>close</mat-icon>
</button>
</div>
</div>
<mat-tab-group [selectedIndex]="selectedIndex" (selectedIndexChange)="selectOptionsPanel($event)" color="accent"
class="small">
<mat-tab data-cy="designer-panel-data-config" label="Data"></mat-tab>
<mat-tab data-cy="designer-panel-visualization-config" label="Visualization" [disabled]="!currentlyConfiguredWidget.dataConfig.sourceConfigs || currentlyConfiguredWidget.dataConfig.sourceConfigs.length === 0"></mat-tab>
<mat-tab data-cy="designer-panel-appearance-config" label="Appearance"></mat-tab>
<mat-tab-group
[selectedIndex]="selectedIndex"
(selectedIndexChange)="selectOptionsPanel($event)"
color="accent"
class="small"
>
<mat-tab
data-cy="designer-panel-data-config"
label="Data"
></mat-tab>
<mat-tab
data-cy="designer-panel-visualization-config"
label="Visualization"
[disabled]="
!currentlyConfiguredWidget.dataConfig.sourceConfigs ||
currentlyConfiguredWidget.dataConfig.sourceConfigs
.length === 0
"
></mat-tab>
<mat-tab
data-cy="designer-panel-appearance-config"
label="Appearance"
></mat-tab>
</mat-tab-group>

<div fxFlex="100" fxLayout="column">
<div fxFlex fxLayout="column" class="designer-panel-config">

<div *ngIf="selectedIndex == 0">
<sp-data-explorer-widget-data-settings #dataSettingsPanel
[(dataLakeMeasure)]="dataLakeMeasure"
[dataConfig]="currentlyConfiguredWidget.dataConfig"
[newWidgetMode]="newWidgetMode"
[widgetId]="currentlyConfiguredWidget._id"
(createWidgetEmitter)="createNewWidget()">
<div *ngIf="selectedIndex === 0">
<sp-data-explorer-widget-data-settings
#dataSettingsPanel
[(dataLakeMeasure)]="dataLakeMeasure"
[dataConfig]="currentlyConfiguredWidget.dataConfig"
[newWidgetMode]="newWidgetMode"
[widgetId]="currentlyConfiguredWidget._id"
(createWidgetEmitter)="createNewWidget()"
>
</sp-data-explorer-widget-data-settings>
</div>

<div *ngIf="selectedIndex == 1" class="p-5">
<sp-explorer-visualisation-settings [currentlyConfiguredWidget]="currentlyConfiguredWidget">
<div *ngIf="selectedIndex === 1" class="p-5">
<sp-explorer-visualisation-settings
[currentlyConfiguredWidget]="currentlyConfiguredWidget"
>
</sp-explorer-visualisation-settings>
</div>

<div *ngIf="selectedIndex == 2" class="p-5">
<div *ngIf="selectedIndex === 2" class="p-5">
<sp-data-explorer-widget-appearance-settings
[widgetId]="currentlyConfiguredWidget._id"
[baseAppearanceConfig]="currentlyConfiguredWidget.baseAppearanceConfig">
[widgetId]="currentlyConfiguredWidget._id"
[baseAppearanceConfig]="
currentlyConfiguredWidget.baseAppearanceConfig
"
>
</sp-data-explorer-widget-appearance-settings>
</div>
</div>
<mat-divider *ngIf="newWidgetMode"></mat-divider>
<div fxLayout="row" fxLayoutAlign="center end" class="mt-10 actions-align-right p-15"
*ngIf="newWidgetMode">
<button mat-button mat-raised-button color="accent"
data-cy="data-explorer-select-data-set-next-btn"
[disabled]="selectedIndex === 0 && (!(currentlyConfiguredWidget.dataConfig.sourceConfigs) || currentlyConfiguredWidget.dataConfig.sourceConfigs.length === 0 || currentlyConfiguredWidget.dataConfig.sourceConfigs[0].measureName === '')"
*ngIf="newWidgetMode && selectedIndex == 0"
(click)="selectedIndex = 1">
<div
fxLayout="row"
fxLayoutAlign="center end"
class="mt-10 actions-align-right p-15"
*ngIf="newWidgetMode"
>
<button
mat-button
mat-raised-button
color="accent"
data-cy="data-explorer-select-data-set-next-btn"
[disabled]="
selectedIndex === 0 &&
(!currentlyConfiguredWidget.dataConfig.sourceConfigs ||
currentlyConfiguredWidget.dataConfig.sourceConfigs
.length === 0 ||
currentlyConfiguredWidget.dataConfig
.sourceConfigs[0].measureName === '')
"
*ngIf="newWidgetMode && selectedIndex === 0"
(click)="selectedIndex = 1"
>
Next
</button>
<button *ngIf="newWidgetMode && selectedIndex == 1" mat-button mat-raised-button class="mat-basic mr-10"
(click)="selectedIndex = 0" style="margin-right: 10px;">
<button
*ngIf="newWidgetMode && selectedIndex === 1"
mat-button
mat-raised-button
class="mat-basic mr-10"
(click)="selectedIndex = 0"
style="margin-right: 10px"
>
Back
</button>
<button mat-button mat-raised-button color="accent"
data-cy="data-explorer-select-data-set-create-btn"
*ngIf="newWidgetMode && selectedIndex == 1"
(click)="createNewWidget()">
<button
mat-button
mat-raised-button
color="accent"
data-cy="data-explorer-select-data-set-create-btn"
*ngIf="newWidgetMode && selectedIndex === 1"
(click)="createNewWidget()"
>
Create
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
@import '../../../../scss/sp/sp-dialog.scss';

.designer-panel-content {
padding: 0;
overflow-y: auto;
padding: 0;
overflow-y: auto;
}

.designer-panel-config {
padding: 0;
padding: 0;
}

.designer-panel-title {
margin-left: 20px;
margin-left: 20px;
}

.designer-panel-header {
border-bottom:1px solid var(--color-tab-border);
border-bottom: 1px solid var(--color-tab-border);
}
Loading

0 comments on commit 1d3cd42

Please sign in to comment.