Skip to content

Commit

Permalink
chore: ensure that sections are in the correct order
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljeter committed May 18, 2019
1 parent 1630208 commit 2a3ff4c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion angular/src/lib/menu/examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './custom-menu-item.component';
export * from './custom-menu-items.component';
export * from './default.component';
export * from './submenu.component';
4 changes: 3 additions & 1 deletion utils/src/dataToJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const addOrUpdateSection = async (block, componentIndex, sectionIndex) => {
name: block.section,
variations: {},
};

if (!section.variations) section.variations = {};
section.variations.core = block.core ? block.core : section.variations.core;
section.variations.react = block.js
? block.js
Expand Down Expand Up @@ -129,6 +129,7 @@ const addOrUpdateProps = async (block, componentIndex) => {
default: block.prop.default,
required: block.prop.required,
};
if (!dataJSON[componentIndex].props) dataJSON[componentIndex].props = {};
const propLibrary = block.prop.library;
const existingProps = dataJSON[componentIndex].props[propLibrary];
const propIndex = getPropIndex(existingProps, prop.name);
Expand Down Expand Up @@ -160,6 +161,7 @@ const removeEmptyComponents = async dataJSON => {
};

const dataToJSON = async (baseJSON, blocksArray) => {
dataJSON = baseJSON;
try {
for (let blocks of blocksArray) {
if (blocks[0].component) {
Expand Down
2 changes: 1 addition & 1 deletion utils/src/parseExamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const parseExamples = async (library, file, fileContents) => {
const pathArray = filePath.dir.split('/');
const component = kebabCase(pathArray[pathArray.indexOf('examples') - 1]);
const sectionWithoutComponentName =
filePath.name.indexOf(`${component}-`) < 0
!filePath.name.startsWith(`${component}-`)
? filePath.name
: filePath.name.split(`${component}-`).pop();
const unformattedSection =
Expand Down
2 changes: 1 addition & 1 deletion www/client/containers/SideNav/SideNav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

.md-sidebar-nav {
padding-top: 0px;
}
}

0 comments on commit 2a3ff4c

Please sign in to comment.