robbyson-frontend-library 1.0.25 → 1.0.27

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.
@@ -39,6 +39,22 @@ var BaseAppPage = /** @class */ (function (_super) {
39
39
  return _this;
40
40
  }
41
41
  BaseAppPage.prototype.redirect = function () {
42
+ var state = RobbysonNavigate === null || RobbysonNavigate === void 0 ? void 0 : RobbysonNavigate.getHistoryState();
43
+ if (state === null || state === void 0 ? void 0 : state.pathname) {
44
+ var actualPathname = RobbysonNavigate.getPathname();
45
+ var restrictedRoutes = [
46
+ "/terms-of-use",
47
+ "/humor",
48
+ "/documents",
49
+ "/login",
50
+ "/quiz",
51
+ ];
52
+ var isOperacaoPage = actualPathname.endsWith("/operacao/");
53
+ var isRestrictedRoute = restrictedRoutes === null || restrictedRoutes === void 0 ? void 0 : restrictedRoutes.some(function (route) { var _a; return (_a = state === null || state === void 0 ? void 0 : state.pathname) === null || _a === void 0 ? void 0 : _a.includes(route); });
54
+ if (isOperacaoPage && isRestrictedRoute) {
55
+ return;
56
+ }
57
+ }
42
58
  if (this._handleGoBack) {
43
59
  this._handleGoBack();
44
60
  }
@@ -60,14 +76,14 @@ var BaseAppPage = /** @class */ (function (_super) {
60
76
  BaseAppPage.prototype.render = function () {
61
77
  var _this = this;
62
78
  QueryParamsFactory.validate(this.paramsValidValues, this.paramsDefaultValues);
63
- var isOperacaoPage = RobbysonNavigate.getPathname().endsWith('/operacao/');
79
+ var isOperacaoPage = RobbysonNavigate.getPathname().endsWith("/operacao/");
64
80
  return (React.createElement(PageContainer, null,
65
- React.createElement(Header, null,
81
+ React.createElement(Header, { usePageHeader: this._usePageHeader },
66
82
  React.createElement("div", null,
67
- !isOperacaoPage && (React.createElement(LeftArrowLarge, { src: this._themeService.getIconAssetUrl("left-arrow-large"), onClick: function () { return _this.redirect(); } })),
83
+ React.createElement(LeftArrowLarge, { src: this._themeService.getIconAssetUrl("left-arrow-large"), onClick: function () { return _this.redirect(); }, isOperacaoPage: isOperacaoPage }),
68
84
  React.createElement(Title, null, this.translate(this.headerLocale))),
69
- React.createElement(ContextMenu, { className: "body-2-book" }, this.contextMenu())),
70
- React.createElement(Content, { customHeight: this.customHeight }, this.renderPage())));
85
+ !this._avoidContextMenu && (React.createElement(ContextMenu, { className: "body-2-book" }, this.contextMenu()))),
86
+ React.createElement(Content, { contentMarginTop: this._contentMarginTop, usePageHeader: this._usePageHeader, avoidContextMenu: this._avoidContextMenu }, this.renderPage())));
71
87
  };
72
88
  return BaseAppPage;
73
89
  }(React.Component));
@@ -3,26 +3,48 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { LayoutDimensions } from "../../constants";
6
- import styled from "styled-components";
6
+ import styled, { css } from "styled-components";
7
7
  import SVG from "react-inlinesvg";
8
8
  var SIDEBAR_WIDTH = 72;
