Skip to content

Commit

Permalink
GDB-6329 - add license message to remaining views
Browse files Browse the repository at this point in the history
  • Loading branch information
DesiBorisova committed May 13, 2024
1 parent ec89037 commit d69dc4c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
7 changes: 5 additions & 2 deletions src/js/angular/chatgpt/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ angular
.controller('ChatGptCtrl', ChatGptCtrl)
.controller('ChatGptSettingsCtrl', ChatGptSettingsCtrl);

ChatGptCtrl.$inject = ['$scope', '$http', '$timeout', '$translate', '$uibModal', '$repositories', 'toastr', 'ModalService', 'LocalStorageAdapter'];
ChatGptCtrl.$inject = ['$scope', '$http', '$timeout', '$translate', '$uibModal', '$repositories', 'toastr', 'ModalService', 'LocalStorageAdapter', '$licenseService'];

const CHATGPTRETRIEVAL_ENDPOINT = 'rest/chat/retrieval';

function ChatGptCtrl($scope, $http, $timeout, $translate, $uibModal, $repositories, toastr, ModalService, LocalStorageAdapter) {
function ChatGptCtrl($scope, $http, $timeout, $translate, $uibModal, $repositories, toastr, ModalService, LocalStorageAdapter, $licenseService) {
$scope.isLicenseValid = function () {
return $licenseService.isLicenseValid();
};
function scrollToEnd() {
$timeout(() => {
const element = document.getElementById("messages-scrollable");
Expand Down
4 changes: 2 additions & 2 deletions src/js/angular/chatgpt/templates/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ <h1>
popover-append-to-body="true"><span class="icon-info text-tertiary"></span></span>
</h1>

<div core-errors></div>
<div class="ot-chatgpt-ctrl d-flex" ng-show="getActiveRepository()">
<div core-errors license></div>
<div class="ot-chatgpt-ctrl d-flex" ng-show="isLicenseValid() && getActiveRepository()">
<div class="chat">
<div uib-collapse="!isCollapsed" id="ot-help-text" class="alert alert-info">
<button type="button" ng-click="isCollapsed = false" gdb-tooltip="{{'common.close' | translate}}" class="close"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ angular
.controller('ClusterManagementCtrl', ClusterManagementCtrl);

ClusterManagementCtrl.$inject = ['$scope', '$http', '$q', 'toastr', '$repositories', '$uibModal', '$sce', '$jwtAuth',
'$window', '$interval', 'ModalService', '$timeout', 'ClusterRestService', '$location', '$translate', 'RemoteLocationsService', '$rootScope', 'ClusterViewContextService'];
'$window', '$interval', 'ModalService', '$timeout', 'ClusterRestService', '$location', '$translate', 'RemoteLocationsService', '$rootScope', 'ClusterViewContextService', '$licenseService'];

function ClusterManagementCtrl($scope, $http, $q, toastr, $repositories, $uibModal, $sce, $jwtAuth,
$window, $interval, ModalService, $timeout, ClusterRestService, $location, $translate, RemoteLocationsService, $rootScope, ClusterViewContextService) {
$window, $interval, ModalService, $timeout, ClusterRestService, $location, $translate, RemoteLocationsService, $rootScope, ClusterViewContextService, $licenseService) {

// =========================
// Private variables
Expand Down Expand Up @@ -72,6 +72,10 @@ function ClusterManagementCtrl($scope, $http, $q, toastr, $repositories, $uibMod
return $jwtAuth.isAuthenticated() && $jwtAuth.isAdmin();
};

$scope.isLicenseValid = function () {
return $licenseService.isLicenseValid();
};

$scope.openClusterConfigurationPanel = () => {
$scope.showClusterConfigurationPanel = true;
ClusterViewContextService.showClusterConfigurationPanel();
Expand Down
8 changes: 5 additions & 3 deletions src/js/angular/export/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ const exportCtrl = angular.module('graphdb.framework.impex.export.controllers',

exportCtrl.controller('ExportCtrl',
['$scope', '$http', '$location', '$timeout', 'ModalService', 'filterFilter', '$repositories', 'toastr', 'ExportRestService', 'RDF4JRepositoriesRestService',
'FileTypes', '$translate', 'AuthTokenService', '$uibModal',
'FileTypes', '$translate', 'AuthTokenService', '$uibModal', '$licenseService',
function($scope, $http, $location, $timeout, ModalService, filterFilter, $repositories, toastr, ExportRestService, RDF4JRepositoriesRestService,
FileTypes, $translate, AuthTokenService, $uibModal) {
FileTypes, $translate, AuthTokenService, $uibModal, $licenseService) {

$scope.getActiveRepository = function () {
return $repositories.getActiveRepository();
};

$scope.isLicenseValid = function () {
return $licenseService.isLicenseValid();
};
$scope.exportFormats = FileTypes;
$scope.deleting = {};
$scope.showExportDDTooltip = true;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/cluster-management/clusterInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ <h1>
message="getLoaderMessage"
size="75">
</div>

<div class="clearfix d-flex" ng-if="!loader && clusterConfiguration">
<div core-errors license></div>
<div class="clearfix d-flex" ng-if="isLicenseValid() && !loader && clusterConfiguration">
<div class="action-buttons">
<div ng-if="isAdmin()" class="buttons-wrapper">
<button type="button" class="btn btn-secondary remove-node-btn" ng-if="currentLeader"
Expand Down Expand Up @@ -72,7 +72,7 @@ <h1>
</div>
</div>

<div ng-if="!loader" class="cluster-view">
<div ng-if="isLicenseValid() && !loader" class="cluster-view">
<cluster-graphical-view cluster-model="clusterModel" legend-visible=""></cluster-graphical-view>
<cluster-legend></cluster-legend>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ <h1>

<div class="ot-loader ot-main-loader" onto-loader size="50" ng-show="loader"></div>
<div class="ot-owlim-ctrl" ng-hide="loader">
<div core-errors></div>
<div ng-show="getActiveRepository()">
<div core-errors license></div>
<div ng-show="isLicenseValid() && getActiveRepository()">

<div class="alert alert-warning" ng-hide="graphs.length > 0">
{{'export.no.graphs.in.repo' | translate}} <a ng-href="sparql">{{'export.sparql.update.form' | translate}}</a> {{'or' | translate}} <a ng-href="import">{{'export.data.import.page' | translate}}</a>.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>
popover-append-to-body="true"><span class="icon-info text-tertiary"></span></span>
</h1>

<div core-errors write ontop></div>
<div core-errors write ontop license></div>

<div ng-controller="TabController" ng-show="!isRestricted && canWriteActiveRepo()">

Expand Down

0 comments on commit d69dc4c

Please sign in to comment.