diff --git a/src/app/assumptions-and-limitation/assumptions-and-limitation.component.html b/src/app/assumptions-and-limitation/assumptions-and-limitation.component.html index 235c090..c4167ba 100644 --- a/src/app/assumptions-and-limitation/assumptions-and-limitation.component.html +++ b/src/app/assumptions-and-limitation/assumptions-and-limitation.component.html @@ -1,13 +1,6 @@

Assumptions and Limitations

-

The Technology Carbon Estimator tool is designed to give a high-level overview of the possible areas of carbon @@ -117,7 +110,13 @@

Carbon Intensity

Upstream Emissions

Each class of device is given an average amount of embodied carbon and a lifespan, based on averages taken from - manufacturer provided Product Carbon Footprint documentation*. At present these are: + manufacturer provided Product Carbon Footprint documentation*. At present these are:

@@ -144,8 +143,8 @@

Upstream Emissions

We use the total Embodied Carbon and the lifespan to give an @@ -322,10 +321,4 @@

Managed Services

We currently do not make a distinction between on-premises data centers and those run by a third party.

-
diff --git a/src/app/assumptions-and-limitation/assumptions-and-limitation.component.spec.ts b/src/app/assumptions-and-limitation/assumptions-and-limitation.component.spec.ts index 60e8a6a..3a9d4f3 100644 --- a/src/app/assumptions-and-limitation/assumptions-and-limitation.component.spec.ts +++ b/src/app/assumptions-and-limitation/assumptions-and-limitation.component.spec.ts @@ -16,22 +16,6 @@ describe('AssumptionsAndLimitationComponent', () => { fixture.detectChanges(); }); - it('should emit close event when click close button', () => { - spyOn(component.closeEvent, 'emit'); - - fixture.nativeElement.querySelector('button').click(); - - expect(component.closeEvent.emit).toHaveBeenCalledTimes(1); - }); - - it('should emit close event when press esc key', () => { - spyOn(component.closeEvent, 'emit'); - - document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); - - expect(component.closeEvent.emit).toHaveBeenCalledTimes(1); - }); - it('should have focus afterContentInit', () => { component.ngAfterContentInit(); fixture.detectChanges(); @@ -39,15 +23,4 @@ describe('AssumptionsAndLimitationComponent', () => { const hasFocus = component.assumptionsLimitation.nativeElement.contains(document.activeElement); expect(hasFocus).toBeTrue(); }); - - it('should emit close event with true value when press esc key with focus within component', () => { - spyOn(component.closeEvent, 'emit'); - - component.ngAfterContentInit(); - fixture.detectChanges(); - - document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); - - expect(component.closeEvent.emit).toHaveBeenCalledWith(true); - }); }); diff --git a/src/app/assumptions-and-limitation/assumptions-and-limitation.component.ts b/src/app/assumptions-and-limitation/assumptions-and-limitation.component.ts index 240d454..73e151b 100644 --- a/src/app/assumptions-and-limitation/assumptions-and-limitation.component.ts +++ b/src/app/assumptions-and-limitation/assumptions-and-limitation.component.ts @@ -1,4 +1,4 @@ -import { AfterContentInit, Component, ElementRef, EventEmitter, HostListener, Output, ViewChild } from '@angular/core'; +import { AfterContentInit, Component, ElementRef, ViewChild } from '@angular/core'; import { CLOUD_AVERAGE_PUE, ON_PREMISE_AVERAGE_PUE } from '../estimation/constants'; import { siteTypeInfo } from '../estimation/estimate-downstream-emissions'; import { PurposeOfSite, WorldLocation, locationArray, purposeOfSiteArray } from '../types/carbon-estimator'; @@ -33,7 +33,6 @@ const locationDescriptions: Record = { imports: [DecimalPipe, ExternalLinkDirective], }) export class AssumptionsAndLimitationComponent implements AfterContentInit { - @Output() public closeEvent = new EventEmitter(); readonly ON_PREMISE_AVERAGE_PUE = ON_PREMISE_AVERAGE_PUE; readonly CLOUD_AVERAGE_PUE = CLOUD_AVERAGE_PUE; readonly siteTypeInfo = purposeOfSiteArray.map(purpose => ({ @@ -85,14 +84,4 @@ export class AssumptionsAndLimitationComponent implements AfterContentInit { public ngAfterContentInit(): void { this.assumptionsLimitation.nativeElement.focus({ preventScroll: true }); } - - public onClose(hasFocus = true): void { - this.closeEvent.emit(hasFocus); - } - - @HostListener('document:keydown.escape', ['$event']) - public onEscKeydown(): void { - const hasFocus = this.assumptionsLimitation.nativeElement.contains(document.activeElement); - this.onClose(hasFocus); - } }