Reduce feedback form options and add ability to specify failing app

This commit is contained in:
Johannes Zellner
2018-03-05 12:54:09 +01:00
parent 451c697fb7
commit 2b6ce4f813
4 changed files with 20 additions and 12 deletions

View File

@@ -240,7 +240,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
$scope.feedback.busy = true;
$scope.feedback.error = null;
Client.feedback($scope.feedback.type, $scope.feedback.subject, $scope.feedback.description, function (error) {
Client.feedback($scope.feedback.type, $scope.feedback.subject, $scope.feedback.description, null, function (error) {
$scope.feedback.busy = false;
if (error) {

View File

@@ -34,17 +34,21 @@
<form name="feedbackForm" ng-submit="submitFeedback()">
<div class="form-group">
<select class="form-control" name="type" style="width: 50%;" ng-model="feedback.type" required>
<option value="feedback">Enhancement / Idea</option>
<option value="ticket">Bug Report</option>
<option value="app_missing">Missing App</option>
<option value="app_error">App Error/Failing</option>
<option value="app_error">App Error</option>
</select>
</div>
<div class="form-group" ng-show="feedback.type === 'app_error'">
<select class="form-control" name="type" style="width: 50%;" ng-model="feedback.app" ng-required="feedback.type === 'app_error'">
<option value="" disabled selected>Select App</option>
<option ng-repeat="app in apps" value="{{ app.id }}">{{ app.fqdn }}</option>
</select>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.subject.$dirty && feedbackForm.subject.$invalid) }">
<input type="text" class="form-control" name="subject" placeholder="Enter your idea or issue" ng-model="feedback.subject" ng-maxlength="512" ng-minlength="1" required>
<input type="text" class="form-control" name="subject" placeholder="Topic" ng-model="feedback.subject" ng-maxlength="512" ng-minlength="1" required>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.description.$dirty && feedbackForm.description.$invalid) }">
<textarea class="form-control" name="description" rows="3" placeholder="Describe your idea or issue" ng-model="feedback.description" ng-minlength="1" required></textarea>
<textarea class="form-control" name="description" rows="3" placeholder="Describe your issue" ng-model="feedback.description" ng-minlength="1" required></textarea>
</div>
<button type="submit" class="btn btn-primary" ng-disabled="feedbackForm.$invalid || feedback.busy"><i class="fa fa-circle-o-notch fa-spin" ng-show="feedback.busy"></i> Submit</button>
<span ng-show="feedback.error" class="text-danger text-bold">{{feedback.error}}</span>

View File

@@ -3,14 +3,16 @@
angular.module('Application').controller('SupportController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
$scope.config = Client.getConfig();
$scope.user = Client.getUserInfo();
$scope.apps = Client.getInstalledApps();
$scope.feedback = {
error: null,
success: false,
busy: false,
subject: '',
type: '',
description: ''
type: 'ticket',
description: '',
appId: ''
};
$scope.sshSupportEnabled = false;
@@ -18,7 +20,8 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
function resetFeedback() {
$scope.feedback.subject = '';
$scope.feedback.description = '';
$scope.feedback.type = '';
$scope.feedback.type = 'ticket';
$scope.feedback.appId = '';
$scope.feedbackForm.$setUntouched();
$scope.feedbackForm.$setPristine();
@@ -29,7 +32,7 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
$scope.feedback.success = false;
$scope.feedback.error = null;
Client.feedback($scope.feedback.type, $scope.feedback.subject, $scope.feedback.description, function (error) {
Client.feedback($scope.feedback.type, $scope.feedback.subject, $scope.feedback.description, $scope.feedback.appId, function (error) {
if (error) {
$scope.feedback.error = error.message;
} else {