Skip to content

Commit

Permalink
attempt to make command listing a bit more sane. append / to App base…
Browse files Browse the repository at this point in the history
…href
  • Loading branch information
mrb24 committed Dec 9, 2020
1 parent 5dc9266 commit 90ef9b7
Show file tree
Hide file tree
Showing 3 changed files with 8,746 additions and 5,559 deletions.
16 changes: 11 additions & 5 deletions src/core/components/notebook/input/CommandsListing.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@ class CommandsListing extends React.Component {
// Get a list of command types
const gridColumns = [];
// Get list of packages. The list is sorted by package name by default.
const knownCategories = ['data_m','code','data_v','vizualization','default']
const knownCategories = ['data_m','code','data_v','vizualization','default'];
const columnOrg = {'MIMIR':0,'DATA':1,'R':2,'SAMPLING':1,'SCALA':2,'SQL':2,'MARKDOWN':2,'PLOT':2,'PYTHON':2,'VIZUAL':3};
const packages = apiEngine.packages.toList();//.sort((c1, c2) => (knownCategories.indexOf(c1.category)-knownCategories.indexOf(c2.category)));
const groupedPackages = this.groupBy(packages, 'category');
const sortedKeys = Object.keys(groupedPackages).sort((c1, c2) => (knownCategories.indexOf(c1)-knownCategories.indexOf(c2)))
//const groupedPackages = this.groupBy(packages, 'category');
const groupedPackages = [[],[],[],[]];
for (let pckg of packages) {
let colIdx = (pckg.name.toUpperCase() in columnOrg) ? columnOrg[pckg.name.toUpperCase()] : 1;
groupedPackages[colIdx].push(pckg);
}
const sortedKeys = [0,1,2,3]//Object.keys(groupedPackages).sort((c1, c2) => (knownCategories.indexOf(c1)-knownCategories.indexOf(c2)))
//groupedPackages[knownCategories[i]]
let listItems = [];
for (const packageCategory of sortedKeys) {
Expand Down Expand Up @@ -79,14 +85,14 @@ class CommandsListing extends React.Component {
</List.Content>
</List.Item> : <List.Item key={listItems.length} onClick={() => (onSelect(pckg.id, cmd.id))}>
<List.Content>
<List.Header as='a'>{cmd.name}</List.Header>
<List.Header as='a'>{' ' + cmd.name}</List.Header>
</List.Content>
</List.Item>
listItems.push(item)
}
}
gridColumns.push(
<Grid.Column width={4} key={gridColumns.length}>
<Grid.Column className={packageCategory} width={4} key={gridColumns.length}>
<List link>
{ listItems }
</List>
Expand Down
9 changes: 4 additions & 5 deletions src/core/util/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import { CONTENT_CHART, CONTENT_DATASET, CONTENT_ERROR } from '../resources/Outp

let href = process.env.PUBLIC_URL;
if (process.env.NODE_ENV === 'production') {
href = href + '/vizier-db';
if (href === '') {
href = '/'
}
href = href + '/vizier-db';
}
if (href === '') {
href = '/'
}


export const baseHref = href;
export const projectHref = baseHref + 'projects/:project_id';
Expand Down

0 comments on commit 90ef9b7

Please sign in to comment.