Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass in the proxyUrl if we have specified we want it. #893

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion app/assets/javascripts/controllers/detailedDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,24 @@
angular.module('QuepidApp')
.controller('DetailedDocCtrl', [
'$scope', '$uibModalInstance',
'settingsSvc','caseTryNavSvc',
'doc',
function DetailedDocCtrl($scope, $uibModalInstance, doc) {
function DetailedDocCtrl(
$scope, $uibModalInstance,
settingsSvc, caseTryNavSvc,
doc) {

$scope.doc = doc;

$scope.linkToDoc = function() {
let url = $scope.doc._url();
if (settingsSvc.applicableSettings().proxyRequests === true) {
url = caseTryNavSvc.getQuepidProxyUrl() + url;
}

return url;
};

$scope.showAllFields = false;

$scope.allFields = function() {
Expand Down
9 changes: 8 additions & 1 deletion app/assets/javascripts/services/docCacheSvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ angular.module('QuepidApp')
'$q',
'$log',
'docResolverSvc',
'caseTryNavSvc',
function docCacheSvc(
$q,
$log,
docResolverSvc
docResolverSvc,
caseTryNavSvc
) {
var docCache = {};

Expand Down Expand Up @@ -52,6 +54,11 @@ angular.module('QuepidApp')
}
});

if (settings.proxyRequests === true){
// Pass in the Quepid specific proxy url
settings.proxyUrl = caseTryNavSvc.getQuepidProxyUrl();
}

var docIds = Object.keys(docsToFetch);
var resolver = docResolverSvc.createResolver(docIds, settings, 15);

Expand Down
2 changes: 1 addition & 1 deletion app/assets/templates/views/detailedDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h4>{{doc.title}}</h4>
</div>
</div>

<a class="btn btn-primary" ng-href="{{doc._url()}}" target="_blank" ng-disabled="doc._url() === null">
<a class="btn btn-primary" ng-href="{{linkToDoc()}}" target="_blank" ng-disabled="doc._url() === null">
View Document
</a>

Expand Down
2 changes: 1 addition & 1 deletion app/assets/templates/views/snapshotModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3 class="modal-title">Take a Snapshot of all your queries?</h3>

<label>Include Document Fields</label>
<p>
To facilitate the human rating interface, you need to record as part of the snapshot all the displayed fields for each document returned.
To facilitate additional analysis, you may need to record as part of the snapshot all the displayed fields for each document returned.
This will be the <code>{{ fieldSpec }}</code> fields.
</p>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"ngclipboard": "^2.0.0",
"party-js": "^2.2.0",
"popper.js": "^1.16.1",
"splainer-search": "2.30.4",
"splainer-search": "2.30.5",
"tether-shepherd": "latest",
"turbolinks": "^5.2.0",
"vega": "5.26.1"
Expand Down
4 changes: 3 additions & 1 deletion spec/javascripts/angular/services/docCacheSvc_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ describe('Service: docCacheSvc', function () {
var $q;
var docCacheSvc;
var docResolverSvc;
var ignoredSettings = null;
var ignoredSettings = {
proxyRequests: false
};

beforeEach(function() {
inject(function(_$rootScope_, _$q_, _docCacheSvc_, _docResolverSvc_) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.