# All files / src/app/ceph/rgw/rgw-501 rgw-501.component.ts

79.17% Statements 19/24
72.73% Branches 8/11
66.67% Functions 4/6
76.19% Lines 16/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    481x
    1x

    1x
    1x

    1x

    1x

    1x
    1x
    1x

    1x
    1x

    1x

    1x
    1x

    1x

    1x
     import { Component, OnDestroy, OnInit } from '@angular/core';
    import { ActivatedRoute } from '@angular/router';

    import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
    import { SummaryService } from '../../../shared/services/summary.service';

    @Component({
      selector: 'cd-rgw-501',
      template: require('./rgw-501.component.html'),
      styles: []
    })
    export class Rgw501Component implements OnInit, OnDestroy {
      docsUrl: string;
      message = 'The Object Gateway service is not configured.';
      routeParamsSubscribe: any;

      constructor(
        private route: ActivatedRoute,
        private summaryService: SummaryService,
        private cephReleaseNamePipe: CephReleaseNamePipe
      ) {}

      ngOnInit() {
        const subs = this.summaryService.subscribe((summary: any) => {
          if (!summary) {
            return;
          }

          const releaseName = this.cephReleaseNamePipe.transform(summary.version);
          this.docsUrl =
            `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/` +
            `#enabling-the-object-gateway-management-frontend`;

          setTimeout(() => {
            subs.unsubscribe();
          }, 0);
        });

        this.routeParamsSubscribe = this.route.params.subscribe((params: { message: string }) => {
          this.message = params.message;
        });
      }

      ngOnDestroy() {
        this.routeParamsSubscribe.unsubscribe();
      }
    }