@3sc/common-component 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- $fontFamily: "Montserrat";
1
+ $fontFamily: Montserrat, sans-serif;
@@ -3,18 +3,24 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getNotification = void 0;
6
+ exports.putNotification = exports.getNotification = void 0;
7
7
  require("core-js/modules/es.promise.js");
8
8
  var _axios = _interopRequireDefault(require("../config/axios"));
9
9
  var _Constant = require("../utils/Constant");
10
10
  var _EndPoint = _interopRequireDefault(require("../utils/EndPoint"));
11
11
  var _Env = _interopRequireDefault(require("../utils/Env"));
12
+ var _LocalStorage = _interopRequireDefault(require("../utils/LocalStorage"));
12
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14
  const {
14
15
  TENANT_ID,
15
16
  BU_ID,
16
17
  SNOP_ID
17
18
  } = _Constant.OTHER_CONSTANT;
19
+ const {
20
+ TENANT_IDS,
21
+ BU_IDS,
22
+ SNOP_IDS
23
+ } = _LocalStorage.default;
18
24
  const getNotification = async _ref => {
19
25
  let {
20
26
  tenantId,
@@ -30,4 +36,15 @@ const getNotification = async _ref => {
30
36
  return e;
31
37
  }
32
38
  };
33
- exports.getNotification = getNotification;
39
+ exports.getNotification = getNotification;
40
+ const putNotification = async payload => {
41
+ try {
42
+ const url = "".concat(_EndPoint.default.NOTIFICATION).concat(_Env.default.VERSION, "?").concat(TENANT_ID, "=").concat(TENANT_IDS, "&").concat(BU_ID, "=").concat(BU_IDS, "&").concat(SNOP_ID, "=").concat(SNOP_IDS);
43
+ const response = await _axios.default.put(url, payload);
44
+ return response;
45
+ } catch (e) {
46
+ // do something
47
+ return e;
48
+ }
49
+ };
50
+ exports.putNotification = putNotification;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const ACTION_TYPE = {
8
+ LOADING: "LOADING",
9
+ SUCCESS: "SUCCESS",
10
+ ERROR: "ERROR",
11
+ MARK_ALL_AS_READ: "MARK_ALL_AS_READ"
12
+ };
13
+ var _default = exports.default = ACTION_TYPE;
@@ -3,13 +3,35 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.OTHER_CONSTANT = exports.LOCAL_STORAGE_KEY = void 0;
6
+ exports.optionRow = exports.detailsSearchKey = exports.detailsHeadObj = exports.OTHER_CONSTANT = exports.LOCAL_STORAGE_KEY = exports.HEADER_ICON_TYPE = void 0;
7
7
  const LOCAL_STORAGE_KEY = exports.LOCAL_STORAGE_KEY = {
8
- TOKEN: "token"
8
+ TOKEN: "token",
9
+ USER: "user",
10
+ SNOP: "snop"
9
11
  };
10
12
  const OTHER_CONSTANT = exports.OTHER_CONSTANT = {
11
13
  BEARER: "Bearer",
12
14
  TENANT_ID: "tenant_id",
13
15
  BU_ID: "bu_id",
14
16
  SNOP_ID: "snop_id"
15
- };
17
+ };
18
+ const HEADER_ICON_TYPE = exports.HEADER_ICON_TYPE = {
19
+ REFRESH: "refresh",
20
+ CLOSE: "close"
21
+ };
22
+ const optionRow = exports.optionRow = [{
23
+ label: "Show 10 Rows",
24
+ value: 10
25
+ }, {
26
+ label: "Show 20 Rows",
27
+ value: 20
28
+ }, {
29
+ label: "Show 30 Rows",
30
+ value: 30
31
+ }];
32
+ const detailsHeadObj = exports.detailsHeadObj = {
33
+ "SKU Name": "sku_name",
34
+ Node: "node",
35
+ "Channel Name": "channel_name"
36
+ };
37
+ const detailsSearchKey = exports.detailsSearchKey = Object.values(detailsHeadObj);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const ERROR_MSG = {
8
+ SWR: "Something went wrong!",
9
+ UNHANDLED: "Unhandled action type: ",
10
+ INVALID: "Invalid action type: ",
11
+ INVALID_ACTION: "Invalid action type: ",
12
+ NRF: "Not record found!"
13
+ };
14
+ var _default = exports.default = ERROR_MSG;
@@ -6,7 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _commonFun = require("../helper/common-fun");
8
8
  var _Constant = require("./Constant");
