Add fixes for cold reboot

This fixes the cold reboot issue with the following steps

- It applies the command to shut off the chassis.
- Then verify the chassis is off. It checks for every 5 seconds.
  During this time the spinner displays. A 5min timeout has been
  added.
- Once the chassis is off, it turns on the host.

fixes openbmc/openbmc#2795

Change-Id: I119a1c95e57c10ccee27be1512a1fc38cde307fa
Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com>
Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
diff --git a/app/common/services/constants.js b/app/common/services/constants.js
index 0bb2123..21241da 100644
--- a/app/common/services/constants.js
+++ b/app/common/services/constants.js
@@ -27,11 +27,15 @@
                 },
                 CHASSIS_POWER_STATE: {
                     on: 'On',
-                    off: 'Off'
+                    on_code: 'xyz.openbmc_project.State.Chassis.PowerState.On',
+                    off: 'Off',
+                    off_code: 'xyz.openbmc_project.State.Chassis.PowerState.Off'
                 },
                 HOST_STATE_TEXT: {
                     on: 'Running',
+                    on_code: 'xyz.openbmc_project.State.Host.HostState.Running',
                     off: 'Off',
+                    off_code: 'xyz.openbmc_project.State.Host.HostState.Off',
                     booting: 'Quiesced',
                     unreachable: 'Unreachable'
                 },
@@ -107,21 +111,31 @@
                 ],
                 SENSOR_SORT_ORDER_DEFAULT: 8,
                 FIRMWARE: {
-                  ACTIVATE_FIRMWARE: 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active',
-                  FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional'
+                    ACTIVATE_FIRMWARE: 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active',
+                    FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional'
                 },
-               POLL_INTERVALS: {
-                  ACTIVATION: 5000
+                POLL_INTERVALS: {
+                    ACTIVATION: 5000,
+                    POWER_OP: 5000,
                 },
-               TIMEOUT: {
-                  ACTIVATION: 1000 * 60 * 10, // 10 mins
+                TIMEOUT: {
+                    ACTIVATION: 1000 * 60 * 10, // 10 mins
+                    CHASSIS_OFF: 1000 * 60 * 5, // 5 mins
+                    HOST_ON: 1000 * 60 * 5, // 5 mins
                 },
                 MESSAGES: {
-                  SENSOR: {
-                    NO_SENSOR_DATA: 'There are no sensors found.',
-                    CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.',
-                    WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.'
-                  }
+                    POLL: {
+                        TIMEOUT: 'Time out. Did not reach power state in allotted time.',
+                    },
+                    SENSOR: {
+                        NO_SENSOR_DATA: 'There are no sensors found.',
+                        CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.',
+                        WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.'
+                    },
+                    ERROR_MODAL: {
+                        TITLE: 'Unexpected error',
+                        DESCRIPTION: 'Oops! An unexpected error occurred. Record specific details of the issue, then contact your company support services.'
+                    }
                 },
                 POWER_CAP_TEXT: {
                     unit: 'W',