9
- export var SidebarPadding = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: calc(", "px + 55px);\n height: calc(100vh + 8px);\n"], ["\n padding-left: calc(", "px + 55px);\n height: calc(100vh + 8px);\n"])), SIDEBAR_WIDTH);
10
- export var PageContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 32px 55px 47px calc(", "px + 55px);\n overflow: hidden;\n background: var(--solid-background);\n height: 100%;\n @media (max-width: ", "px) {\n padding: 32px 24px;\n }\n\n @media (max-width: ", "px) {\n padding: 24px 16px;\n }\n"], ["\n padding: 32px 55px 47px calc(", "px + 55px);\n overflow: hidden;\n background: var(--solid-background);\n height: 100%;\n @media (max-width: ", "px) {\n padding: 32px 24px;\n }\n\n @media (max-width: ", "px) {\n padding: 24px 16px;\n }\n"])), SIDEBAR_WIDTH, LayoutDimensions.width.horizontalIpadMini, LayoutDimensions.width.mobile);
11
- export var Header = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex !important;\n flex-direction: row !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 16px !important;\n\n @media (max-width: ", "px) {\n flex-direction: column !important;\n align-items: flex-start !important;\n margin-bottom: 16px;\n }\n\n & > div {\n display: flex;\n align-items: center;\n }\n\n svg {\n cursor: pointer;\n }\n"], ["\n display: flex !important;\n flex-direction: row !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 16px !important;\n\n @media (max-width: ", "px) {\n flex-direction: column !important;\n align-items: flex-start !important;\n margin-bottom: 16px;\n }\n\n & > div {\n display: flex;\n align-items: center;\n }\n\n svg {\n cursor: pointer;\n }\n"])), LayoutDimensions.width.horizontalIpadMini);
12
- export var ContextMenu = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n -ms-overflow-style: none;\n scrollbar-width: none;\n overflow-y: scroll;\n &::-webkit-scrollbar {\n display: none;\n }\n @media (max-width: ", "px) {\n width: 100%;\n }\n"], ["\n -ms-overflow-style: none;\n scrollbar-width: none;\n overflow-y: scroll;\n &::-webkit-scrollbar {\n display: none;\n }\n @media (max-width: ", "px) {\n width: 100%;\n }\n"])), LayoutDimensions.width.horizontalIpadMini);
13
- export var Title = styled.h4(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-left: 12px;\n\n @media (max-width: ", "px) {\n margin-left: 40px;\n }\n"], ["\n margin-left: 12px;\n\n @media (max-width: ", "px) {\n margin-left: 40px;\n }\n"])), LayoutDimensions.width.horizontalIpadMini);
14
9
  var PADDING_TOP_DESKTOP = 32;
15
- var PADDING_TOP_MOBILE = 32;
16
- var PADDING_BOTTOM_DESKTOP = 47;
17
- var PADDING_BOTTOM_MOBILE = 32;
18
- var HEADER_HEIGHT_DESKTOP = 48;
19
- var HEADER_HEIGHT_MOBILE = 99;
20
- export var Content = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: ", ";\n\n @media (max-width: ", "px) {\n height: calc(\n 100vh -\n ", "px\n );\n }\n"], ["\n height: ", ";\n\n @media (max-width: ", "px) {\n height: calc(\n 100vh -\n ", "px\n );\n }\n"])), function (_a) {
21
- var customHeight = _a.customHeight;
22
- return customHeight ||
23
- "calc(100vh - ".concat(PADDING_TOP_DESKTOP + PADDING_BOTTOM_DESKTOP + HEADER_HEIGHT_DESKTOP, "px)");
24
- }, LayoutDimensions.width.horizontalIpadMini, PADDING_TOP_MOBILE +
25
- PADDING_BOTTOM_MOBILE +
26
- HEADER_HEIGHT_MOBILE);
27
- export var LeftArrowLarge = styled(SVG)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: none;\n\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n\n @media (min-width: ", "px) {\n display: block;\n }\n"])), LayoutDimensions.width.horizontalIpadMini + 1);
28
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
10
+ var PADDING_TOP_MOBILE = 24;
11
+ var PADDING_BOTTOM_DESKTOP = 24;
12
+ var PADDING_BOTTOM_MOBILE = 24;
13
+ var HEADER_HEIGHT_DESKTOP = 40;
14
+ var HEADER_HEIGHT_MOBILE = 91;
15
+ var HEADER_HEIGHT_CUSTOM_PAGE = 40;
16
+ export var SidebarPadding = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: calc(", "px + 55px);\n height: calc(100vh + 8px);\n"], ["\n padding-left: calc(", "px + 55px);\n height: calc(100vh + 8px);\n"])), SIDEBAR_WIDTH);
17
+ export var PageContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 32px 55px 0px calc(", "px + 55px);\n overflow: hidden;\n background: var(--solid-background);\n height: 100%;\n @media (max-width: ", "px) {\n padding: 32px 24px 0px 32px;\n }\n\n @media (max-width: ", "px) {\n padding: 24px 16px 0px 24px;\n }\n"], ["\n padding: 32px 55px 0px calc(", "px + 55px);\n overflow: hidden;\n background: var(--solid-background);\n height: 100%;\n @media (max-width: ", "px) {\n padding: 32px 24px 0px 32px;\n }\n\n @media (max-width: ", "px) {\n padding: 24px 16px 0px 24px;\n }\n"])), SIDEBAR_WIDTH, LayoutDimensions.width.horizontalIpadMini, LayoutDimensions.width.mobile);
18
+ export var Header = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n flex-direction: row !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 16px !important;\n padding-bottom: 24px;\n\n @media (max-width: ", "px) {\n flex-direction: column !important;\n align-items: flex-start !important;\n }\n\n & > div {\n display: flex;\n align-items: center;\n }\n\n svg {\n cursor: pointer;\n }\n"], ["\n ", "\n flex-direction: row !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 16px !important;\n padding-bottom: 24px;\n\n @media (max-width: ", "px) {\n flex-direction: column !important;\n align-items: flex-start !important;\n }\n\n & > div {\n display: flex;\n align-items: center;\n }\n\n svg {\n cursor: pointer;\n }\n"])), function (_a) {
19
+ var usePageHeader = _a.usePageHeader;
20
+ if (usePageHeader) {
21
+ return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: none;\n\n @media (max-width: ", "px) {\n display: block;\n }\n "], ["\n display: none;\n\n @media (max-width: ", "px) {\n display: block;\n }\n "])), LayoutDimensions.width
22
+ .horizontalIpadMini);
23
+ }
24
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex !important;\n "], ["\n display: flex !important;\n "])));
25
+ }, LayoutDimensions.width.horizontalIpadMini);
26
+ export var ContextMenu = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n -ms-overflow-style: none;\n scrollbar-width: none;\n overflow-y: scroll;\n &::-webkit-scrollbar {\n display: none;\n }\n @media (max-width: ", "px) {\n width: 100%;\n }\n"], ["\n -ms-overflow-style: none;\n scrollbar-width: none;\n overflow-y: scroll;\n &::-webkit-scrollbar {\n display: none;\n }\n @media (max-width: ", "px) {\n width: 100%;\n }\n"])), LayoutDimensions.width.horizontalIpadMini);
27
+ export var Title = styled.h4(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-left: 12px;\n max-width: 600px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n @media (max-width: ", "px) {\n margin-left: 40px;\n }\n\n @media (max-width: ", "px) {\n max-width: 300px;\n }\n"], ["\n margin-left: 12px;\n max-width: 600px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n @media (max-width: ", "px) {\n margin-left: 40px;\n }\n\n @media (max-width: ", "px) {\n max-width: 300px;\n }\n"])), LayoutDimensions.width.horizontalIpadMini, LayoutDimensions.width.smallerMobiles);
28
+ export var Content = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
29
+ var _b = _a.contentMarginTop, contentMarginTop = _b === void 0 ? 0 : _b, usePageHeader = _a.usePageHeader, avoidContextMenu = _a.avoidContextMenu;
30
+ var headerHeightDesktop = usePageHeader ? 0 : HEADER_HEIGHT_DESKTOP;
31
+ var headerHeightMobile = usePageHeader || avoidContextMenu
32
+ ? HEADER_HEIGHT_CUSTOM_PAGE
33
+ : HEADER_HEIGHT_MOBILE;
34
+ var paddingBottomDesktop = usePageHeader ? 0 : PADDING_BOTTOM_DESKTOP;
35
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n height: ", ";\n\n @media (max-width: ", "px) {\n height: calc(\n 100vh -\n ", "px\n );\n } \n\n @media (max-width: ", "px) {\n height: calc(\n 100vh -\n ", "px\n );\n }\n\n\n & > div:first-child {\n ", "\n "], ["\n height: ", ";\n\n @media (max-width: ", "px) {\n height: calc(\n 100vh -\n ", "px\n );\n } \n\n @media (max-width: ", "px) {\n height: calc(\n 100vh -\n ", "px\n );\n }\n\n\n & > div:first-child {\n ", "\n "])), "calc(100vh - ".concat(PADDING_TOP_DESKTOP +
36
+ paddingBottomDesktop +
37
+ headerHeightDesktop +
38
+ contentMarginTop, "px)"), LayoutDimensions.width.horizontalIpadMini, PADDING_TOP_DESKTOP +
39
+ PADDING_BOTTOM_MOBILE +
40
+ headerHeightMobile +
41
+ contentMarginTop, LayoutDimensions.width.mobile, PADDING_TOP_MOBILE +
42
+ PADDING_BOTTOM_MOBILE +
43
+ headerHeightMobile +
44
+ contentMarginTop, contentMarginTop > 0 && "margin-top: ".concat(contentMarginTop, "px;"));
45
+ });
46
+ export var LeftArrowLarge = styled(SVG)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: none;\n fill: ", ";\n\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n fill: ", ";\n\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (_a) {
47
+ var isOperacaoPage = _a.isOperacaoPage;
48
+ return (isOperacaoPage ? "grey" : "inherit");
49
+ }, LayoutDimensions.width.horizontalIpadMini + 1);
50
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
@@ -5,8 +5,9 @@ var ApplicationsHierarchy;
5
5
  var HIERARCHY_LEVELS;
6
6
  (function (HIERARCHY_LEVELS) {
7
7
  HIERARCHY_LEVELS[HIERARCHY_LEVELS["OPERATOR"] = 1] = "OPERATOR";
8
+ HIERARCHY_LEVELS[HIERARCHY_LEVELS["MANAGER"] = 3] = "MANAGER";
8
9
  })(HIERARCHY_LEVELS || (HIERARCHY_LEVELS = {}));
9
10
  export var HierarchyConstants = {
10
11
  ApplicationsHierarchy: ApplicationsHierarchy,
11
- HIERARCHY_LEVELS: HIERARCHY_LEVELS
12
+ HIERARCHY_LEVELS: HIERARCHY_LEVELS,
12
13
  };
@@ -8,6 +8,7 @@ var LayoutDimensions = /** @class */ (function () {
8
8
  horizontalIpadMini: 1199,
9
9
  verticalIpadMini: 767,
10
10
  mobile: 575,
11
+ smallerMobiles: 450,
11
12
  };
12
13
  return LayoutDimensions;
13
14
  }());
@@ -1,20 +1,22 @@
1
+ //TODO:remover apos liberar em producao para a nova plataforma
1
2
  export var PRODUCT_TYPE_ID;
2
3
  (function (PRODUCT_TYPE_ID) {
3
4
  PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["EXPERIENCES"] = 1] = "EXPERIENCES";
4
5
  PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["CUSTOMIZATION"] = 2] = "CUSTOMIZATION";
