-
Notifications
You must be signed in to change notification settings - Fork 650
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
7018 export visualization full metadata #7114
7018 export visualization full metadata #7114
Conversation
} | ||
end | ||
|
||
CHANGING_LAYER_OPTIONS_KEYS = [:user_name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Freeze mutable objects assigned to constants.
🏃 to a meeting. Passing the baton to @gfiorav. Ping me afterwards to continue my review. |
Let's make it serial: I'll CR when you've answered @javitonino 's comments 😄 |
@javisantana: take a look at the import/export spec, there's a hash with the structure of the JSON. TL;DR: a JSON with a
PS: reviewing your CRs I've realized that I must add |
|
class VisualizationsExportPersistenceService | ||
include Carto::UUIDHelper | ||
|
||
def save_import(user, visualization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for save_import is too high. [43.52/35]
|
@gfiorav although maybe @javitonino will still add something I've taken into account his comments and added the privacy and derived checks, so I think you can CR. |
Exactly. But when importing, this is not being run (this is on the old layer model, in |
@@ -1,3 +1,10 @@ | |||
3.13.* (2016-XX-XX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a new version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I when I saw the notice about the breaking change I thought that we had tagged it, sorry. Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this is not in 3.13.0 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed the NEWS change.
@javitonino ok, adding |
should we update this as well http://cartodb.readthedocs.org/en/latest/operations/exporting_importing_visualizations.html |
@javisantana I'd wait for the full import/export is done, including data, don't you agree? |
user_table = FactoryGirl.create(:carto_user_table, user_id: @user.id, name: "guess_ip_1") | ||
imported = Carto::VisualizationsExportService2.new.build_visualization_from_json_export(export.to_json) | ||
visualization = Carto::VisualizationsExportPersistenceService.new.save_import(@user, imported) | ||
layer_with_table = visualization.layers.find { |l| l.options[:table_name].present? } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer detect
over find
.
that's fine, just wanted to point that we have some doc that we might want to change |
I don't have much to add. 📦 it when CI passes! |
Ok, |
This closes #7018. Highlights:
VisualizationsExportPersistenceService
. This approach has some advantages IMHO:This is the first step towards #6365. In the future it will be integrated in the import/export feature, but currently it can be used to import/export full visualizations as long as target user has the needed tables. Usage example: