summaryrefslogtreecommitdiffstats
path: root/devtools/client/application/src/constants.js
blob: f7e34082a32ea5ada0876a64593348fb0fb618f2 (plain)
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
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

const actionTypes = {
  // manifest substate
  FETCH_MANIFEST_FAILURE: "FETCH_MANIFEST_FAILURE",
  FETCH_MANIFEST_START: "FETCH_MANIFEST_START",
  FETCH_MANIFEST_SUCCESS: "FETCH_MANIFEST_SUCCESS",
  RESET_MANIFEST: "RESET_MANIFEST",
  // page substate
  UPDATE_DOMAIN: "UPDATE_DOMAIN",
  // ui substate
  UPDATE_SELECTED_PAGE: "UPDATE_SELECTED_PAGE",
  // workers substate
  START_WORKER: "START_WORKER",
  UNREGISTER_WORKER: "UNREGISTER_WORKER",
  UPDATE_CAN_DEBUG_WORKERS: "UPDATE_CAN_DEBUG_WORKERS",
  UPDATE_WORKERS: "UPDATE_WORKERS",
};

// NOTE: these const values are used as part of CSS selectors - be mindful of the characters used
const PAGE_TYPES = {
  MANIFEST: "manifest",
  SERVICE_WORKERS: "service-workers",
};

const DEFAULT_PAGE = PAGE_TYPES.SERVICE_WORKERS;

const MANIFEST_CATEGORIES = {
  IDENTITY: "identity",
  PRESENTATION: "presentation",
  ICONS: "icons",
};

const MANIFEST_MEMBER_VALUE_TYPES = {
  COLOR: "color",
  ICON: "icon",
  STRING: "string",
  URL: "url",
};

const MANIFEST_ISSUE_LEVELS = {
  ERROR: "error",
  WARNING: "warning",
};

// flatten constants
module.exports = Object.assign(
  {},
  {
    DEFAULT_PAGE,
    PAGE_TYPES,
    MANIFEST_CATEGORIES,
    MANIFEST_ISSUE_LEVELS,
    MANIFEST_MEMBER_VALUE_TYPES,
  },
  actionTypes
);