fix ems hotlink (#26868) (#26927)

This commit is contained in:
Thomas Neirynck 2018-12-10 18:07:40 -05:00 committed by GitHub
parent dd8e16a70b
commit 8e3f22d5d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -321,5 +321,13 @@ describe('service_settings (FKA tilemaptest)', function () {
expect(fileLayers).to.eql(expected);
});
it ('should get hotlink', async () => {
mapConfig.emsLandingPageUrl = 'https://foo/bar';
const fileLayers = await serviceSettings.getFileLayers();
const hotlink = serviceSettings.getEMSHotLink(fileLayers[0]);
expect(hotlink).to.eql('https://foo/bar#file/US States');
});
});
});

View file

@ -200,7 +200,7 @@ uiModules.get('kibana')
}
}
async getEMSHotLink(fileLayer) {
getEMSHotLink(fileLayer) {
const id = `file/${fileLayer.name}`;
return `${mapConfig.emsLandingPageUrl}#${id}`;
}