diff --git a/src/app/webapp-common/common-styles.scss b/src/app/webapp-common/common-styles.scss index 0beaef88..2c46a64f 100644 --- a/src/app/webapp-common/common-styles.scss +++ b/src/app/webapp-common/common-styles.scss @@ -823,7 +823,7 @@ button.btn.button-outline-dark { grid-template-columns: repeat(auto-fit, 352px); grid-gap: 24px; padding: 0 24px 24px; - justify-content: center; + justify-content: space-between; .load-more { display: flex; diff --git a/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.html b/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.html new file mode 100644 index 00000000..6efc757b --- /dev/null +++ b/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.html @@ -0,0 +1,51 @@ + + +
+ + + + + + + + + + + + + + + diff --git a/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.scss b/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.scss new file mode 100644 index 00000000..d7e78f71 --- /dev/null +++ b/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.scss @@ -0,0 +1,5 @@ +.right-buttons{ + display: flex; + flex-grow: 1; + justify-content: end; +} \ No newline at end of file diff --git a/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.ts b/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.ts new file mode 100644 index 00000000..3e4f41a6 --- /dev/null +++ b/src/app/webapp-common/pipelines/edit-pipeline-header/edit-pipeline-header.component.ts @@ -0,0 +1,66 @@ +import {Component, EventEmitter, Input, OnInit, Output, TemplateRef} from '@angular/core'; +import {MetricVariantResult} from '~/business-logic/model/projects/metricVariantResult'; +import {ISmCol} from '@common/shared/ui-components/data/table/table.consts'; +import {FilterMetadata} from 'primeng/api/filtermetadata'; +import {BaseEntityHeaderComponent} from '@common/shared/entity-page/base-entity-header/base-entity-header.component'; +import {SelectionEvent} from '@common/experiments/dumb/select-metric-for-custom-col/select-metric-for-custom-col.component'; +import {Option} from '@common/shared/ui-components/inputs/button-toggle/button-toggle.component'; +import {trackByValue} from '@common/shared/utils/forms-track-by'; +import {resourceToIconMap} from '~/features/experiments/experiments.consts'; +import {EntityTypeEnum} from '~/shared/constants/non-common-consts'; + + + +@Component({ + selector: 'sm-edit-pipeline-header', + templateUrl: './edit-pipeline-header.component.html', + styleUrls: ['./edit-pipeline-header.component.scss'] +}) +export class EditPipelineHeaderComponent extends BaseEntityHeaderComponent implements OnInit{ + private _tableCols: any; + toggleButtons: Option[]; + @Input() isArchived: boolean; + @Input() metricVariants: Array; + @Input() hyperParams: any[]; + @Input() minimizedView: boolean; + @Input() isMetricsLoading: boolean; + @Input() tableFilters: { [s: string]: FilterMetadata }; + @Input() sharedView: boolean; + @Input() showNavbarLinks: boolean; + @Input() tableMode: 'table' | 'info' | 'compare'; + @Input() compareView: 'scalars' | 'plots'; + @Input() showCompareScalarSettings: boolean; + @Input() rippleEffect: boolean; + @Input() addButtonTemplate: TemplateRef; + + @Input() set tableCols(tableCols) { + this._tableCols = tableCols?.filter(col => col.header !== ''); + } + + get tableCols() { + return this._tableCols; + } + + @Output() isArchivedChanged = new EventEmitter(); + @Output() selectedTableColsChanged = new EventEmitter(); + @Output() removeColFromList = new EventEmitter(); + @Output() getMetricsToDisplay = new EventEmitter(); + @Output() selectedMetricToShow = new EventEmitter(); + @Output() selectedHyperParamToShow = new EventEmitter<{param: string; addCol: boolean}>(); + @Output() setAutoRefresh = new EventEmitter(); + @Output() toggleShowCompareSettings = new EventEmitter(); + @Output() compareViewChanged = new EventEmitter<'scalars' | 'plots'>(); + @Output() clearSelection = new EventEmitter(); + @Output() clearTableFilters = new EventEmitter<{ [s: string]: FilterMetadata }>(); + @Output() tableModeChanged = new EventEmitter<'table' | 'info' | 'compare'>(); + protected readonly resourceToIconMap = resourceToIconMap; + protected readonly trackByValue = trackByValue; + + ngOnInit(): void { + this.toggleButtons = [ + {label: 'Table view', value: 'table', icon: 'al-ico-table-view'}, + {label: 'Details view', value: 'info', icon: 'al-ico-experiment-view'}, + ...(this.entityType === EntityTypeEnum.experiment ? [{label: 'Compare view', value: 'compare', icon: 'al-ico-charts-view'}] : []) + ]; + } +} diff --git a/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.html b/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.html new file mode 100644 index 00000000..f9bcb8ae --- /dev/null +++ b/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.html @@ -0,0 +1,9 @@ +
+ + +
+
Details
+
image
+
+
\ No newline at end of file diff --git a/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.scss b/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.ts b/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.ts new file mode 100644 index 00000000..9c76c441 --- /dev/null +++ b/src/app/webapp-common/pipelines/edit-pipeline/edit-pipeline.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'sm-edit-pipeline', + templateUrl: './edit-pipeline.component.html', + styleUrls: ['./edit-pipeline.component.scss'] +}) +export class EditPipelineComponent { + +} diff --git a/src/app/webapp-common/pipelines/pipelines-page/pipelines-page.component.html b/src/app/webapp-common/pipelines/pipelines-page/pipelines-page.component.html index fa730693..44f38376 100644 --- a/src/app/webapp-common/pipelines/pipelines-page/pipelines-page.component.html +++ b/src/app/webapp-common/pipelines/pipelines-page/pipelines-page.component.html @@ -1,5 +1,6 @@ +
+[class.in-empty-state]="!(((projectsList$ | async)?.length !== 0 && (!allExamples || (showExamples$ | async))) || searching)"> ({ @NgModule({ - declarations: [ - PipelinesPageComponent, - ], - imports: [ - CommonModule, - CommonProjectsModule, - ProjectsSharedModule, - PipelinesRouterModule, - StoreModule.forFeature('projects', projectsReducer, PIPELINES_CONFIG_TOKEN), - PipelineCardComponent, - ButtonToggleComponent, - ], - exports: [PipelinesPageComponent], - providers: [ - {provide: PIPELINES_CONFIG_TOKEN, useFactory: getPipelineConfig}, - ] + declarations: [ + PipelinesPageComponent, + EditPipelineComponent, + EditPipelineHeaderComponent, + ], + exports: [PipelinesPageComponent, EditPipelineComponent], + providers: [ + { provide: PIPELINES_CONFIG_TOKEN, useFactory: getPipelineConfig }, + { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { floatLabel: 'always' } }, + ], + imports: [ + CommonModule, + CommonProjectsModule, + ProjectsSharedModule, + PipelinesRouterModule, + StoreModule.forFeature('projects', projectsReducer, PIPELINES_CONFIG_TOKEN), + PipelineCardComponent, + ButtonToggleComponent, + ClearFiltersButtonComponent, + MenuComponent, + MenuItemComponent, + ExperimentSharedModule, + RefreshButtonComponent, + LabeledFormFieldDirective + ] }) export class PipelinesModule { } diff --git a/src/app/webapp-common/pipelines/pipelines.route.ts b/src/app/webapp-common/pipelines/pipelines.route.ts index a67014c9..6acdb3bc 100644 --- a/src/app/webapp-common/pipelines/pipelines.route.ts +++ b/src/app/webapp-common/pipelines/pipelines.route.ts @@ -2,16 +2,23 @@ import {FeaturesEnum} from '~/business-logic/model/users/featuresEnum'; import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {PipelinesPageComponent} from '@common/pipelines/pipelines-page/pipelines-page.component'; +import { EditPipelineComponent} from '@common/pipelines/edit-pipeline/edit-pipeline.component'; import {CrumbTypeEnum} from '@common/layout/breadcrumbs/breadcrumbs.component'; -const routes = [{ - path: '', - component: PipelinesPageComponent, - data: {search: true, features: FeaturesEnum.Pipelines, staticBreadcrumb:[[{ - name: 'PIPELINES', - type: CrumbTypeEnum.Feature - }]]}, -}] as Routes; +const routes = [ { + path: '', + component: PipelinesPageComponent, + data: { + search: true, + features: FeaturesEnum.Pipelines, + staticBreadcrumb: [[{ + name: 'PIPELINES', + type: CrumbTypeEnum.Feature + }]] + }, + + + },{ path: ':id/edit', component: EditPipelineComponent }] as Routes; @NgModule({ imports: [