# All files / src/app/shared/constants app.constants.ts

100% Statements 41/41
85.71% Branches 6/7
75% Functions 3/4
100% Lines 38/38

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
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    10394x

    94x

    94x
    94x
    94x
    94x
    94x

    94x

    94x

    94x

    94x

    94x

    94x

    94x

    94x
    94x

    94x

    94x

    94x

    94x

    94x

    94x

    94x

    94x
    94x

    94x

    94x

    388x

    388x

    388x

    388x

    388x

    388x
    388x

    388x
    388x

    388x

    94x
     import { Injectable } from '@angular/core';

    import { I18n } from '@ngx-translate/i18n-polyfill';

    export class AppConstants {
      public static readonly organization = 'ceph';
      public static readonly projectName = 'Ceph Manager Dashboard';
      public static readonly license = 'Free software (LGPL 2.1).';
    }

    export enum URLVerbs {
      /* Create a new item */
      CREATE = 'create',

      /* Make changes to an existing item */
      EDIT = 'edit',

      /* Make changes to an existing item */
      UPDATE = 'update',

      /* Remove an item from a container WITHOUT deleting it */
      REMOVE = 'remove',

      /* Destroy an existing item */
      DELETE = 'delete',

      /* Add an existing item to a container */
      ADD = 'add',

      /* Non-standard verbs */
      COPY = 'copy',
      CLONE = 'clone'
    }

    export enum ActionLabels {
      /* Create a new item */
      CREATE = 'Create',

      /* Destroy an existing item */
      DELETE = 'Delete',

      /* Add an existing item to a container */
      ADD = 'Add',

      /* Remove an item from a container WITHOUT deleting it */
      REMOVE = 'Remove',

      /* Make changes to an existing item */
      EDIT = 'Edit',

      /* */
      CANCEL = 'Cancel',

      /* Non-standard actions */
      COPY = 'Copy',
      CLONE = 'Clone',

      /* Read-only */
      SHOW = 'Show'
    }

    @Injectable({
      providedIn: 'root'
    })
    export class ActionLabelsI18n {
      /* This service is required as the i18n polyfill does not provide static
      translation
      */
      CREATE: string;
      DELETE: string;
      ADD: string;
      REMOVE: string;
      EDIT: string;
      CANCEL: string;
      COPY: string;
      CLONE: string;
      SHOW: string;

      constructor(private i18n: I18n) {
        /* Create a new item */
        this.CREATE = this.i18n('Create');

        /* Destroy an existing item */
        this.DELETE = this.i18n('Delete');

        /* Add an existing item to a container */
        this.ADD = this.i18n('Add');

        /* Remove an item from a container WITHOUT deleting it */
        this.REMOVE = this.i18n('Remove');

        /* Make changes to an existing item */
        this.EDIT = this.i18n('Edit');
        this.CANCEL = this.i18n('Cancel');

        /* Non-standard actions */
        this.COPY = this.i18n('Copy');
        this.CLONE = this.i18n('Clone');

        this.SHOW = this.i18n('Show');
      }
    }