datastake-daf 0.6.600 → 0.6.602

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.
@@ -7597,6 +7597,9 @@ const Style$1 = dt.div`
7597
7597
 
7598
7598
  .select-navbar {
7599
7599
  padding: 0 .75rem;
7600
+ display: flex;
7601
+ align-items: center;
7602
+ gap: 0;
7600
7603
 
7601
7604
  div {
7602
7605
  width: 4.625rem;
@@ -7608,6 +7611,17 @@ const Style$1 = dt.div`
7608
7611
  cursor: pointer;
7609
7612
  }
7610
7613
 
7614
+ .chevron-icon {
7615
+ color: #193E61;
7616
+ transition: transform 0.3s ease;
7617
+ cursor: pointer;
7618
+ flex-shrink: 0;
7619
+
7620
+ &.rotated {
7621
+ transform: rotate(180deg);
7622
+ }
7623
+ }
7624
+
7611
7625
  .country-cont {
7612
7626
  justify-content: center;
7613
7627
  gap: 0.6rem;
@@ -7810,13 +7824,27 @@ const Select = ({
7810
7824
  };
7811
7825
  }, [toggled]);
7812
7826
  return /*#__PURE__*/jsxRuntime.jsxs(Style$1, {
7813
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
7827
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
7814
7828
  className: formatClassname(['select-navbar', bordered && 'bordered']),
7815
7829
  onClick: () => setToggled(p => !p),
7816
7830
  ref: ref,
7817
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
7831
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
7818
7832
  children: valueLabel
7819
- })
7833
+ }), /*#__PURE__*/jsxRuntime.jsx("svg", {
7834
+ className: formatClassname(['chevron-icon', toggled && 'rotated']),
7835
+ width: "16",
7836
+ height: "16",
7837
+ viewBox: "0 0 16 16",
7838
+ fill: "none",
7839
+ xmlns: "http://www.w3.org/2000/svg",
7840
+ children: /*#__PURE__*/jsxRuntime.jsx("path", {
7841
+ d: "M4 6L8 10L12 6",
7842
+ stroke: "currentColor",
7843
+ strokeWidth: "2",
7844
+ strokeLinecap: "round",
7845
+ strokeLinejoin: "round"
7846
+ })
7847
+ })]
7820
7848
  }), visible && /*#__PURE__*/jsxRuntime.jsx(Options, {
7821
7849
  value: value,
7822
7850
  secondRef: ref,
@@ -7782,6 +7782,24 @@ const mapModulesFromApps = (user, APP) => {
7782
7782
  }, {});
7783
7783
  }
7784
7784
  };
7785
+ function getRedirectPath(user, fallback = '', app, isDatastake) {
7786
+ if (user.approvalStatus === "pending") {
7787
+ const modules = Object.keys(user.modules);
7788
+ const _app = modules[0] || app;
7789
+ if (_app) {
7790
+ return `/${_app}/confirm`;
7791
+ }
7792
+ }
7793
+ if (user.modules && Object.keys(user.modules).length) {
7794
+ const modules = Object.keys(user.modules);
7795
+ const f = (fallback || '')[0] === '/' ? (fallback || '').substring(1) : fallback || '';
7796
+ const fallbackRoute = f.split('/');
7797
+ if (fallbackRoute.length > 1 && fallbackRoute[0] === 'app' && modules.includes(fallbackRoute[1])) {
7798
+ return fallback;
7799
+ }
7800
+ }
7801
+ return isDatastake ? `/${app}/app` : '/app';
7802
+ }
7785
7803
 
7786
7804
  const en = {
7787
7805
  "No planning required": "No planning required",
@@ -14092,6 +14110,7 @@ exports.getOptionConfig = getOptionConfig;
14092
14110
  exports.getOptionLabel = getOptionLabel;
14093
14111
  exports.getRangeOfTicks = getRangeOfTicks;
14094
14112
  exports.getRedirectLink = getRedirectLink;
14113
+ exports.getRedirectPath = getRedirectPath;
14095
14114
  exports.getTagColor = getTagColor;
14096
14115
  exports.getToken = getToken;
14097
14116
  exports.groupSubsections = groupSubsections;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.600",
3
+ "version": "0.6.602",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -126,6 +126,22 @@ export const Select = ({
126
126
  ref={ref}
127
127
  >
128
128
  <div>{valueLabel}</div>
129
+ <svg
130
+ className={formatClassname(['chevron-icon', toggled && 'rotated'])}
131
+ width="16"
132
+ height="16"
133
+ viewBox="0 0 16 16"
134
+ fill="none"
135
+ xmlns="http://www.w3.org/2000/svg"
136
+ >
137
+ <path
138
+ d="M4 6L8 10L12 6"
139
+ stroke="currentColor"
140
+ strokeWidth="2"
141
+ strokeLinecap="round"
142
+ strokeLinejoin="round"
143
+ />
144
+ </svg>
129
145
  </div>
130
146
  {visible && (
131
147
  <Options
@@ -27,6 +27,9 @@ const Style = styled.div`
27
27
 
28
28
  .select-navbar {
29
29
  padding: 0 .75rem;
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 0;
30
33
 
31
34
  div {
32
35
  width: 4.625rem;
@@ -38,6 +41,17 @@ const Style = styled.div`
38
41
  cursor: pointer;
39
42
  }
40
43
 
44
+ .chevron-icon {
45
+ color: #193E61;
46
+ transition: transform 0.3s ease;
47
+ cursor: pointer;
48
+ flex-shrink: 0;
49
+
50
+ &.rotated {
51
+ transform: rotate(180deg);
52
+ }
53
+ }
54
+
41
55
  .country-cont {
42
56
  justify-content: center;
43
57
  gap: 0.6rem;
@@ -170,4 +170,26 @@ export const mapModulesFromApps = (user, APP) => {
170
170
  return all;
171
171
  }, {});
172
172
  }
173
- };
173
+ };
174
+
175
+ export function getRedirectPath(user, fallback = '', app, isDatastake) {
176
+ if (user.approvalStatus === "pending") {
177
+ const modules = Object.keys(user.modules);
178
+ const _app = modules[0] || app;
179
+
180
+ if (_app) {
181
+ return `/${_app}/confirm`;
182
+ }
183
+ }
184
+
185
+ if (user.modules && Object.keys(user.modules).length) {
186
+ const modules = Object.keys(user.modules);
187
+ const f = (fallback || '')[0] === '/' ? (fallback || '').substring(1) : (fallback || '');
188
+ const fallbackRoute = f.split('/');
189
+ if (fallbackRoute.length > 1 && fallbackRoute[0] === 'app' && modules.includes(fallbackRoute[1])) {
190
+ return fallback;
191
+ }
192
+ }
193
+
194
+ return isDatastake ? `/${app}/app` : '/app';
195
+ }
package/src/utils.js CHANGED
@@ -21,7 +21,7 @@ export { getOptionConfig, getOptionLabel } from './@daf/core/components/DynamicV
21
21
 
22
22
  export { defaultMapConfig } from './@daf/hooks/useMapHelper.js';
23
23
 
24
- export { getInterface, modules, isSuperAdmin, isModuleApproved, userHasInterface, userIsAdmin, createModule, mapModulesFromApps } from './helpers/user.js'
24
+ export { getInterface, modules, isSuperAdmin, isModuleApproved, userHasInterface, userIsAdmin, createModule, mapModulesFromApps, getRedirectPath } from './helpers/user.js'
25
25
 
26
26
  export { default as locales } from './constants/locales/index.js';
27
27