Skip to content

Commit f7f3583

Browse files
authoredJun 20, 2023
Merge pull request #179 from MeasureAuthoringTool/MAT-5727/fixCanEdit
fixed can edit
2 parents 5430dbd + 3980b9a commit f7f3583

File tree

7 files changed

+12
-3
lines changed

7 files changed

+12
-3
lines changed
 

‎react/components/DateField/DateField.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const dateTextFieldStyle = {
3939
},
4040
};
4141

42-
const DateField = ({ label, value, handleDateChange }) => {
42+
const DateField = ({ label, value, handleDateChange, disabled }) => {
4343
return (
4444
<LocalizationProvider dateAdapter={AdapterDayjs}>
4545
<InputLabel
@@ -66,6 +66,7 @@ const DateField = ({ label, value, handleDateChange }) => {
6666
<DatePicker
6767
value={value ? value : null}
6868
onChange={handleDateChange}
69+
disabled={disabled}
6970
slotProps={{
7071
textField: {
7172
id: "date",
@@ -80,6 +81,7 @@ DateField.propTypes = {
8081
label: PropTypes.string.isRequired,
8182
value: PropTypes.object,
8283
handleDateChange: PropTypes.func.isRequired,
84+
disabled:PropTypes.bool
8385
};
8486

8587
export default DateField;

‎react/components/DateField/DateField.stories.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const DateFieldComponent = (args) => {
1616
return (
1717
<div className="qpp-u-padding--16">
1818
<DateField
19+
disabled={false}
1920
label="Status Date"
2021
handleDateChange={handleDateChange}
2122
value={value}

‎react/components/DateTimeField/DateTimeField.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export const dateTimeTextFieldStyle = {
4040
},
4141
};
4242

43-
const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange }) => {
43+
const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange,disabled }) => {
44+
console.log(disabled)
4445
return (
4546
<FormControl>
4647
<LocalizationProvider dateAdapter={AdapterDayjs}>
@@ -54,6 +55,7 @@ const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange }) => {
5455
value={dateTimeValue ? dateTimeValue : null}
5556
onChange={handleDateTimeChange}
5657
views={["year", "day", "hours", "minutes"]}
58+
disabled={disabled}
5759
slotProps={{
5860
textField: {
5961
id: "dateTime",
@@ -69,6 +71,7 @@ DateTimeField.propTypes = {
6971
dateTimeValue: PropTypes.object,
7072
handleDateTimeChange: PropTypes.func.isRequired,
7173
label: PropTypes.string.isRequired,
74+
disabled:PropTypes.bool
7275
};
7376

7477
export default DateTimeField;

‎react/components/DateTimeField/DateTimeField.stories.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const TimeDateFieldComponent = (args) => {
1717
return (
1818
<div className="qpp-u-padding--16">
1919
<DateTimeField
20+
disabled={true}
2021
label="Status Date/Time"
2122
handlDateTimeChange={handlDateTimeChange}
2223
dateTimeValue={value}

‎react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@madie/madie-design-system",
3-
"version": "1.0.50",
3+
"version": "1.0.51",
44
"description": "Shared style guide across the Madie program.",
55
"main": "dist/index.js",
66
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",

‎react/test/components/DateField.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe("DateField", () => {
1515
label="Status Date"
1616
value={dayjs("2022-04-17")}
1717
handleDateChange={() => console.log("Status Date")}
18+
disabled={false}
1819
/>
1920
);
2021

‎react/test/components/DateTimeField.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe("DateTimeField", () => {
1717
handleDateTimeChange={() => {
1818
return;
1919
}}
20+
disabled={false}
2021
/>
2122
);
2223

0 commit comments

Comments
 (0)
Please sign in to comment.