9
+ const user = (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.USER);
10
+ const snop = (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.SNOP);
9
11
  const LOCAL_STORAGE = {
10
- TOKEN: (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.TOKEN)
12
+ TOKEN: (0, _commonFun.getLocalStorage)(_Constant.LOCAL_STORAGE_KEY.TOKEN),
13
+ BU_IDS: user === null || user === void 0 ? void 0 : user.business_unit_id,
14
+ TENANT_IDS: user === null || user === void 0 ? void 0 : user.tenant_id,
15
+ SNOP_IDS: snop === null || snop === void 0 ? void 0 : snop.snop_id
11
16
  };
12
17
  var _default = exports.default = LOCAL_STORAGE;
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "name": "@3sc/common-component",
3
- "version": "0.0.2",
4
- "keywords": [
5
- "react",
6
- "components",
7
- "ui"
8
- ],
9
- "main": "dist/modules",
10
- "module": "dist/modules",
11
- "files": [
12
- "dist",
13
- "README.md"
14
- ],
15
- "dependencies": {
16
- "@emotion/react": "^11.11.3",
17
- "@emotion/styled": "^11.11.0",
18
- "@mui/icons-material": "^5.14.5",
19
- "@mui/material": "^5.15.5",
20
- "@testing-library/jest-dom": "^5.17.0",
21
- "@testing-library/react": "^13.4.0",
22
- "@testing-library/user-event": "^13.5.0",
23
- "axios": "^1.6.5",
24
- "react": "^18.2.0",
25
- "react-dom": "^18.2.0",
26
- "react-scripts": "5.0.1",
27
- "sass": "^1.69.7",
28
- "web-vitals": "^2.1.4"
29
- },
30
- "scripts": {
31
- "start": "react-scripts start",
32
- "build": "babel src --out-dir dist --copy-files",
33
- "test": "react-scripts test",
34
- "eject": "react-scripts eject"
35
- },
36
- "eslintConfig": {
37
- "extends": [
38
- "react-app",
39
- "react-app/jest"
40
- ]
41
- },
42
- "browserslist": {
43
- "production": [
44
- ">0.2%",
45
- "not dead",
46
- "not op_mini all"
47
- ],
48
- "development": [
49
- "last 1 chrome version",
50
- "last 1 firefox version",
51
- "last 1 safari version"
52
- ]
53
- },
54
- "devDependencies": {
55
- "@babel/cli": "^7.23.4",
56
- "@babel/core": "^7.23.7",
57
- "@babel/preset-env": "^7.23.8",
58
- "babel-plugin-inline-dotenv": "^1.7.0"
59
- }
60
- }
1
+ {
2
+ "name": "@3sc/common-component",
3
+ "version": "0.0.3",
4
+ "keywords": [
5
+ "react",
6
+ "components",
7
+ "ui"
8
+ ],
9
+ "main": "dist/modules",
10
+ "module": "dist/modules",
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "dependencies": {
16
+ "@emotion/react": "^11.11.3",
17
+ "@emotion/styled": "^11.11.0",
18
+ "@mui/icons-material": "^5.14.5",
19
+ "@mui/material": "^5.15.5",
20
+ "@testing-library/jest-dom": "^5.17.0",
21
+ "@testing-library/react": "^13.4.0",
22
+ "@testing-library/user-event": "^13.5.0",
23
+ "axios": "^1.6.5",
24
+ "react": "^18.2.0",
25
+ "react-dom": "^18.2.0",
26
+ "react-scripts": "5.0.1",
27
+ "sass": "^1.69.7",
28
+ "web-vitals": "^2.1.4"
29
+ },
30
+ "scripts": {
31
+ "start": "react-scripts start",
32
+ "build": "babel src --out-dir dist --copy-files",
33
+ "test": "react-scripts test",
34
+ "eject": "react-scripts eject"
35
+ },
36
+ "eslintConfig": {
37
+ "extends": [
38
+ "react-app",
39
+ "react-app/jest"
40
+ ]
41
+ },
42
+ "browserslist": {
43
+ "production": [
44
+ ">0.2%",
45
+ "not dead",
46
+ "not op_mini all"
47
+ ],
48
+ "development": [
49
+ "last 1 chrome version",
50
+ "last 1 firefox version",
51
+ "last 1 safari version"
52
+ ]
53
+ },
54
+ "devDependencies": {
55
+ "@babel/cli": "^7.23.4",
56
+ "@babel/core": "^7.23.7",
57
+ "@babel/preset-env": "^7.23.8",
58
+ "babel-plugin-inline-dotenv": "^1.7.0"
59
+ }
60
+ }