@griddo/ax 11.11.7-rc.0 → 11.11.7

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "11.11.7-rc.0",
4
+ "version": "11.11.7",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -217,5 +217,5 @@
217
217
  "publishConfig": {
218
218
  "access": "public"
219
219
  },
220
- "gitHead": "8b7d5ecf70920b98364c6207ff6079a7af98b430"
220
+ "gitHead": "fbc174c8e5a11c8591134ef76fdfe00dfb6ce514"
221
221
  }
@@ -85,7 +85,10 @@ const SharePageModal = (props: SharePageModalProps): JSX.Element | null => {
85
85
  if (showActions) {
86
86
  return {
87
87
  main: { title: "renew link", onClick: handleRenew, disabled: loading, icon: "refresh" },
88
- secondary: { title: "cancel", onClick: () => setShowActions(false) },
88
+ secondary: {
89
+ title: "cancel",
90
+ onClick: () => handleHide(),
91
+ },
89
92
  };
90
93
  }
91
94
  return { main: undefined, secondary: undefined };
@@ -97,7 +100,7 @@ const SharePageModal = (props: SharePageModalProps): JSX.Element | null => {
97
100
  <>
98
101
  <Modal
99
102
  isOpen={isOpen}
100
- hide={hide}
103
+ hide={handleHide}
101
104
  size="S"
102
105
  height="auto"
103
106
  title="Share Draft"
@@ -139,6 +142,14 @@ const SharePageModal = (props: SharePageModalProps): JSX.Element | null => {
139
142
  detail={`Expired on ${tokenInfo.tokenExpirationDate}`}
140
143
  mode="warning"
141
144
  />
145
+ ) : tokenInfo.tokenExpiringSoon ? (
146
+ <StatusTile
147
+ icon="user"
148
+ title={renewalPreview ? "Valid" : "Expiring soon"}
149
+ description={`${renewalPreview ? renewalPreview.days : tokenInfo.validTokenDaysUntilExpires} days`}
150
+ detail={`Expires ${renewalPreview ? renewalPreview.date : tokenInfo.tokenExpirationDate}`}
151
+ mode={renewalPreview ? "info" : "warning"}
152
+ />
142
153
  ) : (
143
154
  <StatusTile
144
155
  icon="user"
@@ -1,7 +1,7 @@
1
1
  import styled from "styled-components";
2
2
 
3
3
  const ModalContent = styled.div`
4
- padding: ${({ theme }) => `${theme.spacing.m} ${theme.spacing.m}`};
4
+ padding: ${({ theme }) => `${theme.spacing.s} ${theme.spacing.m}`};
5
5
  `;
6
6
 
7
7
  const Description = styled.p`
@@ -23,7 +23,8 @@ const LoaderWrapper = styled.div`
23
23
  `;
24
24
 
25
25
  const RenewTextButton = styled.div`
26
- margin-top: 32px;
26
+ margin-top: 24px;
27
+ margin-bottom: 8px;
27
28
  `;
28
29
 
29
30
  const PreviewLinkWrapper = styled.div<{ expired?: boolean }>`
@@ -5,9 +5,10 @@ import { differenceInCalendarDays, isBefore } from "date-fns";
5
5
  import { formatDate } from "./dates";
6
6
 
7
7
  const TOKEN_CAN_BE_RENEWED_DAYS = 14;
8
+ const TOKEN_EXPIRING_SOON_DAYS = 3;
8
9
 
9
10
  // DEV ONLY — set a future/past date to simulate token states, then revert to undefined
10
- export const DEV_NOW: Date | undefined = undefined; // new Date("2036-04-13");
11
+ export const DEV_NOW: Date | undefined = undefined; // new Date("2026-08-06");
11
12
 
12
13
  export const getShareTokenInfo = (shareData: IShareData, now = new Date()) => {
13
14
  const expirationDate = new Date(shareData.endDate);
@@ -18,6 +19,7 @@ export const getShareTokenInfo = (shareData: IShareData, now = new Date()) => {
18
19
  tokenExpirationDate: formatDate(expirationDate),
19
20
  tokenHasExpired,
20
21
  tokenCanBeRenewed: !tokenHasExpired && validTokenDaysUntilExpires < TOKEN_CAN_BE_RENEWED_DAYS,
22
+ tokenExpiringSoon: !tokenHasExpired && validTokenDaysUntilExpires <= TOKEN_EXPIRING_SOON_DAYS,
21
23
  validTokenDaysUntilExpires,
22
24
  };
23
25
  };