Skip to content

Commit

Permalink
[PROPOSED_SETUP] Generate chart data
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem_Oktysiuk committed Feb 2, 2022
1 parent fea980f commit b56d65f
Show file tree
Hide file tree
Showing 17 changed files with 684 additions and 17,929 deletions.
17,941 changes: 271 additions & 17,670 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions projects/steam-generation-assessment-lib/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { ModuleWithProviders, NgModule } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { CommonModule } from "@angular/common";
import { BlockUIModule } from "ng-block-ui";
import { ProjectsJobsModule, SizingSharedLibModule } from "sizing-shared-lib";
import { ModuleWithProviders, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { BlockUIModule } from 'ng-block-ui';
import { ProjectsJobsModule, SizingSharedLibModule } from 'sizing-shared-lib';
import { SteamGenerationAssessmentComponent } from './steam-generation-assessment.component';
import { SharedModule } from "./modules/shared/shared.module";
import { SharedModule } from './modules/shared/shared.module';
import { TabsModule } from 'ngx-bootstrap/tabs';
import { SgaInputParametersComponent } from './sga-input-parameters/sga-input-parameters.component';
import { SgaBenchmarkComponent } from './sga-benchmark/sga-benchmark.component';
import { SgaProposedSetupComponent } from './sga-proposed-setup/sga-proposed-setup.component';
import { SgaFinalProposalComponent } from './sga-final-proposal/sga-final-proposal.component';
import { SteamGenerationAssessmentService } from "./steam-generation-assessment.service";
import { SteamGenerationAssessmentService } from './steam-generation-assessment.service';
import { TypeOfFuelComponent } from './components/type-of-fuel/type-of-fuel.component';

const providers = [SteamGenerationAssessmentService];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
margin-bottom: 30px;
&.disabled {
opacity: .3;
cursor: not-allowed;
}

&-label {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { NgControl } from '@angular/forms';
import { Directive, Input } from '@angular/core';

@Directive({
selector: '[disableControl]'
})
export class DisableControlDirective {

@Input() set disableControl(condition: boolean) {
const action = condition ? 'disable' : 'enable';

if (this.ngControl && this.ngControl.control) {
const control = this.ngControl.control;
control[action]();

if (action === 'disable' && control.value) {
control.patchValue(typeof control.value === 'boolean' ? false : 0);
}
}
}

constructor(private ngControl: NgControl) {}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { CollapseModule } from "ngx-bootstrap/collapse";
import { SsButtonComponent } from './components/ss-button/ss-button.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CollapseModule } from 'ngx-bootstrap/collapse';
import { SgaPanelComponent } from './components/sga-panel/sga-panel.component';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { ChartBarComponent } from './components/chart-bar/chart-bar.component';
import { ChartsModule } from "ng2-charts";
import { ChartsModule } from 'ng2-charts';
import { BoilerSchemeComponent } from './components/boiler-scheme/boiler-scheme.component';
import { FormInputComponent } from "./components/form-input/form-input.component";
import { SizingSharedLibModule } from "sizing-shared-lib";
import { FormInputComponent } from './components/form-input/form-input.component';
import { SizingSharedLibModule } from 'sizing-shared-lib';
import { FormListComponent } from './components/form-list/form-list.component';
import { FormToggleComponent } from './components/form-toggle/form-toggle.component';
import { FormRadioComponent } from './components/form-radio/form-radio.component';
import { SetUnitsDirective } from './directives/set-units.directive';
import { InputLimitToDirective } from "./directives/limit-length.directive";
import { InputLimitToDirective } from './directives/limit-length.directive';
import { FormModalComponent } from './components/form-modal/form-modal.component';
import { OnlyNumberDirective } from "./directives/only-number.directive";
import { NoCommaPipe } from "./pipes/no-comma.pipe";
import { OnlyNumberDirective } from './directives/only-number.directive';
import { NoCommaPipe } from './pipes/no-comma.pipe';
import { DisableControlDirective } from './directives/disable-control.directive';


@NgModule({
declarations: [
SsButtonComponent,
SgaPanelComponent,
ChartBarComponent,
BoilerSchemeComponent,
Expand All @@ -34,7 +33,8 @@ import { NoCommaPipe } from "./pipes/no-comma.pipe";
InputLimitToDirective,
FormModalComponent,
OnlyNumberDirective,
NoCommaPipe
NoCommaPipe,
DisableControlDirective
],
imports: [
CommonModule,
Expand All @@ -45,19 +45,19 @@ import { NoCommaPipe } from "./pipes/no-comma.pipe";
SizingSharedLibModule.forRoot(),
ChartsModule
],
exports: [
SsButtonComponent,
SgaPanelComponent,
ChartBarComponent,
BoilerSchemeComponent,
FormInputComponent,
FormListComponent,
FormToggleComponent,
FormRadioComponent,
SetUnitsDirective,
FormModalComponent,
exports: [
SgaPanelComponent,
ChartBarComponent,
BoilerSchemeComponent,
FormInputComponent,
FormListComponent,
FormToggleComponent,
FormRadioComponent,
SetUnitsDirective,
FormModalComponent,
OnlyNumberDirective,
NoCommaPipe
],
NoCommaPipe,
DisableControlDirective
],
})
export class SharedModule { }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tabset class="sgaBenchmark" *ngIf="!!data; else noData">
<tabset class="sgaBenchmark" *ngIf="!!data && !!units; else noData">
<tab>
<h5 class="sgaBaseTabs_title_md">{{'BENCHMARK' | translate}}</h5>
<ng-template tabHeading>
Expand Down
Loading

0 comments on commit b56d65f

Please sign in to comment.