Skip to content
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

improve local UI testing and ability for pluggable UI #2120

Merged
merged 1 commit into from
Jul 18, 2017

Conversation

bradrydzewski
Copy link

No description provided.

@bradrydzewski
Copy link
Author

This pull requests allows the user interface to be loaded from disk. You can provide the path to your user interface

DRONE_WWW=/path/to/website

This directly should container the application entrypoint as an index.html file. The index.html file must include a <!-- inject:js --> placeholder.

<!doctype html>
<html lang="en">
	<head>
		<!-- inject:js -->
		<!-- endinject -->

The <!-- inject:js --> placeholder is replaced with the following javascript code that provides the web application with the authenticated user and csrf token. The web application code should look for these values.

<!doctype html>
<html lang="en">
	<head>
		<!-- inject:js -->
		<script>
			window.ENV = {};
			window.ENV.server = window.location.protocol+"//"+window.location.host;
			window.ENV.csrf = "..."
			window.USER = {...}
		</script>
		<!-- endinject -->

Drone will load files from disk matching the below paths. If you are building a custom user interface, you should place all static files in the /static directory and use index.html as the main entrypoint.

/index.html
/favicon-32x32.png
/favicon-16x16.png
/src/*
/bower_components/*
/static/*

This should simplify local development and should allow pluggable user interfaces.

cc @alansouzati

@bradrydzewski bradrydzewski merged commit 87d51ca into harness:master Jul 18, 2017
@alansouzati
Copy link

cool stuff, can't wait to try this with Grommet. I'm working on Grommet 2.0 as of now so I will probably get back to it and change grommet-drone-ui to use this new stuff and also migrate the existing UI to Grommet 2.0 👍

@bradrydzewski
Copy link
Author

@alansouzati cool, I look forward to it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants