Commit 35c440eb by Torkel Ödegaard

Gridstack: testing

parent 6992b484
...@@ -65,9 +65,11 @@ ...@@ -65,9 +65,11 @@
"dependencies": { "dependencies": {
"eventemitter3": "^2.0.2", "eventemitter3": "^2.0.2",
"gaze": "^1.1.2", "gaze": "^1.1.2",
"gridstack": "^0.3.0",
"grunt-jscs": "3.0.1", "grunt-jscs": "3.0.1",
"grunt-sass-lint": "^0.2.2", "grunt-sass-lint": "^0.2.2",
"grunt-sync": "^0.6.2", "grunt-sync": "^0.6.2",
"jquery-ui-dist": "^1.12.1",
"karma-sinon": "^1.0.5", "karma-sinon": "^1.0.5",
"lodash": "^4.17.2", "lodash": "^4.17.2",
"mousetrap": "^1.6.0", "mousetrap": "^1.6.0",
......
///<reference path="../../../headers/common.d.ts" />
import $ from 'jquery';
import coreModule from '../../core_module';
import 'jquery-ui';
import 'gridstack';
import 'gridstack.jquery-ui';
export class DashGridCtrl {
}
const template = `
<div class="grid-stack">
<div class="grid-stack-item"
data-gs-x="0" data-gs-y="0"
data-gs-width="4" data-gs-height="2">
<div class="grid-stack-item-content"></div>
</div>
<div class="grid-stack-item"
data-gs-x="4" data-gs-y="0"
data-gs-width="4" data-gs-height="4">
<div class="grid-stack-item-content"></div>
</div>
</div>
`;
export function dashGrid() {
return {
restrict: 'E',
template: template,
controller: DashGridCtrl,
bindToController: true,
controllerAs: 'ctrl',
scope: {
dashboard: "="
},
link: function(scope, elem) {
$('.grid-stack').gridstack();
}
};
}
coreModule.directive('dashGrid', dashGrid);
...@@ -46,7 +46,7 @@ import {contextSrv} from './services/context_srv'; ...@@ -46,7 +46,7 @@ import {contextSrv} from './services/context_srv';
import {KeybindingSrv} from './services/keybindingSrv'; import {KeybindingSrv} from './services/keybindingSrv';
import {helpModal} from './components/help/help'; import {helpModal} from './components/help/help';
import {NavModelSrv, NavModel} from './nav_model_srv'; import {NavModelSrv, NavModel} from './nav_model_srv';
import {DashGridCtrl} from './components/dashgrid/dashgrid';
export { export {
arrayJoin, arrayJoin,
...@@ -72,4 +72,5 @@ export { ...@@ -72,4 +72,5 @@ export {
helpModal, helpModal,
NavModelSrv, NavModelSrv,
NavModel, NavModel,
DashGridCtrl,
}; };
...@@ -73,3 +73,7 @@ declare module 'd3' { ...@@ -73,3 +73,7 @@ declare module 'd3' {
export default d3; export default d3;
} }
declare module 'gridstack' {
var gridstack: any;
export default gridstack;
}
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<dash-row class="dash-row" ng-repeat="row in dashboard.rows" row="row" dashboard="dashboard"> <dash-grid dashboard="dashboard">
</dash-row>
</dash-grid>
<div ng-show='dashboard.meta.canEdit && !dashboard.meta.fullscreen' class="add-row-panel-hint"> <div ng-show='dashboard.meta.canEdit && !dashboard.meta.fullscreen' class="add-row-panel-hint">
<div class="span12" style="text-align:left;"> <div class="span12" style="text-align:left;">
......
...@@ -32,7 +32,31 @@ System.config({ ...@@ -32,7 +32,31 @@ System.config({
"jquery.flot.fillbelow": "vendor/flot/jquery.flot.fillbelow", "jquery.flot.fillbelow": "vendor/flot/jquery.flot.fillbelow",
"jquery.flot.gauge": "vendor/flot/jquery.flot.gauge", "jquery.flot.gauge": "vendor/flot/jquery.flot.gauge",
"d3": "vendor/d3/d3.js", "d3": "vendor/d3/d3.js",
"jquery.flot.dashes": "vendor/flot/jquery.flot.dashes" "jquery.flot.dashes": "vendor/flot/jquery.flot.dashes",
"jquery-ui": "vendor/npm/jquery-ui-dist/jquery-ui.js",
"gridstack": "vendor/npm/gridstack/dist/gridstack.js",
"gridstack.jquery-ui": "vendor/npm/gridstack/dist/gridstack.jQueryUI.js",
'jquery-ui/data': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/disable-selection': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/focusable': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/form': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/ie': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/keycode': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/labels': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/jquery-1-7': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/plugin': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/safe-active-element': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/safe-blur': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/scroll-parent': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/tabbable': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/unique-id': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/version': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/widget': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/widgets/mouse': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/widgets/draggable': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/widgets/droppable': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
'jquery-ui/widgets/resizable': 'vendor/npm/jquery-ui-dist/jquery-ui.js',
}, },
packages: { packages: {
...@@ -52,10 +76,22 @@ System.config({ ...@@ -52,10 +76,22 @@ System.config({
map: { map: {
text: 'vendor/plugin-text/text.js', text: 'vendor/plugin-text/text.js',
css: 'app/core/utils/css_loader.js' css: 'app/core/utils/css_loader.js',
}, },
meta: { meta: {
'vendor/npm/jquery-ui/jquery-ui.js': {
format: 'amd',
deps: ['jquery'],
},
'vendor/npm/gridstack/dist/gridstack.js': {
format: 'amd',
deps: ['jquery', 'jquery-ui', 'lodash'],
},
"vendor/npm/gridstack/dist/gridstack.jQueryUI.js": {
format: 'amd',
deps: ['gridstack.jquery-ui'],
},
'vendor/npm/virtual-scroll/src/indx.js': { 'vendor/npm/virtual-scroll/src/indx.js': {
format: 'cjs', format: 'cjs',
exports: 'VirtualScroll', exports: 'VirtualScroll',
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
@import "components/jsontree"; @import "components/jsontree";
@import "components/edit_sidemenu.scss"; @import "components/edit_sidemenu.scss";
@import "components/row.scss"; @import "components/row.scss";
@import "components/gridstack.scss";
// PAGES // PAGES
@import "pages/login"; @import "pages/login";
......
...@@ -34,6 +34,8 @@ module.exports = function(config) { ...@@ -34,6 +34,8 @@ module.exports = function(config) {
'remarkable/dist/*', 'remarkable/dist/*',
'virtual-scroll/**/*', 'virtual-scroll/**/*',
'mousetrap/**/*', 'mousetrap/**/*',
'gridstack/dist/*',
'jquery-ui-dist/*',
], ],
dest: '<%= srcDir %>/vendor/npm' dest: '<%= srcDir %>/vendor/npm'
} }
......
...@@ -1663,9 +1663,9 @@ glob@7.0.5: ...@@ -1663,9 +1663,9 @@ glob@7.0.5:
once "^1.3.0" once "^1.3.0"
path-is-absolute "^1.0.0" path-is-absolute "^1.0.0"
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.0.0: glob@^7.0.0, glob@^7.1.1, glob@~7.1.1:
version "7.0.6" version "7.1.1"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
dependencies: dependencies:
fs.realpath "^1.0.0" fs.realpath "^1.0.0"
inflight "^1.0.4" inflight "^1.0.4"
...@@ -1674,9 +1674,9 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.0.0: ...@@ -1674,9 +1674,9 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.0.0:
once "^1.3.0" once "^1.3.0"
path-is-absolute "^1.0.0" path-is-absolute "^1.0.0"
glob@^7.1.1, glob@~7.1.1: glob@^7.0.3, glob@^7.0.5, glob@~7.0.0:
version "7.1.1" version "7.0.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a"
dependencies: dependencies:
fs.realpath "^1.0.0" fs.realpath "^1.0.0"
inflight "^1.0.4" inflight "^1.0.4"
...@@ -1741,6 +1741,14 @@ graceful-fs@~1.2.0: ...@@ -1741,6 +1741,14 @@ graceful-fs@~1.2.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
gridstack@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/gridstack/-/gridstack-0.3.0.tgz#be1c7891f3fbd2af60f9d60f4c7d517a30d3bb78"
dependencies:
jquery "^3.1.0"
jquery-ui "^1.12.0"
lodash "^4.14.2"
growl@1.9.2: growl@1.9.2:
version "1.9.2" version "1.9.2"
resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f"
...@@ -2451,6 +2459,18 @@ jodid25519@^1.0.0: ...@@ -2451,6 +2459,18 @@ jodid25519@^1.0.0:
dependencies: dependencies:
jsbn "~0.1.0" jsbn "~0.1.0"
jquery-ui-dist@^1.12.1:
version "1.12.1"
resolved "https://registry.yarnpkg.com/jquery-ui-dist/-/jquery-ui-dist-1.12.1.tgz#5c0815d3cc6f90ff5faaf5b268a6e23b4ca904fa"
jquery-ui@^1.12.0:
version "1.12.1"
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.12.1.tgz#bcb4045c8dd0539c134bc1488cdd3e768a7a9e51"
jquery@^3.1.0:
version "3.2.1"
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
js-base64@^2.1.9: js-base64@^2.1.9:
version "2.1.9" version "2.1.9"
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
...@@ -3807,11 +3827,11 @@ resolve-pkg@^0.1.0: ...@@ -3807,11 +3827,11 @@ resolve-pkg@^0.1.0:
dependencies: dependencies:
resolve-from "^2.0.0" resolve-from "^2.0.0"
resolve@1.1.x, resolve@^1.1.6, resolve@~1.1.0: resolve@1.1.x, resolve@~1.1.0:
version "1.1.7" version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
resolve@^1.3.2: resolve@^1.1.6, resolve@^1.3.2:
version "1.3.3" version "1.3.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5"
dependencies: dependencies:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment