Skip to content

Conversation

@arunapa
Copy link
Contributor

@arunapa arunapa commented Nov 21, 2022

Issue: 1) DateTimePicker widget type does not render correctly
2) After submitting the metadata definition, empty page is loaded

Fix: 1) Migrate DateTimePicker away from @mui/lab, added Dayjs package as per MUI development guide

Screen Shot 2022-11-21 at 10 55 52 AM

@arunapa arunapa requested a review from longshuicy as a code owner November 21, 2022 16:53
@arunapa arunapa linked an issue Nov 21, 2022 that may be closed by this pull request
@ddey2
Copy link
Member

ddey2 commented Nov 21, 2022

I tried adding metadata definition of type 'dateTimePicker'. It doesn't get created. I see this error on backend.

Screen Shot 2022-11-21 at 11 11 20 AM

Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata of type 'datetimepicker' is not created

[Notes]
Blank page observed after submitting metadata definition via the dataset popup, rootcause found to be incorrect React state assignment. I've removed the temporary fix that was added
@arunapa
Copy link
Contributor Author

arunapa commented Nov 21, 2022

Note: Blank page issue was found to be related to the error reported in #217 , caused by an incorrect react state assignment, which I have corrected now

@lmarini
Copy link
Member

lmarini commented Nov 21, 2022

Datetime picker worked for me. Maybe try npm install?

@longshuicy
Copy link
Member

I can create an definition of date time; but somehow i cannot update it

  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/middleware/cors.py", line 92, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/middleware/cors.py", line 147, in simple_response
    await self.app(scope, receive, send)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
    raise exc
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
    await self.app(scope, receive, sender)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/routing.py", line 275, in handle
    await self.app(scope, receive, send)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/fastapi/routing.py", line 231, in app
    raw_response = await run_endpoint_function(
  File "/Users/cwang138/.local/share/virtualenvs/backend-pkZ6g-7g/lib/python3.9/site-packages/fastapi/routing.py", line 160, in run_endpoint_function
    return await dependant.call(**values)
  File "/Users/cwang138/Documents/Clowder/clowder2/backend/./app/routers/metadata_datasets.py", line 112, in add_dataset_metadata
    md = await _build_metadata_db_obj(db, metadata_in, dataset, user)
  File "/Users/cwang138/Documents/Clowder/clowder2/backend/./app/routers/metadata_datasets.py", line 44, in _build_metadata_db_obj
    contents = await validate_context(
  File "/Users/cwang138/Documents/Clowder/clowder2/backend/./app/models/metadata.py", line 281, in validate_context
    contents = validate_definition(contents, md_def)
  File "/Users/cwang138/Documents/Clowder/clowder2/backend/./app/models/metadata.py", line 142, in validate_definition
    contents[field.name] = t(contents[field.name])
TypeError: descriptor 'time' for 'datetime.datetime' objects doesn't apply to a 'str' object

@longshuicy
Copy link
Member

longshuicy commented Nov 21, 2022

in metadata.config.tsx i think
~~ ~~"date": "Date",~~ ~~"time": "Time",~~ ~~
should just be
~~ ~~"datetime.date": "Date",~~ ~~"datetime.time": "Time"~~ ~~

Copy link
Member

@ddey2 ddey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@longshuicy longshuicy removed the request for review from max-zilla November 21, 2022 21:08
@lmarini lmarini merged commit 8a358ac into main Nov 21, 2022
@lmarini lmarini deleted the 197-metadata-definition-creation-misc-bugs branch November 21, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating metadata definition error when submitting using popup verision on dataset page Metadata definition creation misc bugs

5 participants