Skip to content

Commit

Permalink
feat: dependencies and workflow updated
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloBar1 committed Jan 9, 2024
1 parent 25f54d0 commit c87b798
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 116 deletions.
61 changes: 14 additions & 47 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@
name: Github CI
on:
pull_request:
branches:
- master
- beta
push:
branches:
- master
- beta
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'

- name: Install
run: npm ci

- name: Lint commit messages
uses: wagoid/commitlint-github-action@v3

- name: Test and report
env:
GIT_BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || github.ref }}
GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: |
echo "::add-matcher::.github/problem-matcher.json"
npm test
- name: Semantic release
run: npx semantic-release
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
---
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- beta
- master
jobs:
build:
uses: Neovici/cfg/.github/workflows/forge.yml@master
secrets: inherit
69 changes: 0 additions & 69 deletions demo/index.html

This file was deleted.

95 changes: 95 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"
/>

<title>cosmoz-treenode demo</title>

<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script type="module" src="../cosmoz-treenode.js"></script>
</head>
<body>
<div>
<div>
<h2>Displaying node 'Company Ktwoktqtxv'</h2>
<cosmoz-treenode
id="treenode1"
path-separator="#"
key-property="id"
key-value="f7a21733-0e65-4985-9e40-a4fb00f3124f"
>
</cosmoz-treenode>
</div>
<div>
<h2>Displaying node 'Company Djpahhofjp'</h2>
<cosmoz-treenode
key-property="id"
key-value="fc78989a-d213-496c-80db-a4fb00f31252"
>
</cosmoz-treenode>
</div>
<div>
<h2>
Displaying node 'Company Djpahhofjp', hiding first 3 nodes from root
</h2>
<cosmoz-treenode
key-property="id"
key-value="fc78989a-d213-496c-80db-a4fb00f31252"
hide-from-root="3"
>
</cosmoz-treenode>
</div>
<div>
<h2>Displaying node 'Company Ktwoktqtxv', showing only two node</h2>
<cosmoz-treenode
key-property="id"
key-value="f7a21733-0e65-4985-9e40-a4fb00f3124f"
show-max-nodes="2"
>
</cosmoz-treenode>
</div>
<div>
<h2>Alternate separator</h2>
<cosmoz-treenode
key-property="id"
key-value="fc78989a-d213-496c-80db-a4fb00f31252"
path-separator="##"
>
</cosmoz-treenode>
</div>
<div>
<h2>Alternate template</h2>
<cosmoz-treenode
id="alternateTemplate"
key-property="id"
key-value="fc78989a-d213-496c-80db-a4fb00f31252"
>
<template>
<span style="color: red" class="separator separator[[index]]"
>\$\$</span
>
<a href="#id=[[node.id]]">[[node.name]]</a>
</template>
</cosmoz-treenode>
</div>
<div>
<h2>Displaying node 'Company Ktwoktqtxv' with no-wrap</h2>
<div>
<cosmoz-treenode
id="treenode2"
no-wrap
key-property="id"
key-value="f7a21733-0e65-4985-9e40-a4fb00f3124f"
>
</cosmoz-treenode>
</div>
</div>
</div>

<script type="module" src="./script.js"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions examples/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { DefaultTree } from '@neovici/cosmoz-tree/cosmoz-default-tree.js';

const elements = document.querySelectorAll('cosmoz-treenode');

fetch('tree.json').then(r => r.json()).then(jsonTree => {
const tree = new DefaultTree(jsonTree);
elements.forEach(el => {
el.ownerTree = tree;
});
});
File renamed without changes.

0 comments on commit c87b798

Please sign in to comment.