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

GDB-6329 - add new license is expired message #618

Closed
wants to merge 34 commits into from

Conversation

DesislavaBorisova
Copy link
Contributor

What?

Added a new "license is expired message" to the views that need SPARQL queries to work. Removed toastr message from views where it was not needed.

Why?

A few of the views were not showing the proper message in the case of expired GDB license. There were others, which showed both the new message and the old one, so I hid the old one where necessary.

How?

I used the new licenseService for validations in html and js files.

…t-AD/graphdb-workbench into GDB-6329-add_expired_license_msg

� Conflicts:
�	src/js/angular/explore/controllers.js
�	src/js/angular/jdbc/controllers.js
�	src/js/angular/namespaces/controllers.js
�	src/pages/jdbc-create.html
@sava-savov-ontotext sava-savov-ontotext dismissed their stale review May 10, 2022 12:51

Made by mistake

DesislavaBorisova and others added 8 commits May 12, 2022 15:45
…w message visible. Code formatting corrections.
…' into GDB-6329-add_expired_license_msg

# Conflicts:
#	src/js/angular/explore/controllers.js
#	src/js/angular/graphexplore/directives/rdf-class-hierarchy.directive.js
#	src/js/angular/jdbc/controllers.js
#	src/js/angular/namespaces/controllers.js
#	test/namespaces/controllers.spec.js
#	test/resource/controllers.spec.js
@sava-savov-ontotext
Copy link
Contributor

Jenkins retry build

… rdf-class-hierarchy.directive.js, because latter has concurrency issues with the
@sonarcloud
Copy link

sonarcloud bot commented May 23, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 4 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

29.8% 29.8% Coverage
1.1% 1.1% Duplication

@@ -23,6 +23,8 @@ function licenseService($rootScope, LicenseRestService, $translate) {
that.loadingLicense = false;
updateProductType(that.license);
});
}). finally(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the extra space before finally


window.addEventListener('load', function () {
that.repository = {
id: localStorage.getItem(that.repositoryStorageName) || '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the adapter from src/js/angular/utils/local-storage-adapter.js! You can also move the keys in there as constants.

const initView = function () {
if (!$scope.getActiveRepository()) {
if (!$scope.getActiveRepository() ||
!$licenseService.isLicenseValid()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the method above

@@ -339,6 +339,10 @@ function searchResourceInput($location, toastr, ClassInstanceDetailsService, Aut
}
});

$scope.isLicenseValid = function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this method. As far as I can see the license status is loaded once and is stored in the license service, so in each $licenseService.isLicenseValid() call you get the same status. That being said, this additional method in each controller where you need to check the status is just meaningless and also using it in directive templates is quite overwhelming than using a plain variable binding.
So, can you consider resolving the license status in a boolean flag where you need it and use it instead of this method. @sava-savov-ontotext what do you think?

@@ -10,13 +10,18 @@ const CLASS_HIERARCHY = 'class hierarchy';
describe('Class hierarchy screen validation', () => {
let repositoryId;

beforeEach(() => {
before(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why you changed beforeEach and afterEach hooks here and in the rest of the tests?

ClassViewsSteps.verifyGraphIsDisplayed(NEWS_GRAPH);
verifyCounterValue(CLASS_COUNT_OF_NEWS_GRAPH);
ClassViewsSteps.clickGraphBtn()
.then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you chain here?

// Close the menu to avoid overlapping other elements
cy.get('.dropdown-toggle').click();
.click()
.then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly would suggest you to avoid this chaining approach.

@DesislavaBorisova
Copy link
Contributor Author

@sava-savov-ontotext will take over the PR and move it forward.

@svilenvelikov
Copy link
Contributor

@sava-savov-ontotext Is this still valid? Can we close this MR?

@DesiBorisova
Copy link
Contributor

Closing this MR due to outdated changes. New one opened: #1380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants