Skip to content

Commit

Permalink
Fix: Dashboard chart colors based on theme
Browse files Browse the repository at this point in the history
  • Loading branch information
AnurosePrakash committed Jun 28, 2023
1 parent 68f4d4d commit 8e184cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ the detailed section referring to by linking pull requests or issues.

#### Fixed

- Fix Dashboard chart colors based on theme

## [v0.0.1-milestone-8-sovity8] 23.06.2023

### Overview
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Injectable} from '@angular/core';
import {Observable, combineLatest, merge, of, scan} from 'rxjs';
import {map} from 'rxjs/operators';
import {ActiveFeatureSet} from '../../../../core/config/active-feature-set';
import {CatalogApiUrlService} from '../../../../core/services/api/catalog-api-url.service';
import {ContractOfferService} from '../../../../core/services/api/contract-offer.service';
import {
Expand All @@ -22,6 +23,7 @@ import {DashboardPageData, defaultDashboardData} from './dashboard-page-data';
@Injectable({providedIn: 'root'})
export class DashboardPageDataService {
constructor(
private activeFeatureSet: ActiveFeatureSet,
private catalogBrowserService: ContractOfferService,
private contractDefinitionService: ContractDefinitionService,
private contractAgreementService: ContractAgreementService,
Expand Down Expand Up @@ -151,9 +153,15 @@ export class DashboardPageDataService {
);

const colorsByState = new Map<string, string>();
colorsByState.set('IN_PROGRESS', '#7eb0d5');
colorsByState.set('ERROR', '#fd7f6f');
colorsByState.set('COMPLETED', '#b2e061');
if (this.activeFeatureSet.hasMdsFields()) {
colorsByState.set('IN_PROGRESS', '#FFFF00');
colorsByState.set('ERROR', '#FFA500');
colorsByState.set('COMPLETED', '#9ACD32');
} else {
colorsByState.set('IN_PROGRESS', '#7eb0d5');
colorsByState.set('ERROR', '#fd7f6f');
colorsByState.set('COMPLETED', '#b2e061');
}
const defaultColor = '#bd7ebe';

const amountsByState = states.map(
Expand Down

0 comments on commit 8e184cd

Please sign in to comment.