Skip to content

Commit

Permalink
SAK-31184 feedback improvements (sakaiproject#2504)
Browse files Browse the repository at this point in the history
* SAK-31184 Turn Help Panel into own email form

This change changes the Help panel to have it's own backing email form.
As well as own email destination, configurable service name, and
configurable link.

* Create Reusable EmailForm Template

This change creates a reusable emailForm template which may be used
to by various panels to send emails with customizable (via bundles)
instructions.

* Each panel can now be a link or form

Within the feedback tool, each panel may now be a link or a form.
The only exception is that the content panel is always an email form.
The suggestions, helpdesk, and technical panels may all be either an
email form or an external link.

* Add two optional panels to feedback

This change adds in two default hidden panels to the feedback tool.
These panels allow administrators to configure additional "modules" /
services / etc available to users within the feedback tool. The panel's
are just shells, so they will need to be configured (setting up their
messages via bundles).

* Improve styling

These changes improve the styling of the feedback tool.
* Icons are now configurable via bundles, in the form of
bundleCategory_icon_no_translate. For example,
content_icon_no_translate or ask_icon_no_translate.
* Icons are now a fix width.
* The header now has a set height
* Bullets are added to each panel's explanation, as well as improved
spacing between items
* The panel's action (i.e. link or to emailForm) is at the bottom of
the panel and centered.
* Each panel's height and width has been increased to allow for the
explanation to not be as squished

* Improve link style

* Improve centering of bottom link
  • Loading branch information
master-bob authored and ottenhoff committed May 12, 2016
1 parent db6ab84 commit d8991e6
Show file tree
Hide file tree
Showing 15 changed files with 607 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4336,6 +4336,91 @@
# Maximum size for the feedback attachments. This value should be lower than content.upload.max value, if it's higher the tool will use content.upload.max value
# feedback.attach.max = 10

# ##
# SAK-31184
# Recipient address that will receive emails from the help panel
# [email protected]

# Configure the helpdesk Name
# feedback.helpdeskName = Institution Help Desk

# Configure the technical link destination
# If using an external link, include the https:// portion
# feedback.technicalUrl = /portal/help/main

# Configure the address to send Suggestions to
# Used if feedback.link.suggestions.panel is false
# feedback.suggestionsAddress = [email protected]

##
# The following three properties allow a panel to be a link
# If the property is TRUE, that panel will have a link to a URL at the bottom
# If the property is FALSE, that panel will link to an email Form

# For the Help Panel
# If true, uses feedback.helpdeskUrl as the link
# If false, uses feedback.helpAddress as email. Also, may use feedback.helpdeskUrl
# in the instructions of the email form.
# DEFAULT: false
# feedback.link.help.panel = true

# For the Technical Panel
# If true, uses feedback.technicalUrl as the link
# If false, uses feedback.technicalAddress for email destination. May use feedback.technicalUrl
# in the instructions of the email form
# DEFAULT: false
# feedback.link.technical.panel = true

# For the Suggestions Panel
# If true, uses feedback.featureSuggestionUrl as the link
# If false, uses feedback.suggestionsAddress as email destination. May use feedback.featureSuggestionUrl
# in the instructions of the email form
# DEFAULT: TRUE
# feedback.link.suggestions.panel = false
##

# ##
# User-configurable panels
# These are two supplemental panels administrators may use for linking to additional
# resources.
# #
# Show Supplemental A panel
# DEFAULT: false
# feedback.show.supplementalA.panel = true

# Supplemental A panel as link
# If true, the panel will be a link to a url (feedback.supplementalAUrl)
# If false, the panel will be am email form (feedback.supplementalAAddress). May use
# feedback.supplementalAUrl in the email form instructions.
# DEFAULT: true
# feedback.link.supplementalA.panel = false

# Supplemental A URL
# If using an external link, include the https:// portion
# feedback.supplementalAUrl = https://www.someWebsite.com

# Supplemental A Email Address
# feedback.supplementalAAddress = [email protected]

# #
# Show Supplemental B panel
# If true, the panel will be a link to a url (feedback.supplementalBUrl)
# If false, the panel will be am email form (feedback.supplementalBAddress). May use
# feedback.supplementalBUrl in the email form instructions
# DEFAULT: false
# feedback.show.supplementalA.panel = true

# Supplemental B URL
# If using an external link, include the https:// portion
# feedback.supplementalBUrl = https://www.someSupplementalResource.com

# Supplemental B Email Address
# feedback.supplementalBAddress = [email protected]
# ##

# SAK-31184
# #####

# ######################################################
# SAK-29952 - Course Site Publish and unpublish service and job
# ######################################################
Expand Down
4 changes: 2 additions & 2 deletions feedback/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<templates>
<template>content</template>
<template>home</template>
<template>technical</template>
<template>emailForm</template>
<template>toolbar</template>
</templates>
</configuration>
Expand Down Expand Up @@ -181,7 +181,7 @@
<templates>
<template>content</template>
<template>home</template>
<template>technical</template>
<template>emailForm</template>
<template>toolbar</template>
</templates>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion feedback/src/java/mysql/createtables.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE IF NOT EXISTS sakai_feedback (id INT NOT NULL AUTO_INCREMENT, user_id VARCHAR(99), email VARCHAR(255) NOT NULL, site_id VARCHAR(99) NOT NULL, report_type ENUM('content','technical', 'helpdesk') NOT NULL, title VARCHAR(40) NOT NULL, content TEXT NOT NULL, PRIMARY KEY(id));
CREATE TABLE IF NOT EXISTS sakai_feedback (id INT NOT NULL AUTO_INCREMENT, user_id VARCHAR(99), email VARCHAR(255) NOT NULL, site_id VARCHAR(99) NOT NULL, report_type ENUM('content','technical', 'helpdesk', 'suggestions', 'supplementala', 'supplementalb') NOT NULL, title VARCHAR(40) NOT NULL, content TEXT NOT NULL, PRIMARY KEY(id));
2 changes: 1 addition & 1 deletion feedback/src/java/oracle/createtables.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
create table sakai_feedback ( id number not null primary key, user_id varchar2(99) null, email varchar2(255) not null, site_id varchar2(99) not null, report_type varchar2(15) not null, title varchar2(40) not null, content varchar2(4000) not null, constraint cons_report_type check (report_type IN ('content','technical', 'helpdesk')));
create table sakai_feedback ( id number not null primary key, user_id varchar2(99) null, email varchar2(255) not null, site_id varchar2(99) not null, report_type varchar2(15) not null, title varchar2(40) not null, content varchar2(4000) not null, constraint cons_report_type check (report_type IN ('content','technical', 'helpdesk', 'suggestions', 'supplementala', 'supplementalb')));
create sequence sakai_feedback_seq start with 1 increment by 1 nomaxvalue;
110 changes: 99 additions & 11 deletions feedback/src/java/org/sakaiproject/feedback/tool/FeedbackTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ public class FeedbackTool extends HttpServlet {

private SiteService siteService = null;

private final String[] DYNAMIC_PROPERTIES = { "help_tooltip", "overview", "technical_setup_instruction", "feature_suggestion_setup_instruction",
"report_technical_tooltip", "short_technical_description",
"suggest_feature_tooltip", "feature_description", "technical_instruction", "error", "help_home"};
private final String[] DYNAMIC_PROPERTIES = { "help_tooltip", "overview", "technical_setup_instruction", "report_technical_tooltip", "short_technical_description",
"suggest_feature_tooltip", "feature_description", "technical_instruction", "ask_instruction", "error", "help_home", "ask_setup_instruction", "feature_suggestion_setup_instruction"};

// In entitybroker you can't have slashes in IDs so we need to escape them.
public static final String FORWARD_SLASH = "FORWARD_SLASH";
Expand Down Expand Up @@ -128,24 +127,108 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t

setMapAttribute(request, "i18n", getBundle(serviceName));
setStringAttribute(request, "language", rb.getLocale().getLanguage());
request.setAttribute("enableTechnical",
(sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_ADDRESS, null) == null)
? false : true);

String technicalToAddress = sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_ADDRESS, null);
setStringAttribute(request, "technicalToAddress", technicalToAddress);
Boolean technicalPanelAsLink = sakaiProxy.getConfigBoolean(Constants.TECHNICAL_PANEL_AS_LINK, false);
request.setAttribute("technicalPanelAsLink", technicalPanelAsLink);

String helpToAddress = sakaiProxy.getConfigString(Constants.PROP_HELP_ADDRESS, null);
setStringAttribute(request, "helpToAddress", helpToAddress);
Boolean helpPanelAsLink = sakaiProxy.getConfigBoolean(Constants.HELP_PANEL_AS_LINK, false);
request.setAttribute("helpPanelAsLink", helpPanelAsLink);

String suggestionsToAddress = sakaiProxy.getConfigString(Constants.PROP_SUGGESTIONS_ADDRESS, null);
setStringAttribute(request, "suggestionsToAddress", suggestionsToAddress);
Boolean suggestionsPanelAsLink = sakaiProxy.getConfigBoolean(Constants.SUGGESTIONS_PANEL_AS_LINK, true);
request.setAttribute("suggestionsPanelAsLink", suggestionsPanelAsLink);

String supplementalAToAddress = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_A_ADDRESS, null);
setStringAttribute(request, "supplementalAToAddress", supplementalAToAddress);
Boolean supplementalAPanelAsLink = sakaiProxy.getConfigBoolean(Constants.SUPPLEMENTAL_A_PANEL_AS_LINK, true);
request.setAttribute("supplementalAPanelAsLink", supplementalAPanelAsLink);

String supplementalBToAddress = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_B_ADDRESS, null);
setStringAttribute(request, "supplementalBToAddress", supplementalBToAddress);
Boolean supplementalBPanelAsLink = sakaiProxy.getConfigBoolean(Constants.SUPPLEMENTAL_B_PANEL_AS_LINK, true);
request.setAttribute("supplementalBPanelAsLink", supplementalBPanelAsLink);

request.setAttribute("sakaiHtmlHead", (String) request.getAttribute("sakai.html.head"));
setStringAttribute(request, "userId", (userId == null) ? "" : userId);
setStringAttribute(request, "siteId", (siteId != null)?siteId.replaceAll("/", FORWARD_SLASH):null);
request.setAttribute("siteExists", siteExists);
setStringAttribute(request, "featureSuggestionUrl", sakaiProxy.getConfigString("feedback.featureSuggestionUrl", ""));
setStringAttribute(request, "helpPagesUrl", sakaiProxy.getConfigString("feedback.helpPagesUrl", "/portal/help/main"));
setStringAttribute(request, "helpPagesTarget", sakaiProxy.getConfigString("feedback.helpPagesTarget", "_blank"));
setStringAttribute(request, "supplementaryInfo", sakaiProxy.getConfigString("feedback.supplementaryInfo", ""));
setStringAttribute(request, "helpPagesUrl", sakaiProxy.getConfigString(Constants.PROP_HELPPAGES_URL, "/portal/help/main"));

String featureSuggestionUrl = sakaiProxy.getConfigString(Constants.PROP_SUGGESTIONS_URL, "");
setStringAttribute(request, "featureSuggestionUrl", featureSuggestionUrl);
String helpdeskUrl = sakaiProxy.getConfigString(Constants.PROP_HELPDESK_URL, "");
setStringAttribute(request, "helpdeskUrl", helpdeskUrl);
String technicalUrl = sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_URL, "");
setStringAttribute(request, "technicalUrl", technicalUrl);
String supplementalAUrl = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_A_URL, "");
setStringAttribute(request, "supplementalAUrl", supplementalAUrl);
String supplementalBUrl = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_B_URL, "");
setStringAttribute(request, "supplementalBUrl", supplementalBUrl);

Boolean enableHelp = true;
if (helpPanelAsLink) {
if (helpdeskUrl.isEmpty()) {
enableHelp = false;
}
} else {
enableHelp = helpToAddress != null;
}
request.setAttribute("enableHelp", enableHelp);

Boolean enableTechnical = true;
if (technicalPanelAsLink) {
if (technicalUrl.isEmpty()) {
enableTechnical = false;
}
} else {
enableTechnical = technicalToAddress != null;
}
request.setAttribute("enableTechnical", enableTechnical);

Boolean enableSuggestions = true;
if (suggestionsPanelAsLink) {
if (featureSuggestionUrl.isEmpty()) {
enableSuggestions = false;
}
} else {
enableSuggestions = suggestionsToAddress != null;
}
request.setAttribute("enableSuggestions", enableSuggestions);

Boolean enableSupplementalA = true;
if (supplementalAPanelAsLink) {
if (supplementalAUrl.isEmpty()) {
enableSupplementalA = false;
}
} else {
enableSupplementalA = supplementalAToAddress != null;
}
request.setAttribute("enableSupplementalA", enableSupplementalA);

Boolean enableSupplementalB = true;
if (supplementalBPanelAsLink) {
if (supplementalBUrl.isEmpty()) {
enableSupplementalB = false;
}
} else {
enableSupplementalB = supplementalBToAddress != null;
}
request.setAttribute("enableSupplementalB", enableSupplementalB);

setStringAttribute(request, "helpPagesTarget", sakaiProxy.getConfigString(Constants.PROP_HELPPAGES_TARGET, "_blank"));
setStringAttribute(request, "supplementaryInfo", sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTARY_INFO, ""));
request.setAttribute("maxAttachmentsMB", sakaiProxy.getAttachmentLimit());
setStringAttribute(request, "technicalToAddress", sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_ADDRESS, null));
request.setAttribute("showContentPanel", sakaiProxy.getConfigBoolean(Constants.SHOW_CONTENT_PANEL, true));
request.setAttribute("showHelpPanel", sakaiProxy.getConfigBoolean(Constants.SHOW_HELP_PANEL, true));
request.setAttribute("showTechnicalPanel", sakaiProxy.getConfigBoolean(Constants.SHOW_TECHNICAL_PANEL, true));
request.setAttribute("showSuggestionsPanel", sakaiProxy.getConfigBoolean(Constants.SHOW_SUGGESTIONS_PANEL, true));
request.setAttribute("showSupplementalAPanel", sakaiProxy.getConfigBoolean(Constants.SHOW_SUPPLEMENTAL_A_PANEL, false));
request.setAttribute("showSupplementalBPanel", sakaiProxy.getConfigBoolean(Constants.SHOW_SUPPLEMENTAL_B_PANEL, false));

String contactName = null;
String siteEmail = null;
Expand Down Expand Up @@ -224,6 +307,11 @@ private Map<String, String> getBundle(String serviceName) {
private void formatProperties(ResourceLoader rb, Map<String, String> bundleMap, String serviceName) {

for (String property : DYNAMIC_PROPERTIES) {
if(property.equals("ask_instruction")) {
String name = sakaiProxy.getConfigString("feedback.helpdeskName", serviceName);
bundleMap.put(property, MessageFormat.format(rb.getString(property), new String[]{name}));
continue;
}
bundleMap.put(property, MessageFormat.format(rb.getString(property), new String[]{serviceName}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ public String handleHelpReport(EntityView view, Map<String, Object> params) {
return handleReport(view, params, Constants.HELPDESK);
}

@EntityCustomAction(action = "reportsuggestions", viewKey = EntityView.VIEW_EDIT)
public String handleSuggestionsReport(EntityView view, Map<String, Object> params) {
return handleReport(view, params, Constants.SUGGESTIONS);
}

@EntityCustomAction(action = "reportsupplementala", viewKey = EntityView.VIEW_EDIT)
public String handleSupplementalAReport(EntityView view, Map<String, Object> params) {
return handleReport(view, params, Constants.SUPPLEMENTAL_A);
}

@EntityCustomAction(action = "reportsupplementalb", viewKey = EntityView.VIEW_EDIT)
public String handleSupplementalBReport(EntityView view, Map<String, Object> params) {
return handleReport(view, params, Constants.SUPPLEMENTAL_B);
}

private String handleReport(final EntityView view, final Map<String, Object> params, final String type) {

final String userId = developerHelperService.getCurrentUserId();
Expand Down Expand Up @@ -273,8 +288,15 @@ private String getToAddress(String type, String siteId) {
if (toAddress==null){
toAddress = sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_ADDRESS, null);
}
}
else {
} else if(Constants.HELPDESK.equals(type)){
toAddress = sakaiProxy.getConfigString(Constants.PROP_HELP_ADDRESS, null);
} else if(Constants.SUGGESTIONS.equals(type)){
toAddress = sakaiProxy.getConfigString(Constants.PROP_SUGGESTIONS_ADDRESS, null);
} else if(Constants.SUPPLEMENTAL_A.equals(type)){
toAddress = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_A_ADDRESS, null);
} else if(Constants.SUPPLEMENTAL_B.equals(type)){
toAddress = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_B_ADDRESS, null);
} else {
toAddress = sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_ADDRESS, null);
}
return toAddress;
Expand Down
26 changes: 26 additions & 0 deletions feedback/src/java/org/sakaiproject/feedback/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,36 @@ public class Constants {
public final static String CONTENT = "content";
public final static String TECHNICAL = "technical";
public final static String HELPDESK = "helpdesk";
public final static String SUGGESTIONS = "suggestions";
public final static String SUPPLEMENTAL_A = "supplementala";
public final static String SUPPLEMENTAL_B = "supplementalb";

public final static String PROP_TECHNICAL_ADDRESS = "feedback.technicalAddress";
public final static String PROP_HELP_ADDRESS = "feedback.helpAddress";
public final static String PROP_SUGGESTIONS_ADDRESS = "feedback.suggestionsAddress";
public final static String PROP_SUPPLEMENTAL_A_ADDRESS = "feedback.supplementalAAddress";
public final static String PROP_SUPPLEMENTAL_B_ADDRESS = "feedback.supplementalBAddress";

public final static String PROP_TECHNICAL_URL = "feedback.technicalUrl";
public final static String PROP_HELPDESK_URL = "feedback.helpdeskUrl";
public final static String PROP_HELPPAGES_URL = "feedback.helpPagesUrl";
public final static String PROP_SUGGESTIONS_URL = "feedback.featureSuggestionUrl";
public final static String PROP_SUPPLEMENTAL_A_URL = "feedback.supplementalAUrl";
public final static String PROP_SUPPLEMENTAL_B_URL = "feedback.supplementalBUrl";

public final static String PROP_HELPPAGES_TARGET = "feedback.helpPagesTarget";
public final static String PROP_SUPPLEMENTARY_INFO = "feedback.supplementaryInfo";

public final static String SHOW_CONTENT_PANEL = "feedback.show.content.panel";
public final static String SHOW_HELP_PANEL = "feedback.show.help.panel";
public final static String SHOW_TECHNICAL_PANEL = "feedback.show.technical.panel";
public final static String SHOW_SUGGESTIONS_PANEL = "feedback.show.suggestions.panel";
public final static String SHOW_SUPPLEMENTAL_A_PANEL = "feedback.show.supplementalA.panel";
public final static String SHOW_SUPPLEMENTAL_B_PANEL = "feedback.show.supplementalB.panel";

public final static String HELP_PANEL_AS_LINK = "feedback.link.help.panel";
public final static String TECHNICAL_PANEL_AS_LINK = "feedback.link.technical.panel";
public final static String SUGGESTIONS_PANEL_AS_LINK = "feedback.link.suggestions.panel";
public final static String SUPPLEMENTAL_A_PANEL_AS_LINK = "feedback.link.supplementalA.panel";
public final static String SUPPLEMENTAL_B_PANEL_AS_LINK = "feedback.link.supplementalB.panel";
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,17 @@ public void sendEmail(String fromUserId, String senderAddress, String toAddress,
final ResourceLoader rb = new ResourceLoader("org.sakaiproject.feedback");

String subjectTemplate = null;

if (feedbackType.equals(Constants.CONTENT)) {
subjectTemplate = rb.getString("content_email_subject_template");
} else if (feedbackType.equals(Constants.HELPDESK)) {
subjectTemplate = rb.getString("help_email_subject_template");
} else if (feedbackType.equals(Constants.SUGGESTIONS)) {
subjectTemplate = rb.getString("suggestion_email_subject_template");
} else if (feedbackType.equals(Constants.SUPPLEMENTAL_A)) {
subjectTemplate = rb.getString("supplemental_a_email_subject_template");
} else if (feedbackType.equals(Constants.SUPPLEMENTAL_B)) {
subjectTemplate = rb.getString("supplemental_b_email_subject_template");
} else {
subjectTemplate = rb.getString("technical_email_subject_template");
}
Expand Down
Loading

0 comments on commit d8991e6

Please sign in to comment.