Interactive interface for browsing global, full-resolution satellite imagery
WV-2528: Removing embed tab and updating related tests (#4053)
Ryan Weiler300049fc073d
diff --git a/.gitignore b/.gitignoreindex 4c41af8d2..6f50406b3 100644--- a/.gitignore+++ b/.gitignore@@ -4,6 +4,7 @@/web/config/web/stories/dist+/doc/embed.md/node_modules/web/ext/node_modules/*/tasks/link-check/resultsdiff --git a/config/default/common/config/wv.json/stories/default/worldview_intro.json b/config/default/common/config/wv.json/stories/default/worldview_intro.jsonindex adb36e3ba..6ed19a435 100644--- a/config/default/common/config/wv.json/stories/default/worldview_intro.json+++ b/config/default/common/config/wv.json/stories/default/worldview_intro.json@@ -118,7 +118,7 @@},{"target": "#wv-share-button",- "content": "Create a custom URL link of your Worldview page, copy HTML code to embed Worldview into a web page, and share Worldview via social media with friends and colleagues!",+ "content": "Create a custom URL link of your Worldview page and share Worldview via social media with friends and colleagues!","placementBeacon": "bottom"},{diff --git a/doc/embed.md b/doc/embed.mddeleted file mode 100644index 116787098..000000000--- a/doc/embed.md+++ /dev/null@@ -1,36 +0,0 @@-## Create an Embedded Worldview--To embed NASA Worldview into a web page, StoryMap, or other web-based product, use the following steps:--1. Go to Worldview: [worldview.earthdata.nasa.gov](https://worldview.earthdata.nasa.gov)-2. Set up the map in Worldview in the manner most useful for illustrating your story. For example, [this is a before and after comparison of fires in Australia](https://worldview.earthdata.nasa.gov/?v=144.23691073937437,-38.67969316481099,152.31732548681651,-34.58659747600989&l=Reference_Labels_15m,Reference_Features_15m(hidden),Coastlines_15m,MODIS_Terra_CorrectedReflectance_Bands721(hidden),MODIS_Aqua_CorrectedReflectance_Bands721(hidden),VIIRS_SNPP_CorrectedReflectance_BandsM11-I2-I1,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor(hidden)&lg=false&l1=VIIRS_SNPP_Thermal_Anomalies_375m_Day(hidden),Reference_Labels_15m,Reference_Features_15m(hidden),Coastlines_15m,MODIS_Terra_CorrectedReflectance_Bands721(hidden),MODIS_Aqua_CorrectedReflectance_Bands721(hidden),VIIRS_SNPP_CorrectedReflectance_BandsM11-I2-I1,VIIRS_SNPP_CorrectedReflectance_TrueColor(hidden),MODIS_Aqua_CorrectedReflectance_TrueColor(hidden),MODIS_Terra_CorrectedReflectance_TrueColor(hidden)&lg1=false&ca=false&t=2019-01-14-T00%3A00%3A00Z&t1=2020-01-11-T00%3A00%3A00Z).-3. Click on the Share icon (second from the left) in the upper right corner.-4. Click on the "Embed" tab.-5. Click "Copy" to copy the HTML code with the current Worldview instance in an embeddable `<iframe>` inline element.-6. Add the HTML code to your webpage in the place where you want the Worldview map to appear.--Note: You will need to wrap the `<iframe>` code in a wrapper element (e.g., `<div>`) with your desired width, height, and any additional style changes. You can change the width and height from percent to px to make it fit your page. See [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) for more information on the `<iframe>` inline element including an explanation of its attributes.--**Example `<iframe>` code:**-```<iframe src="https://worldview.earthdata.nasa.gov/?em=true" role="application" sandbox="allow-modals allow-scripts allow-same-origin allow-forms allow-popups" width="100%" height="100%" allow="fullscreen; autoplay;" loading="lazy"></iframe>```--Visit the [Examples of Embedded Worldview page](https://earthdata.nasa.gov/worldview/worldview-embed-examples) to see live examples of embedded Worldview.--## Limited Features in an Embedded Worldview-Compared to the full application, the embedded version of Worldview has intentionally limited functionality to give users a more streamlined experience. Users can always click on the icon in the upper right corner to open the full version of Worldview in a new browser tab.--The following is a list of the features and button/tab interactions that are not available or altered in embed mode:--- Search places by location, Share this map, Switch projections, Take a snapshot, and Information buttons are disabled. These features have been replaced with a button that opens up a new tab with your current map view in the full featured Worldview.-- The welcome page and its tour stories are disabled.-- In the Layer List, layer grouping is disabled, the hidden layers are not displayed, and the options to change the opacity, thresholds, color palettes, disable/enable classifications, or other related settings are not available.-- The Events tab will only appear in the embedded version if both 1) the tab is selected and 2) and event is selected in Worldview before creating the `iframe` html code.-- Data Download is disabled.-- The Extended timeline and layer coverage panel are unavailable. However, it is still possible for users to change the date.-- The Export to Animation tool is disabled.-- The Measure Tool is disabled.--## Helpful Tips:-- Limit the number of layers included on the map to best convey your story, as layers cannot be turned on and off once embedded.-- Provide detailed captions on your webpage to explain what the embedded Worldview is showing.-diff --git a/e2e/features/share/embed-test.js b/e2e/features/share/embed-test.jsindex 1ab6766b8..0f4f82006 100644--- a/e2e/features/share/embed-test.js+++ b/e2e/features/share/embed-test.js@@ -1,91 +1,91 @@-const reuseables = require('../../reuseables/skip-tour.js');-const localSelectors = require('../../reuseables/selectors.js');+// const reuseables = require('../../reuseables/skip-tour.js');+// const localSelectors = require('../../reuseables/selectors.js');-const TIME_LIMIT = 10000;+// const TIME_LIMIT = 10000;-const {- addLayers,- compareButton,- dataDownloadTabButton,- embedLinkButton,- eventsSidebarTabButton,- infoToolbarButton,- locationSearchToolbarButton,- measureBtn,- projToolbarButton,- shareEmbedInput,- shareToolbar,- shareToolbarButton,- snapshotToolbarButton,-} = localSelectors;+// const {+// addLayers,+// compareButton,+// dataDownloadTabButton,+// embedLinkButton,+// eventsSidebarTabButton,+// infoToolbarButton,+// locationSearchToolbarButton,+// measureBtn,+// projToolbarButton,+// shareEmbedInput,+// shareToolbar,+// shareToolbarButton,+// snapshotToolbarButton,+// } = localSelectors;-const embedShareNav = '.embed-share-nav';+// const embedShareNav = '.embed-share-nav';-// embed input value with default page 2020-01-01-const iframeValue = (c) => `<iframe src="${c.globals.url}?t=2020-01-01-T00%3A00%3A00Z&em=true" role="application" sandbox="allow-modals allow-scripts allow-same-origin allow-forms allow-popups" width="100%" height="100%" allow="fullscreen; autoplay;" loading="lazy"></iframe>`;+// // embed input value with default page 2020-01-01+// const iframeValue = (c) => `<iframe src="${c.globals.url}?t=2020-01-01-T00%3A00%3A00Z&em=true" role="application" sandbox="allow-modals allow-scripts allow-same-origin allow-forms allow-popups" width="100%" height="100%" allow="fullscreen; autoplay;" loading="lazy"></iframe>`;-module.exports = {- before(c) {- reuseables.loadAndSkipTour(c, TIME_LIMIT);- },- 'Embed share tab dialog displays embed input': (c) => {- const queryString = '?t=2020-01-01';- c.url(c.globals.url + queryString);- c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);- c.click(shareToolbarButton);- c.waitForElementVisible(shareToolbar, TIME_LIMIT);- c.click(`${embedShareNav} a`);- c.waitForElementVisible(shareEmbedInput, TIME_LIMIT);- c.assert.attributeContains(shareEmbedInput, 'value', iframeValue(c));- },- 'Embed share nav link tab disabled if data tab selected': (c) => {- const queryString = '?sh=VIIRS_NOAA20_CorrectedReflectance_TrueColor,C1604567932-LANCEMODIS&t=2020-01-01';- c.url(c.globals.url + queryString);- c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);- c.click(shareToolbarButton);- c.waitForElementVisible(shareToolbar, TIME_LIMIT);- },- 'Embed share nav link tab disabled if tour active': (c) => {- const queryString = '?tr=swath_gaps';- c.url(c.globals.url + queryString);- c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);- c.click(shareToolbarButton);- c.waitForElementVisible(shareToolbar, TIME_LIMIT);- c.assert.cssClassPresent(`${embedShareNav} a`, 'disabled');- },- 'Embed mode is active with query string parameter': (c) => {- const queryString = '?t=2020-01-01&em=true';- c.url(c.globals.url + queryString);- c.waitForElementVisible('.embed-overlay-bg', TIME_LIMIT);- c.waitForElementVisible('.embed-overlay-btn', TIME_LIMIT);- c.click('.embed-overlay-bg');- c.expect.element(embedLinkButton).to.be.visible;- },- 'Embed mode styling is correct': (c) => {- // visible- c.expect.element('.timeline-header-mobile').to.be.visible;- c.expect.element('.mobile-date-change-arrows-btn').to.be.visible;- // not present- c.expect.element(eventsSidebarTabButton).to.not.be.present;- c.expect.element(locationSearchToolbarButton).to.not.be.present;- // not visible- c.expect.element(dataDownloadTabButton).to.not.be.visible;- c.expect.element(infoToolbarButton).to.not.be.visible;- c.expect.element(measureBtn).to.not.be.visible;- c.expect.element(projToolbarButton).to.not.be.visible;- c.expect.element(shareToolbarButton).to.not.be.visible;- c.expect.element(snapshotToolbarButton).to.not.be.visible;- c.expect.element(addLayers).to.not.be.visible;- c.expect.element(compareButton).to.not.be.visible;- },- 'Clicking embed link button opens up new tab': (c) => {- c.click(embedLinkButton);- c.pause(1000);- c.windowHandles((tabs) => {- c.assert.equal(tabs.value.length, 2);- });- },- after(c) {- c.end();- },-};+// module.exports = {+// before(c) {+// reuseables.loadAndSkipTour(c, TIME_LIMIT);+// },+// 'Embed share tab dialog displays embed input': (c) => {+// const queryString = '?t=2020-01-01';+// c.url(c.globals.url + queryString);+// c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);+// c.click(shareToolbarButton);+// c.waitForElementVisible(shareToolbar, TIME_LIMIT);+// c.click(`${embedShareNav} a`);+// c.waitForElementVisible(shareEmbedInput, TIME_LIMIT);+// c.assert.attributeContains(shareEmbedInput, 'value', iframeValue(c));+// },+// 'Embed share nav link tab disabled if data tab selected': (c) => {+// const queryString = '?sh=VIIRS_NOAA20_CorrectedReflectance_TrueColor,C1604567932-LANCEMODIS&t=2020-01-01';+// c.url(c.globals.url + queryString);+// c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);+// c.click(shareToolbarButton);+// c.waitForElementVisible(shareToolbar, TIME_LIMIT);+// },+// 'Embed share nav link tab disabled if tour active': (c) => {+// const queryString = '?tr=swath_gaps';+// c.url(c.globals.url + queryString);+// c.waitForElementVisible(shareToolbarButton, TIME_LIMIT);+// c.click(shareToolbarButton);+// c.waitForElementVisible(shareToolbar, TIME_LIMIT);+// c.assert.cssClassPresent(`${embedShareNav} a`, 'disabled');+// },+// 'Embed mode is active with query string parameter': (c) => {+// const queryString = '?t=2020-01-01&em=true';+// c.url(c.globals.url + queryString);+// c.waitForElementVisible('.embed-overlay-bg', TIME_LIMIT);+// c.waitForElementVisible('.embed-overlay-btn', TIME_LIMIT);+// c.click('.embed-overlay-bg');+// c.expect.element(embedLinkButton).to.be.visible;+// },+// 'Embed mode styling is correct': (c) => {+// // visible+// c.expect.element('.timeline-header-mobile').to.be.visible;+// c.expect.element('.mobile-date-change-arrows-btn').to.be.visible;+// // not present+// c.expect.element(eventsSidebarTabButton).to.not.be.present;+// c.expect.element(locationSearchToolbarButton).to.not.be.present;+// // not visible+// c.expect.element(dataDownloadTabButton).to.not.be.visible;+// c.expect.element(infoToolbarButton).to.not.be.visible;+// c.expect.element(measureBtn).to.not.be.visible;+// c.expect.element(projToolbarButton).to.not.be.visible;+// c.expect.element(shareToolbarButton).to.not.be.visible;+// c.expect.element(snapshotToolbarButton).to.not.be.visible;+// c.expect.element(addLayers).to.not.be.visible;+// c.expect.element(compareButton).to.not.be.visible;+// },+// 'Clicking embed link button opens up new tab': (c) => {+// c.click(embedLinkButton);+// c.pause(1000);+// c.windowHandles((tabs) => {+// c.assert.equal(tabs.value.length, 2);+// });+// },+// after(c) {+// c.end();+// },+// };diff --git a/e2e/features/share/share-test.js b/e2e/features/share/share-test.jsindex 6677c7a4a..288a2d3c2 100644--- a/e2e/features/share/share-test.js+++ b/e2e/features/share/share-test.js@@ -10,7 +10,7 @@ const {} = localSelectors;const linkShareNav = '.link-share-nav';-const embedShareNav = '.embed-share-nav';+// const embedShareNav = '.embed-share-nav';const socialShareNav = '.social-share-nav';module.exports = {@@ -25,7 +25,7 @@ module.exports = {},'Share tabs link, embed, and social are visible and enabled': (c) => {c.expect.element(linkShareNav).to.be.present;- c.expect.element(embedShareNav).to.be.present;+ // c.expect.element(embedShareNav).to.be.present;c.expect.element(socialShareNav).to.be.present;c.assert.cssClassPresent(`${linkShareNav} a`, 'active');},diff --git a/web/js/containers/share.js b/web/js/containers/share.jsindex e6f7f5471..c71fb8e92 100644--- a/web/js/containers/share.js+++ b/web/js/containers/share.js@@ -36,7 +36,7 @@ const getShortenRequestString = (mock, permalink) => {);};-const SOCIAL_SHARE_TABS = ['link', 'embed', 'social'];+const SOCIAL_SHARE_TABS = ['link', 'social'];class ShareLinkContainer extends Component {constructor(props) {@@ -331,7 +331,7 @@ class ShareLinkContainer extends Component {{this.renderNavTabs()}<TabContent activeTab={activeTab}>{this.renderLinkTab()}- {this.renderEmbedTab()}+ {/* {this.renderEmbedTab()} */}{this.renderSocialTab()}</TabContent></div>