Skip to content

"date" inside an object in object column appears as and will be converted to string after clicking on dashboard #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
refre5h opened this issue Apr 21, 2016 · 9 comments · Fixed by #1223
Closed
2 tasks done
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@refre5h
Copy link

refre5h commented Apr 21, 2016

I believe this happened in the new dashboard in parse.com, for such reason I didn't use the new dashboard in parse.com. Now I found that it's also happening here with parse-server and parse-dashboard.

  • You're running version >=2.1.4 of Parse Server.
  • You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

"express": "~4.13.4",
"kerberos": "~0.0.x",
"parse": "^1.8.0",
"parse-server": "~2.2.2",
"parse-dashboard": "~1.0.9"
Heroku
mlab

Steps to reproduce

Step 1.
Create a object column in any class

Step 2.
Write an object that has date in it to this column. Below is the exact copy of one found in our db (mlab).

   "billedSessions": {
        "0": {
            "startTime": {
                "__type": "Date",
                "iso": "2016-04-13T05:10:50.261Z"
            },
            "endTime": {
                "__type": "Date",
                "iso": "2016-04-13T05:11:30.118Z"
            },
            "minutes": 1
        }
    },

Step 3.
Use the client to get this value. The startTime and endTime are both date object (for now).

Step 4.
Go to parse-dashboard and find this value. Note that the date in the object appears as a string instead.

{"0":{"startTime":"2016-04-13T05:10:50.261Z","endTime":"2016-04-13T05:11:30.118Z","minutes":1}}

Step 5.
Double click this value to enter edit state, but don't change anything.

Step 6.
Focus somewhere else to exit the edit state.

Step 7.
Go back to mlab, check the value again, it has beome:

    "billedSessions": {
        "0": {
            "startTime": "2016-04-13T05:10:50.261Z",
            "endTime": "2016-04-13T05:11:30.118Z",
            "minutes": 1
        }
    },

Step 8.
Use the client to get this value again, the type of startTime and endTime have both become string.

@drew-gross
Copy link
Contributor

Yeah, our handling of non-raw-data for inner keys of objects isn't ideal. I'll see what we can do about this.

@drew-gross drew-gross added the type:bug Impaired feature or lacking behavior that is likely assumed label Apr 21, 2016
@Silkjaer
Copy link

Same goes for Date type in Config

@refre5h
Copy link
Author

refre5h commented Apr 26, 2016

@Silkjaer A bit off topic, but is your dashboard Config working fine? It seems I can only add new params, which is saved successfully, but the Config page appears empty again if I refresh the dashboard.

@drew-gross
Copy link
Contributor

It works for me. Can you try using the API console to see if you can see the config?

@refre5h
Copy link
Author

refre5h commented Apr 27, 2016

@drew-gross Yes, using the API console can get the config.

GET
classes/_GlobalConfig
Yes or No on Use Master Key, doesn't matter
{
    "results": [
        {
            "objectId": "1",
            "updatedAt": "2016-03-25T00:53:42.065Z",
            "params": {
                "announcementVersion": 1,
                "minimumSupportBuild": 1,
                ... // along with many other params
            },
            "createdAt": "2015-12-03T21:12:45.035Z"
        }
    ]
}

But the Config page appears empty.

@refre5h
Copy link
Author

refre5h commented Apr 27, 2016

I fixed the empty Config issue by adding javascriptKey in the parse-dashboard-config.json. For anyone who's having the same issue, hope this helps. And sorry for going off topic again.

@kcoop
Copy link

kcoop commented Oct 28, 2016

Any progress with this? It's causing a crashing bug if I don't tread very carefully. I imagine it could bite a lot of people.

@tigpt
Copy link

tigpt commented Nov 16, 2016

I would like to add that its not possible by parse-dashboard UI to set a date back to (undefined). would be great if i could remove a date by the dashboard.

@douglasmuraoka
Copy link
Contributor

Fixed by #1223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
6 participants