@corpsmap/corpsmap 4.1.6 → 4.1.9
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
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from "redux-bundler-react";
|
|
3
|
+
import { SearchInput, SearchResultsList } from "../../application-controls";
|
|
4
|
+
import SelectDistrict from "./select-district";
|
|
5
|
+
|
|
6
|
+
class ChangeLogModal extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
|
|
10
|
+
this.handleChange = this.handleChange.bind(this);
|
|
11
|
+
this.close = this.close.bind(this);
|
|
12
|
+
this.fomatDate = this.formatDate.bind(this);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
handleChange(event) {
|
|
16
|
+
const { doSetSearchBarFilter } = this.props;
|
|
17
|
+
doSetSearchBarFilter(event.target.value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
close() {
|
|
21
|
+
const { doModalClose } = this.props;
|
|
22
|
+
doModalClose();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
formatDate(oldDate) {
|
|
26
|
+
let newDate = new Date(oldDate);
|
|
27
|
+
let offset = newDate.getTimezoneOffset() * 60000;
|
|
28
|
+
let newDate2 = new Date(newDate.getTime() + offset);
|
|
29
|
+
newDate2 = newDate2.toLocaleDateString("default", {
|
|
30
|
+
month: "long",
|
|
31
|
+
day: "numeric",
|
|
32
|
+
year: "numeric",
|
|
33
|
+
});
|
|
34
|
+
return newDate2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
const {
|
|
39
|
+
theme,
|
|
40
|
+
doGetChangeLogData,
|
|
41
|
+
changeLogItems,
|
|
42
|
+
allChangeLogItems,
|
|
43
|
+
searchBarFilter,
|
|
44
|
+
} = this.props;
|
|
45
|
+
const loginDataWk = changeLogItems;
|
|
46
|
+
let districtCodes = [
|
|
47
|
+
...new Set(allChangeLogItems.map((feature) => feature.district_code)),
|
|
48
|
+
];
|
|
49
|
+
let options = [];
|
|
50
|
+
|
|
51
|
+
districtCodes.sort().forEach((item, index) => {
|
|
52
|
+
if (item) {
|
|
53
|
+
options.push({
|
|
54
|
+
label: `${item}`,
|
|
55
|
+
value: `${item}`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
options.unshift({ label: "All Districts", value: "All" });
|
|
61
|
+
|
|
62
|
+
const arrayDataItems = loginDataWk.map((data) => (
|
|
63
|
+
<div
|
|
64
|
+
key={data.id + data.id + 9876}
|
|
65
|
+
style={
|
|
66
|
+
Object.keys(data).length > 0
|
|
67
|
+
? { listStyleType: "disc" }
|
|
68
|
+
: { listStyleType: "none" }
|
|
69
|
+
}
|
|
70
|
+
>
|
|
71
|
+
{data.change_date ? (
|
|
72
|
+
<li key={data.change_date + data.id}>
|
|
73
|
+
<b>{this.formatDate(data.change_date)}</b>
|
|
74
|
+
</li>
|
|
75
|
+
) : null}
|
|
76
|
+
{data.environment ? (
|
|
77
|
+
<li
|
|
78
|
+
key={data.environment + data.id}
|
|
79
|
+
style={{ listStyleType: "none" }}
|
|
80
|
+
>
|
|
81
|
+
<b>Environment:</b> {data.environment}{" "}
|
|
82
|
+
</li>
|
|
83
|
+
) : null}
|
|
84
|
+
{data.change_type ? (
|
|
85
|
+
<li
|
|
86
|
+
key={data.change_type + data.id}
|
|
87
|
+
style={{ listStyleType: "none" }}
|
|
88
|
+
>
|
|
89
|
+
<b>Change Type:</b> {data.change_type}
|
|
90
|
+
</li>
|
|
91
|
+
) : null}
|
|
92
|
+
{data.district_code ? (
|
|
93
|
+
<li
|
|
94
|
+
key={data.district_code + data.id}
|
|
95
|
+
style={{ listStyleType: "none" }}
|
|
96
|
+
>
|
|
97
|
+
<b>District:</b> {data.district_code}
|
|
98
|
+
</li>
|
|
99
|
+
) : null}
|
|
100
|
+
{data.description ? (
|
|
101
|
+
<li
|
|
102
|
+
key={data.description + data.id}
|
|
103
|
+
style={{ listStyleType: "none" }}
|
|
104
|
+
>
|
|
105
|
+
<b>Description:</b> {data.description}
|
|
106
|
+
</li>
|
|
107
|
+
) : null}
|
|
108
|
+
<br></br>
|
|
109
|
+
</div>
|
|
110
|
+
));
|
|
111
|
+
|
|
112
|
+
const filterStyle = {
|
|
113
|
+
// paddingLeft: "25px",
|
|
114
|
+
display: "flex",
|
|
115
|
+
justifyContent: "center",
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
gap: "40px",
|
|
118
|
+
width: "700px",
|
|
119
|
+
alignItems: "flex-end",
|
|
120
|
+
// textAlign: "right",
|
|
121
|
+
// alignItems: "flex-end" /* Aligns content to the right */,
|
|
122
|
+
// width: 300px; /* Example width for the container */
|
|
123
|
+
// border: "1px solid lightgray" /* For visualization */,
|
|
124
|
+
padding: "5px",
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div>
|
|
129
|
+
<div className={"cm-modal-header " + theme}>Change Log</div>
|
|
130
|
+
|
|
131
|
+
<div className="cm-modal-body">
|
|
132
|
+
<div style={filterStyle}>
|
|
133
|
+
<label style={{ fontSize: "18px", fontWeight: "bold" }}>
|
|
134
|
+
Change Log
|
|
135
|
+
</label>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div style={filterStyle}>
|
|
139
|
+
<label htmlFor="select-district">
|
|
140
|
+
<b>Filter by District:</b>
|
|
141
|
+
</label>
|
|
142
|
+
<SelectDistrict options={options} />
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<div style={filterStyle}>
|
|
146
|
+
<label htmlFor="select-district">
|
|
147
|
+
<b>Search:</b>
|
|
148
|
+
</label>
|
|
149
|
+
|
|
150
|
+
<input
|
|
151
|
+
placeholder="Change Log Search..."
|
|
152
|
+
style={{ width: "200px" }}
|
|
153
|
+
value={searchBarFilter}
|
|
154
|
+
onChange={this.handleChange}
|
|
155
|
+
></input>
|
|
156
|
+
</div>
|
|
157
|
+
<div
|
|
158
|
+
style={{
|
|
159
|
+
overflow: "auto scroll",
|
|
160
|
+
width: "875px",
|
|
161
|
+
height: "400px",
|
|
162
|
+
whiteSpace: "pre-wrap",
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
<ul>{arrayDataItems}</ul>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
<div className="cm-modal-footer">
|
|
169
|
+
<br></br>
|
|
170
|
+
<br></br>
|
|
171
|
+
<br></br>
|
|
172
|
+
<button
|
|
173
|
+
style={{ textAlign: "left" }}
|
|
174
|
+
type="Close"
|
|
175
|
+
className={"cm-btn cm-btn-theme " + theme}
|
|
176
|
+
onClick={this.close}
|
|
177
|
+
>
|
|
178
|
+
Close
|
|
179
|
+
</button>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export default connect(
|
|
187
|
+
"selectTheme",
|
|
188
|
+
"selectChangeLogItems",
|
|
189
|
+
"selectAllChangeLogItems",
|
|
190
|
+
"selectSearchBarFilter",
|
|
191
|
+
"doModalClose",
|
|
192
|
+
"doSubmitNotification",
|
|
193
|
+
"doGetChangeLogData",
|
|
194
|
+
"doSearchChangeLogData",
|
|
195
|
+
"doSetSearchBarFilter",
|
|
196
|
+
ChangeLogModal
|
|
197
|
+
);
|
|
@@ -22,14 +22,25 @@ class ChangeLogModal extends React.Component {
|
|
|
22
22
|
doModalClose();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// formatDate(oldDate) {
|
|
26
|
+
// let newDate = new Date(oldDate);
|
|
27
|
+
// newDate = newDate.toLocaleDateString("default", {
|
|
28
|
+
// month: "long",
|
|
29
|
+
// day: "numeric",
|
|
30
|
+
// year: "numeric",
|
|
31
|
+
// });
|
|
32
|
+
// return newDate;
|
|
33
|
+
// }
|
|
25
34
|
formatDate(oldDate) {
|
|
26
35
|
let newDate = new Date(oldDate);
|
|
27
|
-
|
|
36
|
+
let offset = newDate.getTimezoneOffset() * 60000;
|
|
37
|
+
let newDate2 = new Date(newDate.getTime() + offset);
|
|
38
|
+
newDate2 = newDate2.toLocaleDateString("default", {
|
|
28
39
|
month: "long",
|
|
29
40
|
day: "numeric",
|
|
30
41
|
year: "numeric",
|
|
31
42
|
});
|
|
32
|
-
return
|
|
43
|
+
return newDate2;
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
render() {
|