mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-11 17:08:23 +00:00
updates play to read output from build dir and serve content inline for serveAsset action. sets the rootURL for Ember to assets on prod. overrides ESA to redirect to / rather than default rootURL for an environment.
This commit is contained in:
parent
ae9162aa86
commit
12f2bc9ec5
@ -41,13 +41,18 @@ public class Application extends Controller
|
||||
private static String PIWIK_SITE_ID = "tracking.piwik.siteid";
|
||||
|
||||
/**
|
||||
* Serves the index view for any given path
|
||||
* Serves the build output index.html for any given path
|
||||
* @param path takes a path string, which essentially is ignored
|
||||
* routing is managed client side
|
||||
* @return {Result}
|
||||
* @return {Result} build output index.html resource
|
||||
*/
|
||||
public static Result serveAsset(String path) {
|
||||
return ok(index.render());
|
||||
// Get the build output Html file
|
||||
java.io.File indexHtml = new java.io.File("build/assets/index.html");
|
||||
// Sets the Content-Disposition to inline to indicate that the browser should
|
||||
// not treat this as an attachment to be downloaded
|
||||
response().setHeader("Content-Disposition", "inline");
|
||||
return ok(indexHtml);
|
||||
}
|
||||
|
||||
public static Result healthcheck()
|
||||
|
@ -6,7 +6,8 @@ const {
|
||||
Route,
|
||||
run,
|
||||
get,
|
||||
inject: { service }
|
||||
inject: { service },
|
||||
testing,
|
||||
} = Ember;
|
||||
|
||||
export default Route.extend(ApplicationRouteMixin, {
|
||||
@ -30,6 +31,19 @@ export default Route.extend(ApplicationRouteMixin, {
|
||||
this._loadCurrentUser();
|
||||
},
|
||||
|
||||
/**
|
||||
* __It reloads the Ember.js application__ by redirecting the browser
|
||||
* to the application's root URL so that all in-memory data (such as Ember
|
||||
* Data stores etc.) gets cleared.
|
||||
* @override ApplicationRouteMixin.sessionInvalidated
|
||||
* @link https://github.com/simplabs/ember-simple-auth/issues/1048
|
||||
*/
|
||||
sessionInvalidated() {
|
||||
if (!testing) {
|
||||
window.location.replace('/');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Internal method to invoke the currentUser service's load method
|
||||
* If an exception occurs during the load for the current user,
|
||||
|
@ -69,13 +69,11 @@ const ldapResolver = (userNameQuery, syncResults, asyncResults) => {
|
||||
* @param {String} userName the unique userName
|
||||
* @return {Promise.<TResult|null>} resolves with the userEntity or null otherwise
|
||||
*/
|
||||
const getPartyEntityWithUserName = userName => {
|
||||
return getLDAPUsers()
|
||||
.then(
|
||||
({ userEntities }) => userEntities.find(({ label }) => label === userName) ||
|
||||
null
|
||||
);
|
||||
};
|
||||
const getPartyEntityWithUserName = userName => getLDAPUsers()
|
||||
.then(
|
||||
({ userEntities }) => userEntities.find(({ label }) => label === userName) ||
|
||||
null
|
||||
);
|
||||
|
||||
export default Service.extend({
|
||||
getPartyEntityWithUserName,
|
||||
|
@ -61,7 +61,7 @@ module.exports = function(environment) {
|
||||
}
|
||||
|
||||
if (environment === 'production') {
|
||||
|
||||
ENV.rootURL = '/assets';
|
||||
}
|
||||
|
||||
return ENV;
|
||||
|
Loading…
x
Reference in New Issue
Block a user