@ministryofjustice/hmpps-digital-prison-reporting-frontend 3.26.3 → 3.26.4

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.
@@ -1411,6 +1411,7 @@ class ShowMore extends DprClientClass {
1411
1411
  if (textContent.length > length) {
1412
1412
  textContainer.innerHTML = `${shortString}... `;
1413
1413
  } else {
1414
+ textContainer.innerHTML = `${textContent}`;
1414
1415
  button.style.display = 'none';
1415
1416
  }
1416
1417
 
@@ -29,7 +29,7 @@ exports.default = {
29
29
  name,
30
30
  description,
31
31
  type: 'report',
32
- reportDescription,
32
+ ...(reportDescription && reportDescription.length && { reportDescription }),
33
33
  };
34
34
  });
35
35
  let dashboardsArray = [];
@@ -48,7 +48,7 @@ export default {
48
48
  name,
49
49
  description,
50
50
  type: 'report',
51
- reportDescription,
51
+ ...(reportDescription && reportDescription.length && { reportDescription }),
52
52
  }
53
53
  })
54
54
 
@@ -39,7 +39,7 @@ class MetricsClient {
39
39
  logger_1.default.info(`Metrics client: Get metricId:${metricId} data`);
40
40
  return this.restClient
41
41
  .get({
42
- path: `reports/${dpdId}/metrics/${metricId}`,
42
+ path: `/reports/${dpdId}/metrics/${metricId}`,
43
43
  token,
44
44
  })
45
45
  .then((response) => response);
@@ -46,7 +46,7 @@ export default class MetricsClient {
46
46
 
47
47
  return this.restClient
48
48
  .get({
49
- path: `reports/${dpdId}/metrics/${metricId}`,
49
+ path: `/reports/${dpdId}/metrics/${metricId}`,
50
50
  token,
51
51
  })
52
52
  .then((response) => <MetricsDataResponse>response)
@@ -26,7 +26,7 @@ exports.getMeta = getMeta;
26
26
  const createShowMoreHtml = (text, length) => {
27
27
  const sanitizedString = text ? text.replace(/"/g, "'") : '';
28
28
  const stringLength = length || 200;
29
- const displayString = sanitizedString.length < stringLength ? sanitizedString : '';
29
+ const displayString = sanitizedString.length <= stringLength ? sanitizedString : '';
30
30
  return `<div class="dpr-show-more" data-content="${sanitizedString}" data-dpr-module="show-more" data-length="${stringLength}">
31
31
  <p class="govuk-body-s govuk-!-margin-bottom-0"><span class='dpr-show-more-content'>${displayString}</span><a class="dpr-show-hide-button" href="#">show more</a></p>
32
32
  </div>`;
@@ -27,7 +27,8 @@ export const getMeta = (cardData: CardData[]) => {
27
27
  export const createShowMoreHtml = (text: string, length?: number) => {
28
28
  const sanitizedString = text ? text.replace(/"/g, "'") : ''
29
29
  const stringLength = length || 200
30
- const displayString = sanitizedString.length < stringLength ? sanitizedString : ''
30
+ const displayString = sanitizedString.length <= stringLength ? sanitizedString : ''
31
+
31
32
  return `<div class="dpr-show-more" data-content="${sanitizedString}" data-dpr-module="show-more" data-length="${stringLength}">
32
33
  <p class="govuk-body-s govuk-!-margin-bottom-0"><span class='dpr-show-more-content'>${displayString}</span><a class="dpr-show-hide-button" href="#">show more</a></p>
33
34
  </div>`
@@ -3,11 +3,6 @@
3
3
  {% extends layoutPath %}
4
4
  {% set mainClasses = "app-container govuk-body" %}
5
5
  {% block content %}
6
- {# TODO: 👇🏽 These scripts need to go into the main UI and tools 👇🏽 #}
7
- <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.4/dist/chart.umd.min.js"></script>
8
- <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0"></script>
9
- {# TODO: 👆 These scripts need to go into the main UI and tools 👆 #}
10
-
11
6
  <h1>{{ title }}</h1>
12
7
  <p class="govuk-body">{{ description }}</p>
13
8
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ministryofjustice/hmpps-digital-prison-reporting-frontend",
3
3
  "description": "The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.",
4
- "version": "3.26.3",
4
+ "version": "3.26.4",
5
5
  "main": "dpr/assets/js/all.mjs",
6
6
  "sass": "dpr/all.scss",
7
7
  "engines": {
package/package.zip CHANGED
Binary file