@truedat/dd 7.5.5 → 7.5.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "7.5.5",
3
+ "version": "7.5.6",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.16.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "7.5.5",
37
+ "@truedat/test": "7.5.6",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -88,9 +88,9 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@apollo/client": "^3.7.1",
91
- "@truedat/auth": "7.5.5",
92
- "@truedat/core": "7.5.5",
93
- "@truedat/df": "7.5.5",
91
+ "@truedat/auth": "7.5.6",
92
+ "@truedat/core": "7.5.6",
93
+ "@truedat/df": "7.5.6",
94
94
  "lodash": "^4.17.21",
95
95
  "moment": "^2.29.4",
96
96
  "path-to-regexp": "^1.7.0",
@@ -115,5 +115,5 @@
115
115
  "react-dom": ">= 16.8.6 < 17",
116
116
  "semantic-ui-react": ">= 2.0.3 < 2.2"
117
117
  },
118
- "gitHead": "2a4343b3b2837540358b57d3d647408ab292aa21"
118
+ "gitHead": "23d70104f45068aea9795621334ee2df022d21b2"
119
119
  }
@@ -32,6 +32,10 @@ export const GrantRequest = ({ grantRequest, template }) => {
32
32
  const user = grantRequest?._embedded?.group?._embedded?.user?.user_name;
33
33
  const createdBy =
34
34
  grantRequest?._embedded?.group?._embedded?.created_by?.user_name;
35
+
36
+ const showReason =
37
+ _.includes(grantRequest?.status)(["processing", "processed", "failed"]) &&
38
+ !_.isEmpty(grantRequest?.status_reason);
35
39
  return (
36
40
  <>
37
41
  <GenericCrumbs
@@ -43,7 +47,7 @@ export const GrantRequest = ({ grantRequest, template }) => {
43
47
  <Segment>
44
48
  <GrantRequestHeader />
45
49
  <List size="big" relaxed="very">
46
- {data_structure && (
50
+ {data_structure ? (
47
51
  <List.Item>
48
52
  <List.Content>
49
53
  <List.Header>
@@ -55,7 +59,7 @@ export const GrantRequest = ({ grantRequest, template }) => {
55
59
  <Link to={linkTo.STRUCTURE(data_structure)}>{path}</Link>
56
60
  </List.Description>
57
61
  </List.Content>
58
- {rows && (
62
+ {rows ? (
59
63
  <List size="small">
60
64
  <List.Item>
61
65
  <ConditionSummary
@@ -65,9 +69,9 @@ export const GrantRequest = ({ grantRequest, template }) => {
65
69
  />
66
70
  </List.Item>
67
71
  </List>
68
- )}
72
+ ) : null}
69
73
  </List.Item>
70
- )}
74
+ ) : null}
71
75
  {user && (
72
76
  <List.Item>
73
77
  <List.Header>
@@ -78,7 +82,7 @@ export const GrantRequest = ({ grantRequest, template }) => {
78
82
  </List.Description>
79
83
  </List.Item>
80
84
  )}
81
- {createdBy && createdBy !== user && (
85
+ {createdBy && createdBy !== user ? (
82
86
  <List.Item>
83
87
  <List.Header>
84
88
  {formatMessage({ id: "grantRequest.header.createdBy" })}
@@ -87,7 +91,7 @@ export const GrantRequest = ({ grantRequest, template }) => {
87
91
  <Label>{createdBy}</Label>
88
92
  </List.Description>
89
93
  </List.Item>
90
- )}
94
+ ) : null}
91
95
  <List.Item>
92
96
  <List.Header>
93
97
  {formatMessage({ id: "grantRequest.header.status" })}
@@ -100,13 +104,28 @@ export const GrantRequest = ({ grantRequest, template }) => {
100
104
  </Label>
101
105
  </List.Description>
102
106
  </List.Item>
107
+ {showReason ? (
108
+ <List.Item>
109
+ <List.Header>
110
+ {formatMessage({ id: "grantRequest.header.reason" })}
111
+ </List.Header>
112
+ <List.Description>
113
+ <Label>
114
+ {formatMessage({
115
+ id: `grantRequest.content.${grantRequest?.status_reason}`,
116
+ defaultMessage: grantRequest?.status_reason,
117
+ })}
118
+ </Label>
119
+ </List.Description>
120
+ </List.Item>
121
+ ) : null}
103
122
  </List>
104
- {dynamic_content && template && (
123
+ {dynamic_content && template ? (
105
124
  <DynamicFormViewer
106
125
  template={template}
107
126
  content={dynamic_content}
108
127
  />
109
- )}
128
+ ) : null}
110
129
  </Segment>
111
130
  </Grid.Column>
112
131
  <Grid.Column width={4}>
@@ -44,8 +44,8 @@ export const Edge = ({ structureId, structureLink }) => (
44
44
  structureId === structureLink?.source.id
45
45
  ? "M 0,10 h 90"
46
46
  : structureId === structureLink?.target.id
47
- ? "M 95,10 h -90"
48
- : ""
47
+ ? "M 95,10 h -90"
48
+ : ""
49
49
  }
50
50
  strokeWidth="1"
51
51
  stroke="#871f1f"
@@ -139,8 +139,8 @@ export const StructureStructureLinks = ({
139
139
  structureId !== structureLink?.source.id
140
140
  ? structureLink.source
141
141
  : structureId !== structureLink?.target.id
142
- ? structureLink.target
143
- : null,
142
+ ? structureLink.target
143
+ : null,
144
144
  (relatedStructure) => (
145
145
  <StructureCrumbs
146
146
  {...{
@@ -74,6 +74,7 @@ describe("<GrantRequest />", () => {
74
74
  "ruleImplementations.summary.headers.filters": "filters",
75
75
  },
76
76
  },
77
+ fallback: "lazy",
77
78
  };
78
79
 
79
80
  it("matches the latest snapshot", () => {
@@ -120,7 +121,7 @@ describe("<GrantRequest />", () => {
120
121
 
121
122
  const { container } = render(
122
123
  <Suspense fallback={null}>
123
- <GrantRequest {...{ ...props, failedGrantRequest }} />
124
+ <GrantRequest {...{ ...props, grantRequest: failedGrantRequest }} />
124
125
  </Suspense>,
125
126
  renderOpts
126
127
  );
@@ -496,98 +496,23 @@ exports[`<GrantRequest /> matches the latest snapshot with failed status 1`] = `
496
496
  </a>
497
497
  </div>
498
498
  </div>
499
+ </div>
500
+ <div
501
+ class="item"
502
+ role="listitem"
503
+ >
499
504
  <div
500
- class="ui small list"
501
- role="list"
505
+ class="header"
506
+ >
507
+ user
508
+ </div>
509
+ <div
510
+ class="description"
502
511
  >
503
512
  <div
504
- class="item"
505
- role="listitem"
513
+ class="ui label"
506
514
  >
507
- <h3
508
- class="ui header"
509
- >
510
- <i
511
- aria-hidden="true"
512
- class="setting small icon"
513
- />
514
- <div
515
- class="content"
516
- >
517
- filters
518
- </div>
519
- </h3>
520
- <div
521
- class="ui segment"
522
- >
523
- <table
524
- class="ui very basic table condition-summary"
525
- >
526
- <thead
527
- class=""
528
- >
529
- <tr
530
- class=""
531
- >
532
- <th
533
- class=""
534
- >
535
- field
536
- </th>
537
- <th
538
- class=""
539
- >
540
- operator
541
- </th>
542
- <th
543
- class=""
544
- >
545
- values
546
- </th>
547
- </tr>
548
- </thead>
549
- <tbody
550
- class=""
551
- >
552
- <tr
553
- class=""
554
- >
555
- <td
556
- class="five wide"
557
- >
558
- <a
559
- href="/structures/1"
560
- >
561
- <div
562
- class="highlighted"
563
- >
564
- foo
565
- </div>
566
-
567
- </a>
568
- </td>
569
- <td
570
- class="five wide"
571
- >
572
- <span
573
- class="highlighted"
574
- >
575
- "eq"
576
- </span>
577
- </td>
578
- <td
579
- class="five wide"
580
- >
581
- <span
582
- class="highlighted"
583
- >
584
- "2021-10-05 08:15:00 "
585
- </span>
586
- </td>
587
- </tr>
588
- </tbody>
589
- </table>
590
- </div>
515
+ user
591
516
  </div>
592
517
  </div>
593
518
  </div>
@@ -598,7 +523,7 @@ exports[`<GrantRequest /> matches the latest snapshot with failed status 1`] = `
598
523
  <div
599
524
  class="header"
600
525
  >
601
- user
526
+ status
602
527
  </div>
603
528
  <div
604
529
  class="description"
@@ -606,7 +531,7 @@ exports[`<GrantRequest /> matches the latest snapshot with failed status 1`] = `
606
531
  <div
607
532
  class="ui label"
608
533
  >
609
- user
534
+ Failed
610
535
  </div>
611
536
  </div>
612
537
  </div>
@@ -617,7 +542,7 @@ exports[`<GrantRequest /> matches the latest snapshot with failed status 1`] = `
617
542
  <div
618
543
  class="header"
619
544
  >
620
- status
545
+ grantRequest.header.reason
621
546
  </div>
622
547
  <div
623
548
  class="description"
@@ -625,7 +550,7 @@ exports[`<GrantRequest /> matches the latest snapshot with failed status 1`] = `
625
550
  <div
626
551
  class="ui label"
627
552
  >
628
- pending
553
+ there is always a reason
629
554
  </div>
630
555
  </div>
631
556
  </div>