JILS-28: Enable Per-Domain Javascript Functionality



Issue Information

Issue Type: New Feature
 
Priority: Minor
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: Jira Issue Listing Script (JILS)
Resolution: Done (2016-04-29 15:05:58)
Affects Version: 0.01b,
Target version: 0.01b,

Created: 2015-01-25 10:00:06
Time Spent Working


Description
The actual implementation probably won't make it into the core codebase (as a system specific repo seems like a better plan) but it seems worth documenting within the core project for the following reasons

- Some minor changes may be made in the core-codebase to support the functionality
- Documentation will probably be created in case others want to do something similar

Essentially, the FR boils down to this;

Output from the script is used on a variety of subdomains, with different filters enabled for each (enforced server side). Where output is being used to provide a customer with an overview of their project(s) it'd be useful to be able to provide a basic form enabling them to add a comment (or raise an issue, etc).

One way to achieve this would be to have multiple versions of the codebase on the JIRA server, but that's a maintainability nightmare, so instead, this FR proposes the following

- Add some hidden elements to the core codebase (commentDiv, possibly searchDiv etc)
- Develop some Javascript which fetches a specific JS file based on the domain name (which will probably be hashed to help prevent scripted discovery of the DS scripts)

Where needed, each script can then enable the hidden elements and populate them with the relevant elements.

Doing it this way does mean that JS would need to be enabled for anyone wishing to use the existing functionality, but also helps ensure that we're not sending a plethora of hidden elements to users who have no need for it (for example, this functionality is unlikely to ever be needed on projects.bentasker.co.uk).

The main functionality I'm interested in, at the moment, is a means to add comments and a means to raise an issue (though the former is more important). How the actual submission works isn't (or shouldn't be) relevant to this FR.


Toggle State Changes

Activity



Repo: Jira-Issue-Listing
Commit: be1e268a92543d3f9f4bba3bf54e3452f9216bd5
Author: Ben Tasker <github@<Domain Hidden>>

Date: Sun Jan 25 13:06:10 2015 +0000
Commit Message: Adding new elements for JILS-28



Modified (-)(+)
-------
issue_page.php
issues-table.php
static/core.css




Webhook User-Agent

GitHub-Hookshot/2e7ffb9


View Commit

The functionality added so far (on projects.bentasker.co.uk) seems to work
Commit 3977ece added a placeholder with an id of logoarea

Within the domain specific javascript for projects.bentasker.co.uk, I added the following in order to display a logo in the top bar
var logo = document.createElement('img');
logo.src = 'https://static1.bentasker.co.uk/images/eagle_black_large_trans.png';
logo.alt = 'B Tasker';
logo.title = 'B Tasker';
logo.href = 'https://www.bentasker.co.uk';

var logoarea = document.getElementById('logoarea');
logoarea.appendChild(logo);
logoarea.style.display = 'inline';


I also added some CSS to my custom stylesheet in order to enforce a set size and position the logo

View Commit
btasker changed status from 'Open' to 'In Progress'
This seems to be working correctly. Marking as complete.
btasker changed status from 'In Progress' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'
Re-opening to assign to a version
btasker removed 'Done' from resolution
btasker changed status from 'Closed' to 'Reopened'
Assigning to v0.01b
btasker added '0.01b' to Version
btasker added '0.01b' to Fix Version
Re-Closing
btasker changed status from 'Reopened' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'