5
6
  PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["MATERIAL"] = 3] = "MATERIAL";
6
7
  PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["RAFFLE"] = 4] = "RAFFLE";
7
- PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["AUCTION"] = 5] = "AUCTION";
8
- PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["DONATION"] = 6] = "DONATION";
8
+ // AUCTION = 5,
9
+ // DONATION = 6,
9
10
  PRODUCT_TYPE_ID[PRODUCT_TYPE_ID["VOUCHER"] = 7] = "VOUCHER";
10
11
  })(PRODUCT_TYPE_ID || (PRODUCT_TYPE_ID = {}));
12
+ //TODO:remover apos liberar em producao para a nova plataforma
11
13
  export var PRODUCT_TYPE_BY_ID = {
12
14
  1: "experiences",
13
15
  2: "customization",
14
16
  3: "material",
15
17
  4: "raffle",
16
- 5: "auction",
17
- 6: "donation",
18
+ // 5: "auction",
19
+ // 6: "donation",
18
20
  7: "voucher",
19
21
  };
20
22
  export var PRODUCT_ORDER_STATUS_ID;
@@ -70,5 +72,5 @@ export var MarketConstants = {
70
72
  PURCHASED_ORDERS_SORT_FILTER: PURCHASED_ORDERS_SORT_FILTER,
71
73
  PRODUCTS_PROJECTION_FILTER: PRODUCTS_PROJECTION_FILTER,
72
74
  PRODUCTS_SORT_FILTER: PRODUCTS_SORT_FILTER,
73
- PURCHASED_ORDERS_STATUS_FILTER: PURCHASED_ORDERS_STATUS_FILTER
75
+ PURCHASED_ORDERS_STATUS_FILTER: PURCHASED_ORDERS_STATUS_FILTER,
74
76
  };
@@ -268,6 +268,8 @@ export var ICON_HANDLES = [
268
268
  "arrow-right",
269
269
  "hifen",
270
270
  "showcase-thin",
271
+ "market-order-bold",
272
+ "market-order-thin",
271
273
  ];
272
274
  var ThemeBaseRect = /** @class */ (function () {
273
275
  function ThemeBaseRect() {
@@ -196,6 +196,13 @@ var BaseRepository = /** @class */ (function () {
196
196
  if (this.checkValidationSessionToken()) {
197
197
  config.headers.SessionKey = sessionKey;
198
198
  }
199
+ if (BaseRepository._globalState.Global.RootApp.isValidSession ===
200
+ false) {
201
+ var cancelSource = axios.CancelToken.source();
202
+ config.cancelToken = cancelSource.token;
203
+ cancelSource.cancel("SessionKey is expired");
204
+ return config;
205
+ }
199
206
  }
200
207
  config.headers["x-system-id"] = BaseRepository._systemId;
201
208
  return config;
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { GlobalStore } from "redux-micro-frontend";
2
13
  import queryString from "query-string";
3
14
  var RobbysonNavigate = /** @class */ (function () {
@@ -8,8 +19,9 @@ var RobbysonNavigate = /** @class */ (function () {
8
19
  RobbysonNavigate._globalState =
9
20
  RobbysonNavigate._globalStore.GetGlobalState();
10
21
  var history = RobbysonNavigate._globalState.Global.RootApp.history;
22
+ var routeState = __assign(__assign({}, state), { pathname: history.location.pathname });
11
23
  // TODO: Usar a LIB PATH para concatenar a URL
12
- history.push("/operacao".concat(url), state);
24
+ history.push("/operacao".concat(url), routeState);
13
25
  };
14
26
  RobbysonNavigate.go = function (delta) {
15
27
  RobbysonNavigate._globalStore = GlobalStore.Get();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robbyson-frontend-library",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Robbyson frontend Library",
5
5
  "main": "./dist/index.js",
6
6
  "license": "MIT",
@@ -21,7 +21,9 @@ export abstract class BaseAppPage<T, T1> extends React.Component<T, T1> {
21
21
  protected _themeService: IThemeService;
22
22
  protected _linkToOverride: string | undefined;
23
23
  protected _handleGoBack: Function | undefined;
24
- protected customHeight?: number | string;
24
+ protected _contentMarginTop?: number;
25
+ protected _usePageHeader?: boolean;
26
+ protected _avoidContextMenu?: boolean;
25
27
 
26
28
  constructor(props: T) {
27
29
  super(props);
@@ -31,6 +33,25 @@ export abstract class BaseAppPage<T, T1> extends React.Component<T, T1> {
31
33
  this._themeService = IoC.GetInstance<IThemeService>("ThemeService");
32
34
  }
33
35
  private redirect(): void {
36
+ const state = RobbysonNavigate?.getHistoryState() as any;
37
+ if (state?.pathname) {
38
+ const actualPathname = RobbysonNavigate.getPathname();
39
+ const restrictedRoutes = [
40
+ "/terms-of-use",
41
+ "/humor",
42
+ "/documents",
43
+ "/login",
44
+ "/quiz",
45
+ ];
46
+ const isOperacaoPage = actualPathname.endsWith("/operacao/");
47
+ const isRestrictedRoute = restrictedRoutes?.some((route) =>
48
+ state?.pathname?.includes(route)
49
+ );
50
+
51
+ if (isOperacaoPage && isRestrictedRoute) {
52
+ return;
53
+ }
54
+ }
34
55
  if (this._handleGoBack) {
35
56
  this._handleGoBack();
36
57
  } else if (this._linkToOverride) {
@@ -53,28 +74,34 @@ export abstract class BaseAppPage<T, T1> extends React.Component<T, T1> {
53
74
  this.paramsValidValues,
54
75
  this.paramsDefaultValues
55
76
  );
56
- const isOperacaoPage = RobbysonNavigate.getPathname().endsWith('/operacao/');
77
+ const isOperacaoPage =
78
+ RobbysonNavigate.getPathname().endsWith("/operacao/");
57
79
  return (
58
80
  <PageContainer>
59
- <Header>
81
+ <Header usePageHeader={this._usePageHeader}>
60
82
  <div>
61
- {!isOperacaoPage && (
62
-
63
- <LeftArrowLarge
64
- src={this._themeService.getIconAssetUrl(
65
- "left-arrow-large"
66
- )}
67
- onClick={() => this.redirect()}
68
- />
69
- )}
83
+ <LeftArrowLarge
84
+ src={this._themeService.getIconAssetUrl(
85
+ "left-arrow-large"
86
+ )}
87
+ onClick={() => this.redirect()}
88
+ isOperacaoPage={isOperacaoPage}
89
+ />
70
90
  <Title>{this.translate(this.headerLocale)}</Title>
71
91
  </div>
72
92
 
73
- <ContextMenu className="body-2-book">
74
- {this.contextMenu()}
75
- </ContextMenu>
93
+ {!this._avoidContextMenu && (
94
+ <ContextMenu className="body-2-book">
95
+ {this.contextMenu()}
96
+ </ContextMenu>
97
+ )}
76
98
  </Header>
77
- <Content customHeight={this.customHeight}>
99
+
100
+ <Content
101
+ contentMarginTop={this._contentMarginTop}
102
+ usePageHeader={this._usePageHeader}
103
+ avoidContextMenu={this._avoidContextMenu}
104
+ >
78
105
  {this.renderPage()}
79
106
  </Content>
80
107
  </PageContainer>
@@ -1,8 +1,25 @@
1
1
  import { LayoutDimensions } from "../../constants";
2
- import styled from "styled-components";
2
+ import styled, { css } from "styled-components";
3
3
  import SVG from "react-inlinesvg";
4
4
 
5
+ interface LeftArrowLargeProps {
6
+ isOperacaoPage: boolean;
7
+ }
8
+
9
+ type ContentProps = {
10
+ contentMarginTop?: number;
11
+ usePageHeader?: boolean;
12
+ avoidContextMenu?: boolean;
13
+ };
14
+
5
15
  const SIDEBAR_WIDTH = 72;
16
+ const PADDING_TOP_DESKTOP = 32;
17
+ const PADDING_TOP_MOBILE = 24;
18
+ const PADDING_BOTTOM_DESKTOP = 24;
19
+ const PADDING_BOTTOM_MOBILE = 24;
20
+ const HEADER_HEIGHT_DESKTOP = 40;
21
+ const HEADER_HEIGHT_MOBILE = 91;
22
+ const HEADER_HEIGHT_CUSTOM_PAGE = 40;
6
23
 
7
24
  export const SidebarPadding = styled.div`
8
25
  padding-left: calc(${SIDEBAR_WIDTH}px + 55px);
@@ -10,30 +27,45 @@ export const SidebarPadding = styled.div`
10
27
  `;
11
28
 
12
29
  export const PageContainer = styled.div`
13
- padding: 32px 55px 47px calc(${SIDEBAR_WIDTH}px + 55px);
30
+ padding: 32px 55px 0px calc(${SIDEBAR_WIDTH}px + 55px);
14
31
  overflow: hidden;
15
32
  background: var(--solid-background);
16
33
  height: 100%;
17
34
  @media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
18
- padding: 32px 24px;
35
+ padding: 32px 24px 0px 32px;
19
36
  }
20
37
 
21
38
  @media (max-width: ${LayoutDimensions.width.mobile}px) {
22
- padding: 24px 16px;
39
+ padding: 24px 16px 0px 24px;
23
40
  }
24
41
  `;
25
42
 
26
- export const Header = styled.div`
27
- display: flex !important;
43
+ export const Header = styled.div<{ usePageHeader?: boolean }>`
44
+ ${({ usePageHeader }) => {
45
+ if (usePageHeader) {
46
+ return css`
47
+ display: none;
48
+
49
+ @media (max-width: ${LayoutDimensions.width
50
+ .horizontalIpadMini}px) {
51
+ display: block;
52
+ }
53
+ `;
54
+ }
55
+
56
+ return css`
57
+ display: flex !important;
58
+ `;
59
+ }}
28
60
  flex-direction: row !important;
29
61
  justify-content: space-between !important;
30
62
  align-items: center !important;
31
63
  gap: 16px !important;
64
+ padding-bottom: 24px;
32
65
 
33
66
  @media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
34
67
  flex-direction: column !important;
35
68
  align-items: flex-start !important;
36
- margin-bottom: 16px;
37
69
  }
38
70
 
39
71
  & > div {
@@ -60,42 +92,71 @@ export const ContextMenu = styled.div`
60
92
 
61
93
  export const Title = styled.h4`
62
94
  margin-left: 12px;
95
+ max-width: 600px;
96
+ text-overflow: ellipsis;
97
+ overflow: hidden;
98
+ white-space: nowrap;
63
99
 
64
100
  @media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
65
101
  margin-left: 40px;
66
102
  }
67
- `;
68
103
 
69
- const PADDING_TOP_DESKTOP = 32;
70
- const PADDING_TOP_MOBILE = 32;
71
- const PADDING_BOTTOM_DESKTOP = 47;
72
- const PADDING_BOTTOM_MOBILE = 32;
73
- const HEADER_HEIGHT_DESKTOP = 48;
74
- const HEADER_HEIGHT_MOBILE = 99;
75
-
76
- type ContentProps = {
77
- customHeight?: number | string;
78
- };
104
+ @media (max-width: ${LayoutDimensions.width.smallerMobiles}px) {
105
+ max-width: 300px;
106
+ }
107
+ `;
79
108
 
80
109
  export const Content = styled.div<ContentProps>`
81
- height: ${({ customHeight }) =>
82
- customHeight ||
83
- `calc(100vh - ${
84
- PADDING_TOP_DESKTOP + PADDING_BOTTOM_DESKTOP + HEADER_HEIGHT_DESKTOP
110
+ ${({ contentMarginTop = 0, usePageHeader, avoidContextMenu }) => {
111
+ const headerHeightDesktop = usePageHeader ? 0 : HEADER_HEIGHT_DESKTOP;
112
+ const headerHeightMobile =
113
+ usePageHeader || avoidContextMenu
114
+ ? HEADER_HEIGHT_CUSTOM_PAGE
115
+ : HEADER_HEIGHT_MOBILE;
116
+ const paddingBottomDesktop = usePageHeader ? 0 : PADDING_BOTTOM_DESKTOP;
117
+
118
+ return css`
119
+ height: ${`calc(100vh - ${
120
+ PADDING_TOP_DESKTOP +
121
+ paddingBottomDesktop +
122
+ headerHeightDesktop +
123
+ contentMarginTop
85
124
  }px)`};
86
125
 
87
- @media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
88
- height: calc(
89
- 100vh -
90
- ${PADDING_TOP_MOBILE +
91
- PADDING_BOTTOM_MOBILE +
92
- HEADER_HEIGHT_MOBILE}px
93
- );
94
- }
126
+ @media (max-width: ${LayoutDimensions.width.horizontalIpadMini}px) {
127
+ height: calc(
128
+ 100vh -
129
+ ${
130
+ PADDING_TOP_DESKTOP +
131
+ PADDING_BOTTOM_MOBILE +
132
+ headerHeightMobile +
133
+ contentMarginTop
134
+ }px
135
+ );
136
+ }
137
+
138
+ @media (max-width: ${LayoutDimensions.width.mobile}px) {
139
+ height: calc(
140
+ 100vh -
141
+ ${
142
+ PADDING_TOP_MOBILE +
143
+ PADDING_BOTTOM_MOBILE +
144
+ headerHeightMobile +
145
+ contentMarginTop
146
+ }px
147
+ );
148
+ }
149
+
150
+
151
+ & > div:first-child {
152
+ ${contentMarginTop > 0 && `margin-top: ${contentMarginTop}px;`}
153
+ `;
154
+ }}
95
155
  `;
96
156
 
97
- export const LeftArrowLarge = styled(SVG)`
157
+ export const LeftArrowLarge = styled(SVG)<LeftArrowLargeProps>`
98
158
  display: none;
159
+ fill: ${({ isOperacaoPage }) => (isOperacaoPage ? "grey" : "inherit")};
99
160
 
100
161
  @media (min-width: ${LayoutDimensions.width.horizontalIpadMini + 1}px) {
101
162
  display: block;
@@ -4,9 +4,10 @@ enum ApplicationsHierarchy {
4
4
 
5
5
  enum HIERARCHY_LEVELS {
6
6
  OPERATOR = 1,
7
+ MANAGER = 3,
7
8
  }
8
9
 
9
10
  export const HierarchyConstants = {
10
11
  ApplicationsHierarchy,
11
- HIERARCHY_LEVELS
12
+ HIERARCHY_LEVELS,
12
13
  };
@@ -6,5 +6,6 @@ export class LayoutDimensions {
6
6
  horizontalIpadMini: 1199,
7
7
  verticalIpadMini: 767,
8
8
  mobile: 575,
9
- }
10
- }
9
+ smallerMobiles: 450,
10
+ };
11
+ }
@@ -1,15 +1,15 @@
1
1
  import { ProductType } from "../types/market/market.types";
2
-
2
+ //TODO:remover apos liberar em producao para a nova plataforma
3
3
  export enum PRODUCT_TYPE_ID {
4
4
  EXPERIENCES = 1,
5
5
  CUSTOMIZATION = 2,
6
6
  MATERIAL = 3,
7
7
  RAFFLE = 4,
8
- AUCTION = 5,
9
- DONATION = 6,
8
+ // AUCTION = 5,
9
+ // DONATION = 6,
10
10
  VOUCHER = 7,
11
11
  }
12
-
12
+ //TODO:remover apos liberar em producao para a nova plataforma
13
13
  export const PRODUCT_TYPE_BY_ID: {
14
14
  [key: number]: ProductType;
15
15
  } = {
@@ -17,8 +17,8 @@ export const PRODUCT_TYPE_BY_ID: {
17
17
  2: "customization",
18
18
  3: "material",
19
19
  4: "raffle",
20
- 5: "auction",
21
- 6: "donation",
20
+ // 5: "auction",
21
+ // 6: "donation",
22
22
  7: "voucher",
23
23
  };
24
24
 
@@ -75,5 +75,5 @@ export const MarketConstants = {
75
75
  PURCHASED_ORDERS_SORT_FILTER,
76
76
  PRODUCTS_PROJECTION_FILTER,
77
77
  PRODUCTS_SORT_FILTER,
78
- PURCHASED_ORDERS_STATUS_FILTER
78
+ PURCHASED_ORDERS_STATUS_FILTER,
79
79
  };
@@ -1,14 +1,13 @@
1
-
2
1
  interface IHierarchyLevelPermission {
3
- application: {
4
- _id: number;
5
- description: string;
6
- };
7
- _id: string;
8
- send: boolean;
9
- receive: boolean;
10
- create_groups: boolean;
11
- send_parent_immediate: boolean;
2
+ application: {
3
+ _id: number;
4
+ description: string;
5
+ };
6
+ _id: string;
7
+ send: boolean;
8
+ receive: boolean;
9
+ create_groups: boolean;
10
+ send_parent_immediate: boolean;
12
11
  }
13
12
  import { BaseRepositoryModel } from "./base.repository.model";
14
13
 
@@ -20,3 +19,11 @@ export class HierarchyLevelModel extends BaseRepositoryModel {
20
19
  weight: number;
21
20
  _id: string;
22
21
  }
22
+
23
+ export interface IUserHierarchy {
24
+ hierarchyLevel: HierarchyLevelModel;
25
+ name: string;
26
+ parents: string[];
27
+ _id: string;
28
+ identification: string;
29
+ }
@@ -354,6 +354,8 @@ export const ICON_HANDLES = [
354
354
  "arrow-right",
355
355
  "hifen",
356
356
  "showcase-thin",
357
+ "market-order-bold",
358
+ "market-order-thin",
357
359
  ] as const;
358
360
 
359
361
  export type IconHandle = (typeof ICON_HANDLES)[number];
@@ -134,5 +134,6 @@ export class UserSessionModel extends BaseRepositoryModel {
134
134
  canReceive: boolean;
135
135
  canSend: boolean;
136
136
  canSendToParentImmediate: boolean;
137
+ canSendToSuperiors: boolean;
137
138
  };
138
139
  }
@@ -162,8 +162,16 @@ export class BaseRepository {
162
162
  if (this.checkValidationSessionToken()) {
163
163
  config.headers.SessionKey = sessionKey;
164
164
  }
165
+ if (
166
+ BaseRepository._globalState.Global.RootApp.isValidSession ===
167
+ false
168
+ ) {
169
+ const cancelSource = axios.CancelToken.source();
170
+ config.cancelToken = cancelSource.token;
171
+ cancelSource.cancel("SessionKey is expired");
172
+ return config;
173
+ }
165
174
  }
166
-
167
175
  config.headers["x-system-id"] = BaseRepository._systemId;
168
176
 
169
177
  return config;
@@ -16,6 +16,7 @@ export interface IChatRepository {
16
16
  users: UserDTO.GetUserDTO[]
17
17
  ): Promise<void>;
18
18
  deleteConversation(conversationId: string): Promise<void>;
19
+ deleteConversationForAll(conversationId: string): Promise<void>;
19
20
  removeUserFromConversation(
20
21
  conversationId: string,
21
22
  robbysonUserId: number
@@ -1,6 +1,9 @@
1
- import { HierarchyLevelModel } from "../models";
1
+ import { HierarchyLevelModel, IUserHierarchy } from "../models";
2
2
  import { BaseRepository } from "./base.repository";
3
3
 
4
- export interface IHierarchyRepository extends BaseRepository{
4
+ export interface IHierarchyRepository extends BaseRepository {
5
5
  getHierarchy(): Promise<HierarchyLevelModel[]>;
6
+ getHierarchyByIdentification(
7
+ identification: string
8
+ ): Promise<IUserHierarchy>;
6
9
  }
@@ -21,6 +21,7 @@ export interface IChatService {
21
21
  users: UserDTO.GetUserDTO[]
22
22
  ): Promise<void>;
23
23
  deleteConversation(conversationId: string): Promise<void>;
24
+ deleteConversationForAll(conversationId: string): Promise<void>;
24
25
  removeUserFromConversation(
25
26
  conversationId: string,
26
27
  robbysonUserId: number
@@ -35,6 +35,7 @@ export interface IChatPermissions {
35
35
  canReceive: boolean;
36
36
  canSend: boolean;
37
37
  canSendToParentImmediate: boolean;
38
+ canSendToSuperiors: boolean;
38
39
  }
39
40
 
40
41
  export type ConversationType = "chat" | "group";
@@ -1,4 +1,8 @@
1
+ import { IUserHierarchy } from "../models";
2
+
1
3
  export interface IHierarchyService {
2
4
  getHierarchy(): Promise<void>;
5
+ getHierarchyByIdentification(
6
+ identification: string
7
+ ): Promise<IUserHierarchy>;
3
8
  }
4
-
@@ -15,5 +15,6 @@ export interface IQuizService {
15
15
  getHistory(): Promise<[QuizAnsweredModel[], QuizAnsweredModel[]]>;
16
16
  handleNotAnsweredQuiz(quizId?: string): Promise<boolean>;
17
17
  setQuiz(quiz: QuizModel): void;
18
+ clearQuiz(): void;
18
19
  getQuiz(quizId: string): QuizModel | null;
19
20
  }
@@ -9,4 +9,5 @@ export interface IUploadService {
9
9
  height?: number
10
10
  ): string;
11
11
  getRawFileUrl(imageName: string): string;
12
+ downloadFile(fileName: string): Promise<void>;
12
13
  }
@@ -1,9 +1,9 @@
1
1
  import { HumorLastModel, UserSessionModel } from "../models";
2
2
 
3
3
  export interface IValidationsService {
4
- checkTermsOfUse(sessionUser:UserSessionModel): boolean;
5
- checkHumor(sessionUser:UserSessionModel): Promise<boolean>;
4
+ checkTermsOfUse(sessionUser: UserSessionModel): Promise<boolean>;
5
+ checkHumor(sessionUser: UserSessionModel): Promise<boolean>;
6
6
  validateHumor(humor: HumorLastModel[]): boolean;
7
- checkDocuments(sessionUser:UserSessionModel): Promise<boolean>;
8
- checkQuiz(sessionUser:UserSessionModel): Promise<boolean>;
7
+ checkDocuments(sessionUser: UserSessionModel): Promise<boolean>;
8
+ checkQuiz(sessionUser: UserSessionModel): Promise<boolean>;
9
9
  }
@@ -13,9 +13,9 @@ export class RobbysonNavigate {
13
13
  RobbysonNavigate._globalStore.GetGlobalState();
14
14
 
15
15
  const { history } = RobbysonNavigate._globalState.Global.RootApp;
16
-
16
+ const routeState = { ...state, pathname: history.location.pathname };
17
17
  // TODO: Usar a LIB PATH para concatenar a URL
18
- history.push(`/operacao${url}`, state);
18
+ history.push(`/operacao${url}`, routeState);
19
19
  }
20
20
  static go(delta: number) {
21
21
  RobbysonNavigate._globalStore = GlobalStore.Get();