-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix the activity popup bug in home view #66
Conversation
Can you tell why that code is causing the problem? This is the error that appears in shell.log when an icon is hovered in the home view:
|
I don't know if this is related or another bug: in activitypalette.js, we have a variable "environment" that will always be undefined, inside this if statement: sugar-web/graphics/activitypalette.js Line 72 in 3ddf50f
|
Looking at datastoreObject.setMetadata and its spec, it looks possible to call it many times with different metadata. I think ActivityPalette should only set 'title', not 'activity' or 'activity_id'. Those should be managed by activity.js . @dnarvaez what do you think? |
Hmm ActivityPalette creates another datastore.DatastoreObject(). I think this is wrong. |
Regarding patch, the very first time the activity is opened, metadata is set without a title. Then undefined variable "environment", i just tried to output the value in the console and it isn't undefined. About new DS object, so if only one DS object should exist then we'll have to send the DS object from activity.js to here and work with that? |
I have not looked at the patch or the issue but to answer manuq question... Yes, the idea is that you only put in the object the properties you want to change. It's a bit unusual but I think requiring to set all the properties would be a pain with an async API. Need to document the datastore API... |
About the ds object, you can just activity.getDatastoreObject() instead of creating one. |
Initially I did try activity.getDatastoreObject() , but for some inexplicable reason I wasn't able to fetch the activity object using define(["sugar-web/graphics/palette", "activity" was always undefined. |
Perhaps a circular dependency |
You're right. I'll try to sort it out. |
Closing since it needs work. |
Since we're already setting the metadata in the activitypalette.js, this is not needed and causing a problem in the popup in the home view.