Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

[Issue 243] Move to new metadata spec #254

Merged
merged 1 commit into from
Jun 2, 2016

Conversation

dalogsdon
Copy link
Contributor

Part of #243

@parente
Copy link
Member

parente commented May 31, 2016

Fixes #253 and #235 as a side effects.

}

// get cell view metadata from element data
function _getCellViewMetadata($elem, viewId) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe _getCellActiveViewMetadata?

Copy link
Contributor Author

@dalogsdon dalogsdon May 31, 2016

Choose a reason for hiding this comment

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

It's not just for the active view. The third argument specifies the view to get and defaults to the active view. See line 145 (_updateCellMetadata calls with 3rd arg) for an example of that arg being used.

Copy link
Member

Choose a reason for hiding this comment

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

I see it now. Maybe add some doc on it then indicating the default behavior of the param (2nd right?) is missing.

@parente
Copy link
Member

parente commented May 31, 2016

Tested that none of the recent bugs have resurfaced: #222, #223, #226, #227, #231, #233, #234, #239, #248. 👍

layout = metadata.layout;
// common metadata
_ensureHas(metadata, 'extensions');
_ensureHas(metadata.extensions, 'jupyter_dashboards');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not update _ensureHas to take the full dot-delimited string, similar to what dojo.getObject does? i.e. _ensureHas(metadata, 'extensions.jupyter_dashboards').

(c) Copyright IBM Corp. 2016
@dalogsdon
Copy link
Contributor Author

Updated based on comments and to add compatibility module.

* This must be run AFTER the version 1 metadata is initialized in
* `dashboard-metadata.js`.
*/
convert: function() {
Copy link
Member

@parente parente Jun 1, 2016

Choose a reason for hiding this comment

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

If we're going to play the up-convert game, I think we should future proof a bit. Should we make this more amenable to v0 -> v1 conversion explicitly so that later, another convert function / delegate can handle v1 -> v2 and so on?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind for now. I see there's an if-statement guarding the convert so that it only runs on v0 (urth) metadata. If a metadata v2 ever happens, older versions of the extension won't try to run their v0->v1 code, and v1->v2 conversion is something we can add to a new version of the extension. For now, YAGNI.

@parente
Copy link
Member

parente commented Jun 1, 2016

@dalogsdon I can't tell because of the squash push, but in your latest commit, did you do anything other than address @jhpedemonte 's comment and add the compatibility support? Need to know how much I have to go back and retest. (Push separate commits if more changes are coming ...)

@dalogsdon
Copy link
Contributor Author

dalogsdon commented Jun 1, 2016

Updated according to @jhpedemonte's comment about ensuring object exists, according to @parente's comment on the _getCellViewMetadata function documentation, and the compatibility module.

Because the ensure object exist util is used in the generation of the metadata structure, some re-testing may be good to ensure no bugs with the structure.

@parente
Copy link
Member

parente commented Jun 1, 2016

I'll give it one more round of testing.

@parente
Copy link
Member

parente commented Jun 2, 2016

Tested all of the recent defects again as well as loading of many existing demo notebooks. No issues found.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants