Commit eec2fcf9 authored by Jeffrey I. Schiller's avatar Jeffrey I. Schiller Committed by Evan W. Patton

Provide Deprecation Warning for FusiontablesControl

Google will be turning off Fusion Tables on December 3, 2019. This
change provides a warning when a FusiontablesControl is dragged into a
project.

Change-Id: I275ab12eeb664252a312602598afab94ef5c52c3
parent 248e6d69
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2018 MIT, All rights reserved
// Copyright 2011-2019 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
......@@ -6415,6 +6415,13 @@ public interface OdeMessages extends Messages {
@Description("")
String FusionTablesStandardErrorMessage();
@DefaultMessage("WARNING: Google has Deprecated the Fusion Tables Service. " +
"It will stop working on December 3, 2019 " +
"<a href=\"https://support.google.com/fusiontables/answer/9185417\" target=\"_blank\"> " +
"Learn More</a>")
@Description("")
String FusionTablesDeprecated();
@DefaultMessage("SelectionColor")
@Description("")
String SelectionColorProperties();
......
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2019 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package com.google.appinventor.client.editor.simple.components;
import com.google.appinventor.client.editor.simple.SimpleEditor;
import com.google.appinventor.client.utils.MessageDialog;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Image;
import static com.google.appinventor.client.Ode.MESSAGES;
/**
* Mock for the non-visible FusionTablesControl component. This needs
* a separate mock so we can provide a warning message about Google
* shutting down the service on December 3, 2019.
*
* Cribbed from MockFirebaseDB.java
*
* @author jis@mit.edu (Jeffrey I. Schiller)
*/
public class MockFusionTablesControl extends MockNonVisibleComponent {
public static final String TYPE = "FusiontablesControl";
private static boolean warningGiven = false; // Whether or not we have given experimental warning
/**
* Creates a new instance of a non-visible component whose icon is
* loaded dynamically (not part of the icon image bundle)
*
* @param editor
* @param type
* @param iconImage
*/
public MockFusionTablesControl(SimpleEditor editor, String type, Image iconImage) {
super(editor, type, iconImage);
}
/**
* Called when the component is dropped in the Designer window
* we give a warning that FusiontablesControl is deprecated
*/
@Override
public void onCreateFromPalette() {
if (!warningGiven) {
warningGiven = true;
MessageDialog.messageDialog(MESSAGES.warningDialogTitle(),
MESSAGES.FusionTablesDeprecated(),
MESSAGES.okButton(), null, null);
}
}
}
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2017 MIT, All rights reserved
// Copyright 2011-2019 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
......@@ -22,6 +22,7 @@ import com.google.appinventor.client.editor.simple.components.MockDatePicker;
import com.google.appinventor.client.editor.simple.components.MockEmailPicker;
import com.google.appinventor.client.editor.simple.components.MockFeatureCollection;
import com.google.appinventor.client.editor.simple.components.MockFirebaseDB;
import com.google.appinventor.client.editor.simple.components.MockFusionTablesControl;
import com.google.appinventor.client.editor.simple.components.MockHorizontalArrangement;
import com.google.appinventor.client.editor.simple.components.MockImage;
import com.google.appinventor.client.editor.simple.components.MockImagePicker;
......@@ -374,6 +375,10 @@ public final class SimpleComponentDescriptor {
return new MockCloudDB(editor, name,
getImageFromPath(SimpleComponentDatabase.getInstance(editor.getProjectId()).getIconName(name),
null, editor.getProjectId()));
} else if(name.equals(MockFusionTablesControl.TYPE)) {
return new MockFusionTablesControl(editor, name,
getImageFromPath(SimpleComponentDatabase.getInstance(editor.getProjectId()).getIconName(name),
null, editor.getProjectId()));
} else {
String pkgName = type.contains(".") ? type.substring(0, type.lastIndexOf('.')) : null;
return new MockNonVisibleComponent(editor, name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment