Skip to content

Commit

Permalink
fixed issue Usability issue in feedback functionality for anonymous u…
Browse files Browse the repository at this point in the history
…ser #3132

in progress

Usability issue in feedback functionality for anonymous user complete

remove the error of Travis ci

tooltip added

extra field removed

tooltip added

conflicts resolved

remove the error of Travis Ci

conflicts resolved
  • Loading branch information
krashna-deligence committed Dec 4, 2017
1 parent b0ca3e6 commit e4ab32d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
28 changes: 14 additions & 14 deletions apinf_packages/core/lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"addApi_header": "Add an API",
"addApi_enterApiDetails": "Enter API details",
"addApi_separateLineTitle_or": "or",
"addApi_sectionTitle_importOpenApiSpecification": "Import OpenAPI Specification",
"addApi_sectionTitle_importApiConfiguration": "Import API Configuration",
"addApiBacklogItem_addBacklogItem_button": "Add backlog item",
"addApiBacklogItem_modalTitle": "Add backlog item",
"addBackend_simple_backendInformation_helptext": "Enter the URL and port of the remote server. E.g. google.com:80",
Expand Down Expand Up @@ -345,6 +343,10 @@
"feedback_feedbackForm_button": "Send feedback",
"feedback_feedbackForm_description": "We welcome problem reports, feature ideas and general comments.",
"feedback_feedbackForm_title": "Send feedback or report a problem",
"feedback_feedbackForm_withLogin_tooltip": "Add feedback to the API",
"feedback_feedbackForm_withoutLogin_tooltip": "Login or register to provide your feedback to the API",
"feedback_feedbackForm_withLogin_tooltip": "Add feedback to the API",
"feedback_feedbackForm_withoutLogin_tooltip": "Login or register to provide your feedback to the API",
"feedback_main_title": "Feedback and report messages",
"feedback_no_feedback": "No feedback, yet.",
"feedback_remove_button": "Remove",
Expand Down Expand Up @@ -399,19 +401,13 @@
"homePageApis_text_getMoreApis": "More APIs",
"importApiConfiguration_errorMessage": "Config file must be either in .YAML, .YML or .JSON format.",
"importApiConfiguration_jsonError_message": "Configuration file is not a valid JSON object.",
"import_ApiConfiguration_Extensions": "Only yml, yaml and json format will be accepted.",
"import_ApiConfiguration_FileLabel": "File",
"addApi_sectionTitle_importApiConfiguration": "Import API Configuration",
"import_ApiConfiguration_Extensions": "Only yml, yaml and json format will be accepted",
"import_ApiConfiguration_ImportApi": "Import API",
"importOpenApiSpecification_text_addApiByImporting": "You can add API by importing the OpenAPI Specification.",
"importOpenApiSpecification_message_provideSpecification": "You need provide OpenAPI specification using any method",
"importOpenApiSpecification_labelText_provideSpecification": "Provide API Documentation via",
"importOpenApiSpecification_labelText_linkTo": "Link to OpenAPI Specification",
"importOpenApiSpecification_labelText_lifecycleStatus": "Lifecycle status",
"importOpenApiSpecification_buttonText_import": "Import",
"importOpenApiSpecification_optionText_file": "File",
"importOpenApiSpecification_optionText_url": "URL",
"importOpenApiSpecification_optionText_firstOption": "Select lifecycle status",
"importOpenApiSpecificationUploadButton_buttonText_file": "Choose file",
"import_ApiConfiguration_FileLabel": "File:",
"import_ApiDocumentation_File": "Documentation Configuration File",
"importApiDocumentation_fileExtensionError_message": "Only .json and .yaml(.yml) files are supported.",
"importApiDocumentation_fileReadError_message": "Error when reading the file. Please check file contents for errors.",
"invalidUrlMessage": "Must be a valid URL with http(s)",
"invalidIdMessage": "Must be a valid alphanumeric ID",
"invalidDomainMessage": "Must be a valid domain",
Expand Down Expand Up @@ -839,6 +835,10 @@
"Error report": "Error report",
"Feature request": "Feature request"
}
},
"email": {
"label": "Email",
"placeholder": "Enter your email"
}
},
"monitoring": {
Expand Down
8 changes: 3 additions & 5 deletions apinf_packages/feedback/client/feedback.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

<template name="apiFeedback">
<div class="">
{{# if currentUser }}
<div class="row">
<div class="col-md-10 col-sm-8 col-xs-8">
<h4 id="feedback-title">
Expand Down Expand Up @@ -35,19 +34,18 @@ <h4 id="feedback-title">
<button
type="button"
class="hidden-sm hidden-xs btn btn-info btn-xs feedback-form-button pull-right"
id="add-feedback">
id="add-feedback" data-toggle="tooltip" data-original-title="{{isToolTip}}">
<i class="fa fa-paper-plane" aria-hidden="true"></i>&nbsp;
{{_ "feedback_feedbackForm_button" }}
</button>
<button
type="button"
class="hidden-md hidden-lg btn btn-info btn-md feedback-form-button pull-right"
id="add-feedback">
id="add-feedback" title="{{isToolTip}}">
<i class="fa fa-plus" aria-hidden="true"></i>
</button>
</div>
</div>
{{/ if }}
{{> feedbackList feedbackItems=feedbackItems api=api }}
{{> feedbackList feedbackItems=feedbackItems api=api }}
</div>
</template>
19 changes: 17 additions & 2 deletions apinf_packages/feedback/client/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Template } from 'meteor/templating';
// Meteor contributed packages imports
import { Modal } from 'meteor/peppelg:bootstrap-3-modal';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { TAPi18n } from 'meteor/tap:i18n';

// Collection imports
import Feedback from '../collection';
Expand Down Expand Up @@ -40,12 +41,26 @@ Template.apiFeedback.helpers({

return feedbackCount === publicFeedbackCount;
},
isToolTip () {
if (Meteor.userId()) {
// Add tooltip for loged In users
return TAPi18n.__('feedback_feedbackForm_withLogin_tooltip');
}
// Add tooltip for anonymous users
return TAPi18n.__('feedback_feedbackForm_withoutLogin_tooltip');
},
});

Template.apiFeedback.events({
'click #add-feedback': function () {
// Show feedbackForm modal
Modal.show('feedbackForm', { formType: 'insert' });
const userId = Meteor.userId();
if (userId) {
// Show feedbackForm modal
Modal.show('feedbackForm', { formType: 'insert' });
} else {
// Redirect to login page
FlowRouter.go('signIn');
}
},
'click #mark-all-feedbacks-as-private': () => {
// Get slug
Expand Down

0 comments on commit e4ab32d

Please sign in to comment.