@genesislcap/foundation-auth 14.327.0 → 14.327.1-FUI-2395.1

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.
@@ -12,6 +12,7 @@ export declare class TermsConditions extends BaseRoute {
12
12
  termsVersion: string;
13
13
  isPdfData: boolean;
14
14
  pdfDataUrl: string;
15
+ isContentValid: boolean;
15
16
  private http;
16
17
  connectedCallback(): Promise<void>;
17
18
  private isBase64Pdf;
@@ -1 +1 @@
1
- {"version":3,"file":"terms-conditions.d.ts","sourceRoot":"","sources":["../../../../src/routes/terms-conditions/terms-conditions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC;;;;;;GAMG;AACH,qBAwCa,eAAgB,SAAQ,SAAS;IAChC,WAAW,EAAE,OAAO,CAAS;IAC7B,SAAS,EAAE,MAAM,CAAqC;IACtD,YAAY,EAAE,MAAM,CAAM;IAC1B,SAAS,EAAE,OAAO,CAAS;IAC3B,UAAU,EAAE,MAAM,CAAM;IAC9B,OAAO,CAAC,IAAI,CAAO;IAEnB,iBAAiB;IAKvB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,gBAAgB;IAWlB,sBAAsB;IA8BtB,QAAQ;IASd,IACI,WAAW,WAEd;CACF"}
1
+ {"version":3,"file":"terms-conditions.d.ts","sourceRoot":"","sources":["../../../../src/routes/terms-conditions/terms-conditions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC;;;;;;GAMG;AACH,qBAwCa,eAAgB,SAAQ,SAAS;IAChC,WAAW,EAAE,OAAO,CAAS;IAC7B,SAAS,EAAE,MAAM,CAAqC;IACtD,YAAY,EAAE,MAAM,CAAM;IAC1B,SAAS,EAAE,OAAO,CAAS;IAC3B,UAAU,EAAE,MAAM,CAAM;IACxB,cAAc,EAAE,OAAO,CAAQ;IACrC,OAAO,CAAC,IAAI,CAAO;IAEnB,iBAAiB;IAKvB,OAAO,CAAC,WAAW;IAmBnB,OAAO,CAAC,gBAAgB;IAWlB,sBAAsB;IA+CtB,QAAQ;IASd,IACI,WAAW,WAEd;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"terms-conditions.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/terms-conditions/terms-conditions.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,sEA6CnC,CAAC"}
1
+ {"version":3,"file":"terms-conditions.template.d.ts","sourceRoot":"","sources":["../../../../src/routes/terms-conditions/terms-conditions.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,sEAkDnC,CAAC"}
@@ -20,6 +20,7 @@ let TermsConditions = class TermsConditions extends BaseRoute {
20
20
  this.termsVersion = '';
21
21
  this.isPdfData = false;
22
22
  this.pdfDataUrl = '';
23
+ this.isContentValid = true;
23
24
  }
24
25
  connectedCallback() {
25
26
  const _super = Object.create(null, {
@@ -65,9 +66,14 @@ let TermsConditions = class TermsConditions extends BaseRoute {
65
66
  try {
66
67
  const url = `gwf/auth/terms-and-conditions`;
67
68
  const userName = this.store.formEntry.orgUsername || this.store.formEntry.username;
68
- const data = (yield this.http
69
- .get(url, { headers: { Accept: 'application/json', ['USER_NAME']: userName } })
70
- .catch(() => ({})));
69
+ logger.debug('Loading terms and conditions for user:', userName);
70
+ const data = yield this.http.get(url, {
71
+ headers: {
72
+ Accept: 'application/json',
73
+ ['USER_NAME']: userName,
74
+ },
75
+ });
76
+ logger.debug('Terms and conditions response:', data);
71
77
  const record = Array.isArray(data) ? data[0] : data;
72
78
  const content = (record === null || record === void 0 ? void 0 : record.CONTENT) || '';
73
79
  // Check if content is base64 encoded PDF data
@@ -75,19 +81,27 @@ let TermsConditions = class TermsConditions extends BaseRoute {
75
81
  this.isPdfData = true;
76
82
  this.pdfDataUrl = this.createPdfDataUrl(content);
77
83
  this.termsText = 'PDF Terms and Conditions loaded';
84
+ this.isContentValid = true;
85
+ logger.debug('PDF content loaded successfully');
78
86
  }
79
87
  else {
80
88
  this.isPdfData = false;
81
89
  this.pdfDataUrl = '';
82
90
  this.termsText = content || 'No terms and conditions available';
91
+ this.isContentValid = !!(content && content.trim().length > 0);
92
+ logger.debug('Text content loaded:', {
93
+ hasContent: !!content,
94
+ contentLength: content === null || content === void 0 ? void 0 : content.length,
95
+ });
83
96
  }
84
97
  this.termsVersion = (record === null || record === void 0 ? void 0 : record.VERSION) || '';
85
98
  }
86
99
  catch (error) {
87
- logger.error('Failed to load terms and conditions:', error);
88
- this.termsText = 'Failed to load terms and conditions. Please try again.';
100
+ logger.debug('Failed to load terms and conditions:', error);
101
+ this.termsText = 'Failed to load terms and conditions. Please refresh or contanct support.';
89
102
  this.isPdfData = false;
90
103
  this.pdfDataUrl = '';
104
+ this.isContentValid = false;
91
105
  }
92
106
  });
93
107
  }
@@ -120,6 +134,9 @@ __decorate([
120
134
  __decorate([
121
135
  observable
122
136
  ], TermsConditions.prototype, "pdfDataUrl", void 0);
137
+ __decorate([
138
+ observable
139
+ ], TermsConditions.prototype, "isContentValid", void 0);
123
140
  __decorate([
124
141
  Http
125
142
  ], TermsConditions.prototype, "http", void 0);
@@ -40,7 +40,7 @@ export const TermsConditionsTemplate = html `
40
40
  :innerHTML="${(x) => x.toLocalisedText('TERMS_AND_CONDITIONS_HTML')}"
41
41
  ></rapid-checkbox>
42
42
  <div class="form-buttons">
43
- ${(x) => submitButton(x.toLocalisedText('ACCEPT'), 'submit', !x.termsAgreed)}
43
+ ${(x) => submitButton(x.toLocalisedText('ACCEPT'), 'submit', !x.termsAgreed || !x.isContentValid)}
44
44
  ${(x) => backButton(() => x.onBack(), x.toLocalisedText('DECLINE'))}
45
45
  </div>
46
46
  <submitting-indicator is-submitting="${(x) => x.store.isPending}"></submitting-indicator>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-auth",
3
3
  "description": "Genesis Foundation Auth",
4
- "version": "14.327.0",
4
+ "version": "14.327.1-FUI-2395.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-auth.d.ts",
@@ -127,25 +127,25 @@
127
127
  }
128
128
  },
129
129
  "devDependencies": {
130
- "@genesislcap/foundation-testing": "14.327.0",
131
- "@genesislcap/genx": "14.327.0",
132
- "@genesislcap/rollup-builder": "14.327.0",
133
- "@genesislcap/ts-builder": "14.327.0",
134
- "@genesislcap/uvu-playwright-builder": "14.327.0",
135
- "@genesislcap/vite-builder": "14.327.0",
136
- "@genesislcap/webpack-builder": "14.327.0"
130
+ "@genesislcap/foundation-testing": "14.327.1-FUI-2395.1",
131
+ "@genesislcap/genx": "14.327.1-FUI-2395.1",
132
+ "@genesislcap/rollup-builder": "14.327.1-FUI-2395.1",
133
+ "@genesislcap/ts-builder": "14.327.1-FUI-2395.1",
134
+ "@genesislcap/uvu-playwright-builder": "14.327.1-FUI-2395.1",
135
+ "@genesislcap/vite-builder": "14.327.1-FUI-2395.1",
136
+ "@genesislcap/webpack-builder": "14.327.1-FUI-2395.1"
137
137
  },
138
138
  "dependencies": {
139
- "@genesislcap/foundation-comms": "14.327.0",
140
- "@genesislcap/foundation-events": "14.327.0",
141
- "@genesislcap/foundation-i18n": "14.327.0",
142
- "@genesislcap/foundation-logger": "14.327.0",
143
- "@genesislcap/foundation-state-machine": "14.327.0",
144
- "@genesislcap/foundation-store": "14.327.0",
145
- "@genesislcap/foundation-ui": "14.327.0",
146
- "@genesislcap/foundation-user": "14.327.0",
147
- "@genesislcap/foundation-utils": "14.327.0",
148
- "@genesislcap/foundation-zero": "14.327.0",
139
+ "@genesislcap/foundation-comms": "14.327.1-FUI-2395.1",
140
+ "@genesislcap/foundation-events": "14.327.1-FUI-2395.1",
141
+ "@genesislcap/foundation-i18n": "14.327.1-FUI-2395.1",
142
+ "@genesislcap/foundation-logger": "14.327.1-FUI-2395.1",
143
+ "@genesislcap/foundation-state-machine": "14.327.1-FUI-2395.1",
144
+ "@genesislcap/foundation-store": "14.327.1-FUI-2395.1",
145
+ "@genesislcap/foundation-ui": "14.327.1-FUI-2395.1",
146
+ "@genesislcap/foundation-user": "14.327.1-FUI-2395.1",
147
+ "@genesislcap/foundation-utils": "14.327.1-FUI-2395.1",
148
+ "@genesislcap/foundation-zero": "14.327.1-FUI-2395.1",
149
149
  "@microsoft/fast-components": "2.30.6",
150
150
  "@microsoft/fast-element": "1.14.0",
151
151
  "@microsoft/fast-foundation": "2.49.6",
@@ -165,5 +165,5 @@
165
165
  "publishConfig": {
166
166
  "access": "public"
167
167
  },
168
- "gitHead": "b56a8d346f8f3b0596656e2ec9e30d5c1ffe448f"
168
+ "gitHead": "457e3e075c92a24960fbe2154ac1651bee92ea8e"
169
169
  }