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

Align with license change #707

Merged
merged 1 commit into from
Feb 19, 2021
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
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ Changes for Crate Admin Interface
Unreleased
==========

- Align with license change. Enterprise features are now available to everyone.

- Fixed translations. French now works again.

- Fixed missing whitespace.


Expand Down
5 changes: 1 addition & 4 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ Adding New Stylesheets
======================

When a new stylesheet is created it should be imported to
``./styles/styles.scss`` and/or ``./styles/styles-enterprise.scss``

Vendor styles should also be imported to ``./styles/styles.scss``
and ``./styles/styles-enterprise.scss``
``./styles/styles.scss``, this applies to both vanilla and vendor stylesheets.


Running Tests
Expand Down
89 changes: 9 additions & 80 deletions app/app.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ var MODULES = [
'oc.lazyLoad'
];

var DEFAULT_PLUGINS = [];
var ENTERPRISE_PLUGINS = [];

var ROUTING = {
'/': {
'name': 'overview',
Expand Down Expand Up @@ -125,77 +122,9 @@ var loadStylesheet = function (url) {
// todo: load json from rest endpoint
$.get('static/conf/plugins.json', function (plugins) {

ENTERPRISE_PLUGINS = plugins.filter(function (p) {
return p.enterprise;
}).map(function (el) {
return {
name: el.name,
files: [el.uri],
routing: el.routing,
stylesheet: el.stylesheet
};
});
DEFAULT_PLUGINS = plugins.filter(function (p) {
return !p.enterprise;
});

//function to create 'crate' module and bootstrap app
var loadApp = function () {
appModule = angular.module('crate', MODULES);
appModule.config(['SQLQueryProvider', 'queryResultToObjectsProvider', '$ocLazyLoadProvider', '$stateProvider',
'SettingsProvider',
function (SQLQueryProvider, queryResultToObjectsProvider, $ocLazyLoadProvider,
$stateProvider, SettingsProvider) {

if (SettingsProvider.$get().enterprise === true) {
loadStylesheet('static/styles/enterprise.css');
}
var stmt = `
SELECT
license['issued_to'] as issued_to,
license['expiry_date'] as expiry_date,
license['max_nodes'] as max_nodes
FROM
sys.cluster
`;
SQLQueryProvider.$get().execute(stmt, {}, false, false, false)
.then(function (query) {
let result = queryResultToObjectsProvider.$get()(
query,
['issued_to', 'expiry_date', 'max_nodes']
)[0];
SettingsProvider.setEnterprise(result.issued_to != null);
SettingsProvider.setLicenseIssuedTo(result.issued_to);
SettingsProvider.setLicenseExpiryDate(result.expiry_date);
SettingsProvider.setLicenseMaxNodes(result.max_nodes);
if (SettingsProvider.$get().enterprise) {
loadStylesheet('static/styles/enterprise.css');
$ocLazyLoadProvider.config({
modules: ENTERPRISE_PLUGINS,
events: true
});

$ocLazyLoadProvider.$get().load(ENTERPRISE_PLUGINS);

for (var i = 0; i < ENTERPRISE_PLUGINS.length; i++) {
loadStylesheet(ENTERPRISE_PLUGINS[i].stylesheet);
var routing = ENTERPRISE_PLUGINS[i].routing;
if (routing) {
for (var pattern in routing) {
$stateProvider.state(routing[pattern]);
}
}
}
console.info('Loaded Enterprise Plugins:', ENTERPRISE_PLUGINS.map(function (o) {
return o.name;
}));
}
}, function () {
SettingsProvider.setEnterprise(false);
console.info('Failed to load Enterprise settings');
});
}
]);

appModule.config(['$stateProvider', '$httpProvider', '$urlMatcherFactoryProvider', '$urlRouterProvider',
function ($stateProvider, $httpProvider, $urlMatcherFactoryProvider, $urlRouterProvider) {
Expand All @@ -208,8 +137,8 @@ $.get('static/conf/plugins.json', function (plugins) {
$stateProvider.state(ROUTING[pattern]);
}
// register routing from plugins
for (var i = 0; i < DEFAULT_PLUGINS.length; i++) {
var routing = DEFAULT_PLUGINS[i].routing;
for (var i = 0; i < plugins.length; i++) {
var routing = plugins[i].routing;
if (routing) {
for (pattern in routing) {
$stateProvider.state(routing[pattern]);
Expand Down Expand Up @@ -278,21 +207,21 @@ $.get('static/conf/plugins.json', function (plugins) {
};

var promises = [];
for (var i = 0; i < DEFAULT_PLUGINS.length; i++) {
promises.push(loadScript(DEFAULT_PLUGINS[i].uri));
if (DEFAULT_PLUGINS[i].stylesheet) {
promises.push(loadStylesheet(DEFAULT_PLUGINS[i].stylesheet));
for (var i = 0; i < plugins.length; i++) {
promises.push(loadScript(plugins[i].uri));
if (plugins[i].stylesheet) {
promises.push(loadStylesheet(plugins[i].stylesheet));
}
}

$.when.apply($, promises).then(function () {
console.info('Loaded Modules:', MODULES);
console.info('Default Plugins:', DEFAULT_PLUGINS.map(function (el) {
console.info('Modules:', MODULES);
console.info('Plugins:', plugins.map(function (el) {
return el.name;
}));

//onSucess: update the modules and load the app
MODULES = MODULES.concat(DEFAULT_PLUGINS.map(function (el) {
MODULES = MODULES.concat(plugins.map(function (el) {
return el.name;
}));
loadApp();
Expand Down
4 changes: 0 additions & 4 deletions app/conf/plugins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[{
"name": "tutorial",
"uri": "static/plugins/tutorial/tutorial.js",
"enterprise": false,
"routing": {
"/help": {
"name": "tutorial",
Expand All @@ -14,7 +13,6 @@
"name": "monitoring",
"uri": "static/plugins/monitoring/monitoring.js",
"stylesheet": "static/plugins/monitoring/monitoring.css",
"enterprise": true,
"routing": {
"/monitoring": {
"name": "monitoring",
Expand All @@ -27,7 +25,6 @@
"name": "privileges",
"uri": "static/plugins/privileges/privileges.js",
"stylesheet": "static/plugins/privileges/privileges.css",
"enterprise": true,
"routing": {
"/privileges": {
"name": "privileges",
Expand All @@ -44,7 +41,6 @@
"name": "shards",
"uri": "static/plugins/shards/shards.js",
"stylesheet": "static/plugins/shards/shards.css",
"enterprise": true,
"routing": {
"/shards": {
"name": "shards",
Expand Down
5 changes: 0 additions & 5 deletions app/enterprise.module.js

This file was deleted.

17 changes: 0 additions & 17 deletions app/plugins/monitoring/LICENSE

This file was deleted.

13 changes: 0 additions & 13 deletions app/plugins/monitoring/NOTICE

This file was deleted.

4 changes: 2 additions & 2 deletions app/plugins/monitoring/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ contains the following:
.. code-block:: json

{
"name": "monitoring",
"enabled": true,
"name": "monitoring",
"uri": "plugins/monitoring/monitoring.js",
"stylesheet": "plugins/monitoring/monitoring.css",
"enterprise": true,
"routing": {
"/monitoring": {
"templateUrl": "plugins/monitoring/monitoring.html",
Expand Down
18 changes: 0 additions & 18 deletions app/plugins/monitoring/monitoring.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
/*
* This file is part of a module with proprietary Enterprise Features.
*
* Licensed to Crate.io Inc. ("Crate.io") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* To use this file, Crate.io must have given you permission to enable and
* use such Enterprise Features and you must have a valid Enterprise or
* Subscription Agreement with Crate.io. If you enable or use the Enterprise
* Features, you represent and warrant that you have a valid Enterprise or
* Subscription Agreement with Crate.io. Your use of the Enterprise Features
* if governed by the terms and conditions of your Enterprise or Subscription
* Agreement with Crate.io.
*/

amotl marked this conversation as resolved.
Show resolved Hide resolved
.cr-radio-button__monitoring__toggle--overall {
background-color: #00ff9b;
}
Expand Down
17 changes: 0 additions & 17 deletions app/plugins/monitoring/monitoring.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* This file is part of a module with proprietary Enterprise Features.
*
* Licensed to Crate.io Inc. ("Crate.io") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* To use this file, Crate.io must have given you permission to enable and
* use such Enterprise Features and you must have a valid Enterprise or
* Subscription Agreement with Crate.io. If you enable or use the Enterprise
* Features, you represent and warrant that you have a valid Enterprise or
* Subscription Agreement with Crate.io. Your use of the Enterprise Features
* if governed by the terms and conditions of your Enterprise or Subscription
* Agreement with Crate.io.
*/
amotl marked this conversation as resolved.
Show resolved Hide resolved
'use strict';

angular.module('monitoring', ['events'])
Expand Down
14 changes: 6 additions & 8 deletions app/plugins/monitoring/static/icons/icon-monitoring.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 0 additions & 17 deletions app/plugins/monitoring/test/monitoringQueryService.test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* This file is part of a module with proprietary Enterprise Features.
*
* Licensed to Crate.io Inc. ("Crate.io") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* To use this file, Crate.io must have given you permission to enable and
* use such Enterprise Features and you must have a valid Enterprise or
* Subscription Agreement with Crate.io. If you enable or use the Enterprise
* Features, you represent and warrant that you have a valid Enterprise or
* Subscription Agreement with Crate.io. Your use of the Enterprise Features
* if governed by the terms and conditions of your Enterprise or Subscription
* Agreement with Crate.io.
*/
amotl marked this conversation as resolved.
Show resolved Hide resolved
describe('monitoring', function() {
'use strict';

Expand Down
17 changes: 0 additions & 17 deletions app/plugins/monitoring/test/nullObject.test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* This file is part of a module with proprietary Enterprise Features.
*
* Licensed to Crate.io Inc. ("Crate.io") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* To use this file, Crate.io must have given you permission to enable and
* use such Enterprise Features and you must have a valid Enterprise or
* Subscription Agreement with Crate.io. If you enable or use the Enterprise
* Features, you represent and warrant that you have a valid Enterprise or
* Subscription Agreement with Crate.io. Your use of the Enterprise Features
* if governed by the terms and conditions of your Enterprise or Subscription
* Agreement with Crate.io.
*/
describe('NullOverAllSeries', function() {
'use strict';
var mockNullOverAllSeries;
Expand Down
17 changes: 0 additions & 17 deletions app/plugins/monitoring/test/nullSerie.test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* This file is part of a module with proprietary Enterprise Features.
*
* Licensed to Crate.io Inc. ("Crate.io") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* To use this file, Crate.io must have given you permission to enable and
* use such Enterprise Features and you must have a valid Enterprise or
* Subscription Agreement with Crate.io. If you enable or use the Enterprise
* Features, you represent and warrant that you have a valid Enterprise or
* Subscription Agreement with Crate.io. Your use of the Enterprise Features
* if governed by the terms and conditions of your Enterprise or Subscription
* Agreement with Crate.io.
*/
describe('NullSerie', function() {
'use strict';
var mockNullSerie;
Expand Down
17 changes: 0 additions & 17 deletions app/plugins/monitoring/test/pollService.test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
/*
* This file is part of a module with proprietary Enterprise Features.
*
* Licensed to Crate.io Inc. ("Crate.io") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Unauthorized copying of this file, via any medium is strictly prohibited.
*
* To use this file, Crate.io must have given you permission to enable and
* use such Enterprise Features and you must have a valid Enterprise or
* Subscription Agreement with Crate.io. If you enable or use the Enterprise
* Features, you represent and warrant that you have a valid Enterprise or
* Subscription Agreement with Crate.io. Your use of the Enterprise Features
* if governed by the terms and conditions of your Enterprise or Subscription
* Agreement with Crate.io.
*/
describe('MonitoringPollService', function() {
'use strict';
var mockPollService;
Expand Down
Loading