Skip to content

Commit

Permalink
fix(core angular): Remove demo folders from published packages
Browse files Browse the repository at this point in the history
Remove demo folders from published packages
  • Loading branch information
theiliad committed Aug 31, 2018
1 parent 2f8bb5f commit 5e3c556
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .travis/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ if [[ $TRAVIS_BRANCH == 'master' ]]; then
git config credential.helper "store --file=.git/credentials"
echo "https://${GH_TOKEN}:@github.com" > .git/credentials 2>/dev/null

lerna publish --conventional-commits --yes

# Generate all assets
# needed for push to gh-page
mkdir pages
Expand All @@ -36,10 +34,17 @@ if [[ $TRAVIS_BRANCH == 'master' ]]; then
npm run demo:build
typedoc --out ./demo/bundle/documentation ./src/index.ts
cp -a demo/bundle/. ../../pages
rm -rf demo

cd ../angular/demo
npm run build-storybook
cp -a storybook-dist/. ../../../pages/angular
cd ..
rm -rf demo
cd ../..

# Perform git & npm publish
lerna publish --conventional-commits --yes
fi

if [[ echo $TRAVIS_BRANCH | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+\$" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/demo/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo</title>
<title>Carbon Charts - Angular</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/services/patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default class PatternsService {
const patternElement = mountedSVG.querySelector("pattern");
patternElement.id = `carbon-${chartContainerID}-pattern-${id}`;

// Remove all IDs to avoid duplicate IDs (accessibility violation)
mountedSVG.querySelector("g").removeAttribute("id");

// Apply fills to everything
Expand All @@ -94,12 +95,14 @@ export default class PatternsService {
element.style.fill = "transparent";
}

// Remove ID to avoid duplicate IDs (accessibility violation)
element.removeAttribute("id");
element.removeAttribute("class");
});

const allRectsInsideSVG = Array.prototype.slice.call(mountedSVG.querySelectorAll("rect"));
allRectsInsideSVG.forEach(rectElement => {
// Remove all IDs to avoid duplicate IDs (accessibility violation)
rectElement.removeAttribute("id");
});

Expand Down

0 comments on commit 5e3c556

Please sign in to comment.