Skip to content

Commit

Permalink
Merge pull request #179 from MeasureAuthoringTool/MAT-5727/fixCanEdit
Browse files Browse the repository at this point in the history
fixed can edit
  • Loading branch information
sb-prateekkeerthi authored Jun 20, 2023
2 parents 5430dbd + 3980b9a commit f7f3583
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion react/components/DateField/DateField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const dateTextFieldStyle = {
},
};

const DateField = ({ label, value, handleDateChange }) => {
const DateField = ({ label, value, handleDateChange, disabled }) => {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<InputLabel
Expand All @@ -66,6 +66,7 @@ const DateField = ({ label, value, handleDateChange }) => {
<DatePicker
value={value ? value : null}
onChange={handleDateChange}
disabled={disabled}
slotProps={{
textField: {
id: "date",
Expand All @@ -80,6 +81,7 @@ DateField.propTypes = {
label: PropTypes.string.isRequired,
value: PropTypes.object,
handleDateChange: PropTypes.func.isRequired,
disabled:PropTypes.bool
};

export default DateField;
1 change: 1 addition & 0 deletions react/components/DateField/DateField.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const DateFieldComponent = (args) => {
return (
<div className="qpp-u-padding--16">
<DateField
disabled={false}
label="Status Date"
handleDateChange={handleDateChange}
value={value}
Expand Down
5 changes: 4 additions & 1 deletion react/components/DateTimeField/DateTimeField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const dateTimeTextFieldStyle = {
},
};

const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange }) => {
const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange,disabled }) => {
console.log(disabled)
return (
<FormControl>
<LocalizationProvider dateAdapter={AdapterDayjs}>
Expand All @@ -54,6 +55,7 @@ const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange }) => {
value={dateTimeValue ? dateTimeValue : null}
onChange={handleDateTimeChange}
views={["year", "day", "hours", "minutes"]}
disabled={disabled}
slotProps={{
textField: {
id: "dateTime",
Expand All @@ -69,6 +71,7 @@ DateTimeField.propTypes = {
dateTimeValue: PropTypes.object,
handleDateTimeChange: PropTypes.func.isRequired,
label: PropTypes.string.isRequired,
disabled:PropTypes.bool
};

export default DateTimeField;
1 change: 1 addition & 0 deletions react/components/DateTimeField/DateTimeField.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const TimeDateFieldComponent = (args) => {
return (
<div className="qpp-u-padding--16">
<DateTimeField
disabled={true}
label="Status Date/Time"
handlDateTimeChange={handlDateTimeChange}
dateTimeValue={value}
Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@madie/madie-design-system",
"version": "1.0.50",
"version": "1.0.51",
"description": "Shared style guide across the Madie program.",
"main": "dist/index.js",
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
Expand Down
1 change: 1 addition & 0 deletions react/test/components/DateField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("DateField", () => {
label="Status Date"
value={dayjs("2022-04-17")}
handleDateChange={() => console.log("Status Date")}
disabled={false}
/>
);

Expand Down
1 change: 1 addition & 0 deletions react/test/components/DateTimeField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe("DateTimeField", () => {
handleDateTimeChange={() => {
return;
}}
disabled={false}
/>
);

Expand Down

0 comments on commit f7f3583

Please sign in to comment.