@corpsmap/corpsmap 3.2.83 → 3.2.90

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,78 +12,109 @@ class ResourcesModal extends React.Component {
12
12
  const { doModalClose } = this.props;
13
13
  doModalClose();
14
14
  }
15
-
15
+
16
16
  render() {
17
17
  function filterResourceItems(resourceItems, groupId) {
18
- let items = resourceItems.filter(item => item.resource_group_id !== null && item.resource_group_id === groupId);
19
- items = items.sort((a,b) => a.resource_sort - b.resource_sort);
18
+ let items = resourceItems.filter(
19
+ (item) =>
20
+ item.resource_group_id !== null && item.resource_group_id === groupId
21
+ );
22
+ items = items.sort((a, b) => a.resource_sort - b.resource_sort);
20
23
  return items;
21
24
  }
22
- const { theme, doGetResourceData, resourceItems, resourceGroups} = this.props;
25
+ const { theme, doGetResourceData, resourceItems, resourceGroups } =
26
+ this.props;
23
27
  let groups = [];
24
-
25
- groups = resourceGroups.map(item => {
26
- let url = `${process.env.REACT_APP_FUDS_RESOURCE_GROUP_IMAGE_URL}` + item.groupId;
28
+
29
+ groups = resourceGroups.map((item) => {
30
+ let url =
31
+ `${process.env.REACT_APP_FUDS_RESOURCE_GROUP_IMAGE_URL}` + item.groupId;
27
32
  let documentURL = `${process.env.REACT_APP_FUDS_RESOURCE_DOCUMENT_URL}`;
28
33
 
29
34
  return (
30
- <div key={"image"+item.groupId} style={{ paddingLeft: "25px", fontSize: "20px", fontWeight: "bold" }}>
31
- <span key={"span"+item.groupId}>
32
- <img key={"imageID"+item.groupId} src={url} width="50px" height="50px" onError={({ currentTarget}) => { currentTarget.onerror = null; currentTarget.style.display = "none";}}/>
35
+ <div
36
+ key={"image" + item.groupId}
37
+ style={{ paddingLeft: "25px", fontSize: "20px", fontWeight: "bold" }}
38
+ >
39
+ <span key={"span" + item.groupId}>
40
+ <img
41
+ key={"imageID" + item.groupId}
42
+ src={url}
43
+ width="50px"
44
+ height="50px"
45
+ onError={({ currentTarget }) => {
46
+ currentTarget.onerror = null;
47
+ currentTarget.style.display = "none";
48
+ }}
49
+ />
33
50
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
34
51
  {item.groupName}
35
52
  </span>
36
53
  <br></br>
37
- <div key={"itemDivID"+item.groupId} style={{paddingLeft: "25px", fontSize: "16px"}}>
38
- <table className="table" key={"tableID"+item.groupId} >
39
- <thead>
40
- <tr key={item.groupId + 7777777777}>
41
- <th className>
42
- Description
43
- </th>
44
- <th className>
45
- URL
46
- </th>
47
- </tr>
48
- </thead>
49
- <tbody>
50
- {filterResourceItems(resourceItems, item.groupId).map((item) => (
51
- <tr key={item.resource_id}>
52
- <td className="col-sm-4">{item.description}</td>
53
- <td className="col-sm-4">
54
- <a href={item.url} target="_blank" rel="noreferrer nofollow noopener" download="TEST_FILE">{item.name}</a>
55
- </td>
56
- {/* <td className="col-sm-4">
54
+ <div
55
+ key={"itemDivID" + item.groupId}
56
+ style={{ paddingLeft: "25px", fontSize: "16px" }}
57
+ >
58
+ <table className="table" key={"tableID" + item.groupId}>
59
+ <thead>
60
+ <tr key={item.groupId + 7777777777}>
61
+ <th className="col-md-6" style={{ paddingRight: "40px" }}>
62
+ Description
63
+ </th>
64
+ <th className="col-md-6">URL</th>
65
+ </tr>
66
+ </thead>
67
+ <tbody>
68
+ {filterResourceItems(resourceItems, item.groupId).map(
69
+ (item) => (
70
+ <tr key={item.resource_id}>
71
+ <td className="col-md-6" style={{ paddingRight: "40px" }}>
72
+ {item.description}
73
+ </td>
74
+ <td className="col-md-6">
75
+ <a
76
+ href={item.url}
77
+ target="_blank"
78
+ rel="noreferrer nofollow noopener"
79
+ download="TEST_FILE"
80
+ >
81
+ {item.name}
82
+ </a>
83
+ </td>
84
+ {/* <td className="col-sm-4">
57
85
  <a href={documentURL+item.resource_id} target="_blank" rel="noreferrer nofollow noopener" >{item.document_name}</a>
58
86
  </td> */}
59
- </tr>
60
- ))}
61
- </tbody>
62
- </table>
63
-
87
+ </tr>
88
+ )
89
+ )}
90
+ </tbody>
91
+ </table>
64
92
  </div>
65
93
  <br></br>
66
94
  </div>
67
-
68
- )
95
+ );
69
96
  });
70
97
 
71
98
  return (
72
99
  <div>
73
- <div className={"cm-modal-header " + theme}>Resources</div>
100
+ <div className={"cm-modal-header " + theme}>Resources</div>
74
101
  <div>
75
- <div><br></br></div>
76
- <div>
77
- <div style={{
78
- overflow: "auto scroll",
79
- width: "875px",
80
- height: "390px",
81
- whiteSpace: "pre-wrap",
82
- paddingLeft: "25px"}}>
102
+ <div>
103
+ <br></br>
104
+ </div>
105
+ <div>
106
+ <div
107
+ style={{
108
+ overflow: "auto scroll",
109
+ width: "875px",
110
+ height: "390px",
111
+ whiteSpace: "pre-wrap",
112
+ paddingLeft: "25px",
113
+ }}
114
+ >
83
115
  {groups}
84
116
  </div>
85
117
  </div>
86
-
87
118
  </div>
88
119
 
89
120
  <div className="cm-modal-footer">
@@ -100,7 +131,6 @@ class ResourcesModal extends React.Component {
100
131
  </button>
101
132
  </div>
102
133
  </div>
103
-
104
134
  );
105
135
  }
106
136
  }
@@ -112,4 +142,4 @@ export default connect(
112
142
  "doModalClose",
113
143
  "doGetResourceData",
114
144
  ResourcesModal
115
- );
145
+ );