Skip to content

Commit

Permalink
Updates to routes and links
Browse files Browse the repository at this point in the history
  • Loading branch information
johc committed Nov 15, 2023
1 parent 2873a42 commit 18e5ec6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ export function ConfigurationController($scope, $http, menuService, endpointServ
$scope.fetchTelemetryConsent = function () {
$http.post(`/dashboard/get_telemetry_answered`)
.then(function (response) {
$scope.telemetryConsent = response.data.get_telemetry_answered ? 'true' : 'false';
$scope.telemetryConsent = response.data.get_telemetry_answered;
}, function (error) {
console.error('Error fetching telemetry consent:', error);
});
};

$scope.handleTelemetry = function (consent) {
$http.post('/dashboard/telemetry/accept_telemetry', { 'consent': consent === 'true' })
$http.post('/dashboard/telemetry/accept_telemetry', { 'consent': consent })
.then(function (response) {
}, function (error) {
console.error('Error updating telemetry consent:', error);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function SurveyController($scope, $http) {
export function SurveyController($scope, $http, $sce) {
$scope.surveyShow = false;
$scope.surveyCompleted = false; // New flag for survey completion
$scope.surveyVariationIndex = 0;
Expand All @@ -8,7 +8,11 @@ export function SurveyController($scope, $http) {
'We value your opinion! Click <a href="https://forms.gle/kWD5mqcibS2V5f3Y6" target="_blank">here</a> to share your thoughts.',
'Help us improve! Participate in our <a href="https://forms.gle/kWD5mqcibS2V5f3Y6" target="_blank">short survey</a>.'
];


$scope.surveyVariations = $scope.surveyVariations.map(variation =>
$sce.trustAsHtml(variation)
);


$scope.fetchSurveyStatus = function () {
$http.post('/dashboard/survey_status')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ export function TelemetryController($scope, $http) {
$scope.telemetryShow = false;
$scope.followUpShow = false;

$scope.fetchConsent = function () {
$scope.fetchTelemetryConsent = function () {
$http.post(`/dashboard/get_telemetry_answered`)
.then(function (response) {
$scope.telemetryShow = !response.data.get_telemetry_answered;
}, function (error) {
console.error('Error fetching consent:', error);
console.error('Error fetching telemetry consent:', error);
});
};
$scope.fetchConsent();
$scope.fetchTelemetryConsent();

$scope.handleTelemetry = function (consent) {
$scope.telemetryShow = false;
Expand All @@ -20,7 +20,7 @@ export function TelemetryController($scope, $http) {
.then(function (response) {
$scope.telemetryShow = false;
}, function (error) {
console.error('Error:', error);
console.error('Error updating telemetry consent:', error);
});
};

Expand Down Expand Up @@ -56,7 +56,6 @@ export function TelemetryController($scope, $http) {
}
}
}

$http.post('https://parseapi.back4app.com/classes/FollowUp', { reasons: feedback }, config)
.then(function (response) {
console.log('Feedback sent:', response.data);
Expand Down
Loading

0 comments on commit 18e5ec6

Please sign in to comment.