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

dash/grid-tools #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion app-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const options = {

// Serve content of code directory
app.use('/', async (req, res) => {
const url = req.url.replace(/^\/(data-grid|gantt|maps|stock)\//g, '/');
const url = req.url.replace(/^\/(gantt|maps|stock)\//g, '/');
const { error, content, path } = await getCodeFile(url, req);

if (error) {
Expand Down
9 changes: 6 additions & 3 deletions lib/compile-on-demand.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const compile = async (filename) => {

const isPrimaryFile = [
'/dashboards/datagrid.src.js',
'/grid/gridlite.src.js',
'/dashboards/dashboards.src.js',
'/highcharts.src.js',
'/highcharts-autoload.src.js',
Expand All @@ -157,10 +158,12 @@ export const compile = async (filename) => {
masterPath = `ts/masters${filename}`
.replace(
'/masters/dashboards/datagrid',
'/masters-datagrid/datagrid'
'/masters-datagrid/datagrid',
'/masters-grid/grid'
)
.replace(
'/masters/dashboards/',
'/masters-dashboards/',
'/masters-dashboards/'
),
start = Date.now();
Expand All @@ -173,9 +176,9 @@ export const compile = async (filename) => {
filename
};

if (filename.indexOf('/datagrid') !== -1) {
if (filename.indexOf('/grid') !== -1) {
umdConfig = {
name: 'DataGrid',
name: 'Grid',
shortPath: 'dashboards',
path: 'dashboards/dashboards',
filename
Expand Down
9 changes: 5 additions & 4 deletions lib/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ export const replaceURLs = (str, codePath) => {
// Replace code.highcharts.com/stock/hc.js etc.
// Do not replace URLs with specific versions.
ret = ret.replace(
/https:\/\/code\.highcharts\.com\/(stock|maps|gantt|data-grid)(?!\/[0-9\.]+)/g,
/https:\/\/code\.highcharts\.com\/(stock|maps|gantt)(?!\/[0-9\.]+)/g,
codePath
);

// Replace code.highcharts.com/hc.js, code.highcharts.com/modules/x.js etc.
// Do not replace URLs with specific versions.
ret = ret.replace(
/https:\/\/code\.highcharts\.com(?!\/(stock|maps|gantt|data-grid|[0-9\.]+))/g,
/https:\/\/code\.highcharts\.com(?!\/(stock|maps|gantt|[0-9\.]+))/g,
codePath
);

Expand Down Expand Up @@ -224,9 +224,9 @@ export const getHTML = (req, codePath) => {

for (const forbiddenFile of [
'https://code.highcharts.com/css/dashboards.css',
'https://code.highcharts.com/css/datagrid.css',
'https://code.highcharts.com/css/grid.css',
'https://code.highcharts.com/dashboards.js',
'https://code.highcharts.com/datagrid.js',
'https://code.highcharts.com/gridlite.js',
'https://code.highcharts.com/highmaps.js',
'https://code.highcharts.com/highstock.js',
'https://code.highcharts.com/modules/map.js'
Expand Down Expand Up @@ -537,6 +537,7 @@ export const getCodeFile = async (file, req) => {
if (content && [
'highcharts.src.js',
'dashboards.src.js',
'gridlite.src.js',
'highstock.src.js',
'highmaps.src.js',
'highcharts-gantt.src.js'
Expand Down
2 changes: 1 addition & 1 deletion routes/samples/list-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const getSample = (path) => {
const getSamples = () => {
let samples = [];
[
'highcharts', 'stock', 'maps', 'gantt', 'unit-tests', 'issues', 'cloud', 'dashboards', 'data-grid'
'highcharts', 'stock', 'maps', 'gantt', 'unit-tests', 'issues', 'cloud', 'dashboards', 'grid'
].forEach(group => {
const groupDir = join(samplesDir, group);
if (fs.existsSync(groupDir) && fs.lstatSync(groupDir).isDirectory()) {
Expand Down