Compare commits

...
Author SHA1 Message Date
Don Walizer afeda05458 Remove deprecated libraries 2024-08-08 15:25:02 -04:00
Dima May abf3812439 update docker-compose to docker compose 2024-07-31 19:24:49 +00:00
Don Walizer 67df81d4fd Merge pull request #239 from NationalSecurityAgency/update-spring-3-2-4
Upgrade Spring to 3.2.4
2024-04-04 15:49:49 -04:00
Don Walizer 0a01ff53a3 Upgrade Spring to 3.2.4 2024-04-03 11:45:32 -04:00
Dima May 53fcc9562d Merge pull request #238 from NationalSecurityAgency/t#236/timeout_ci2
T#236/timeout ci2
2024-01-22 08:24:28 -05:00
rmmayo d8b719a728 #236 - add a wait before going back in the browser 2024-01-18 10:58:45 -05:00
rmmayo 06aa74a5f7 #236 - upgrade cypress 2024-01-18 08:30:46 -05:00
rmmayo 92354ed015 #236 - add a wait after going back in the browser 2024-01-18 08:26:20 -05:00
Dima May c83e3d5c22 Update README.md 2024-01-18 07:38:31 -05:00
Dima May 594471d12c Merge pull request #237 from NationalSecurityAgency/t#236/timeout_ci
T#236/timeout ci
2024-01-16 15:26:11 -05:00
rmmayo fdecf37ec0 #236 - upgrade cypress 2024-01-16 10:32:39 -05:00
rmmayo 0cfafd1d45 #236 - upgrade cypress 2024-01-16 10:25:59 -05:00
rmmayo 9891dea2e5 #236 - upgrade cypress 2024-01-16 10:22:37 -05:00
rmmayo a07a4e24eb #236 - upgrade cypress 2024-01-16 10:19:57 -05:00
rmmayo 4f86ed1913 #236 - upgrade cypress 2024-01-16 10:04:12 -05:00
rmmayo 482ae93e0f #236 - upgrade cypress 2024-01-16 09:46:30 -05:00
rmmayo 5ed4a68cb1 #236 - upgrade cypress 2024-01-16 09:14:16 -05:00
Dima May b784b5de26 Update README.md 2023-12-22 08:05:59 -05:00
Dima May ca03f0f709 Merge pull request #235 from NationalSecurityAgency/update-js-example
Add ability to specify ID for skill reporting event
2023-12-15 15:42:55 -05:00
247 changed files with 69 additions and 10185 deletions

No files matched your search

@@ -34,14 +34,15 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v3
with:
node-version: '14'
- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19' # The JDK version to make available on the path.
- name: Print Versions
@@ -52,7 +53,7 @@ jobs:
node --version
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -60,7 +61,7 @@ jobs:
${{ runner.os }}-maven-
- name: Cache npm
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -94,31 +95,32 @@ jobs:
npm run cyServices:start:integration-apps
cd ../../
# - name: Run Cypress tests
# uses: cypress-io/github-action@v2
# with:
# working-directory: skills-client-integration/skills-int-e2e-test
# record: true
# parallel: false
# group: 'skills-client expired token tests'
# tag: "${{ github.workflow }}"
# spec: cypress/integration/timeout.specs.js
# env: 'timeout=true'
# env:
# # pass the Dashboard record key as an environment variable
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# # pass GitHub token to allow accurately detecting a build vs a re-run build
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Cypress tests
run: |
cd skills-client-integration/skills-int-e2e-test
npm run cy:run:timeout
cd ../../
uses: cypress-io/github-action@v5
with:
working-directory: skills-client-integration/skills-int-e2e-test
record: true
parallel: false
group: 'skills-client expired token tests'
tag: "${{ github.workflow }}"
spec: cypress/e2e/timeout.specs.js
env: 'timeout=true'
browser: chrome
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Run Cypress tests
# run: |
# cd skills-client-integration/skills-int-e2e-test
# npm run cy:run:timeout
# cd ../../
- name: upload result artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: result artifacts
path: |
+1 -1
View File
@@ -112,7 +112,7 @@ jobs:
- name: Register hydra client
run: |
cd skills-client-integration/skills-int-e2e-test/hydra
docker-compose -f quickstart.yml exec -T hydra \
docker compose -f quickstart.yml exec -T hydra \
hydra clients create \
--endpoint http://localhost:4445/ \
--id skilltree-test \
+1 -1
View File
@@ -9,7 +9,7 @@ PROMETHEUS=${PROMETHEUS:-false}
echo "PWD: "
echo $(pwd)
cd ./skills-client-integration/skills-int-e2e-test/hydra
DC="docker-compose -f quickstart.yml"
DC="docker compose -f quickstart.yml"
if [[ $DB == "mysql" ]]; then
DC+=" -f quickstart-mysql.yml"
fi
+7 -5
View File
@@ -8,15 +8,17 @@ These pages provide in-depth guidance on the installation, usage and contributio
## Workflow Status
[![CI Badge](https://github.com/NationalSecurityAgency/skills-client/workflows/Continuous%20Integration/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions?query=workflow%3A%22Continuous+Integration%22)
[![Continuous Integration](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/build-and-test.yml)
[![Run integration tests using OAuth](https://github.com/NationalSecurityAgency/skills-client/workflows/Continuous%20Integration%20with%20OAuth/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions?query=workflow%3A%22Continuous+Integration+with+OAuth%22)
[![Continuous Integration with OAuth](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/build-and-test-oauth.yml/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/build-and-test-oauth.yml)
[![Run integration tests for expired tokens](https://github.com/NationalSecurityAgency/skills-client/workflows/Continuous%20Integration%20expired%20token%20tests/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions?query=workflow%3A%22Continuous+Integration+expired+token+tests%22)
[![Continuous Integration expired token tests](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/build-and-test-expired-token.yml/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/build-and-test-expired-token.yml)
[![Skills-service Backward Compatibility](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/skills-service-backward-compat.yml/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/skills-service-backward-compat.yml)
[![Client Libs Backward Compatibility](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/client-libs-backward-compat.yml/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions/workflows/client-libs-backward-compat.yml)
[![Skills-service Backward Compatibility](https://github.com/NationalSecurityAgency/skills-client/workflows/Skills-service%20Backward%20Compatibility/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions?query=workflow%3A%22Skills-service+Backward+Compatibility%22)
[![Client Libs Backward Compatibility](https://github.com/NationalSecurityAgency/skills-client/workflows/Client%20Libs%20Backward%20Compatibility/badge.svg)](https://github.com/NationalSecurityAgency/skills-client/actions?query=workflow%3A%22Client+Libs+Backward+Compatibility%22)
@@ -3,7 +3,7 @@
"rollup.config.js", "app/assets/**", "target/**", "pom.xml",
"build/**", "**/robots.txt", "**.svg", "vue.config.js",
"cypress/videos/**", "**/*.jar", "**.xml", "src/license/*.properties",
"nohup.out", "logs/*", "**.patch", "**.yml"
"nohup.out", "logs/*", "**.patch", "**.yml", "cypress/downloads/**", "**.config.js"
],
"license": "../license-add/LICENSE-HEADER.txt",
"licenseFormats": {
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version>
<version>3.2.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>skills</groupId>
@@ -1,18 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
@@ -1,16 +0,0 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false
@@ -1,49 +0,0 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
package-lock.json
projects/skilltree/skills-client-ng/src/version.js
@@ -1 +0,0 @@
package-lock=false
@@ -1,42 +0,0 @@
<!---
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
# SkillsIntClientNg
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.2.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
@@ -1,129 +0,0 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"skills-int-client-ng": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": [
"axios",
"highlight.js",
"lodash/debounce",
"js-beautify"
],
"preserveSymlinks": true,
"outputPath": "dist/skills-int-client-ng",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"./node_modules/bootstrap/dist/css/bootstrap.css",
"./node_modules/highlight.js/styles/github.css"
],
"scripts": [
"./node_modules/jquery/dist/jquery.min.js",
"./node_modules/bootstrap/dist/js/bootstrap.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "skills-int-client-ng:build"
},
"configurations": {
"production": {
"browserTarget": "skills-int-client-ng:build:production"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "skills-int-client-ng:serve"
},
"configurations": {
"production": {
"devServerTarget": "skills-int-client-ng:serve:production"
}
}
}
}
}},
"defaultProject": "skills-int-client-ng"
}
@@ -1,51 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};
@@ -1,38 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('skills-int-client-ng app is running!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
@@ -1,26 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}
getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText() as Promise<string>;
}
}
@@ -1,14 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es2018",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
@@ -1,47 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/skills-int-client-ng'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
@@ -1,13 +0,0 @@
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,23 +0,0 @@
{
"ignore": [ ".git", "coverage", ".*/**", ".*", "*.iml", "tsconfig.*", "skills.d.ts", "angular.json", "pom.xml"],
"license": "license-add/LICENSE-HEADER.txt",
"licenseFormats": {
"js": {
"prepend": "/*",
"append": " */",
"eachLine": {
"prepend": " * "
}
},
"dotfile": {
"eachLine": {
"prepend": "# "
}
},
"md": {
"prepend": "<!---",
"append": " -->"
}
},
"trailingWhitespace": "TRIM"
}
@@ -1,29 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module.exports = {
packages: {
'@skilltree/skills-client-ng': {
ignorableDeepImportMatchers: [
/lodash\//
]
},
'ngx-highlightjs': {
ignorableDeepImportMatchers: [
/highlight/
]
},
}
};
@@ -1,67 +0,0 @@
{
"name": "skills-int-client-ng",
"version": "3.6.0",
"license": "Apache-2.0",
"description": "SkillTree Client Lib - Angular",
"author": "SkillTree Team",
"scripts": {
"licenseDepCheck2": "license-checker --production --onlyAllow='MIT;ISC;Apache-2.0;0BSD' --summary",
"licenseDepCheck": "license-checker --production --onlyAllow='MIT;ISC;BSD-3-Clause;Apache-2.0;0BSD;CC-BY-4.0' --summary",
"licenseHeaderCheck": "license-check-and-add check -f '../license-add/license-add-config.json'",
"licenseHeaderAdd": "license-check-and-add add -f ../license-add/license-add-config.json",
"licenseCheck": "npm run licenseHeaderCheck && npm run licenseDepCheck ",
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"serve": "npm run start",
"build": "npm run licenseCheck && ng build --configuration production --deploy-url=/angular/",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"dependencies": {
"@angular/animations": "14.3.0",
"@angular/common": "14.3.0",
"@angular/compiler": "14.3.0",
"@angular/core": "14.3.0",
"@angular/forms": "14.3.0",
"@angular/platform-browser": "14.3.0",
"@angular/platform-browser-dynamic": "14.3.0",
"@angular/router": "14.3.0",
"@ng-bootstrap/ng-bootstrap": "13.0.0",
"@popperjs/core": "2.11.8",
"@skilltree/skills-client-ng": "3.6.0",
"@types/js-beautify": "1.11.0",
"axios": "1.6.0",
"bootstrap": "4.5.3",
"highlight.js": "11.3.1",
"jquery": "3.5.1",
"js-beautify": "1.13.0",
"ngx-highlightjs": "4.1.2",
"popper.js": "^1.16.1",
"rxjs": "6.6.3",
"tslib": "2.0.3",
"zone.js": "0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "14.2.11",
"@angular/cli": "14.2.11",
"@angular/compiler-cli": "14.3.0",
"@types/jasmine": "3.6.0",
"@types/jasminewd2": "2.0.8",
"@types/node": "14.11.8",
"codelyzer": "6.0.1",
"jasmine-core": "3.6.0",
"jasmine-spec-reporter": "6.0.0",
"karma": "6.4.1",
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "3.0.3",
"karma-jasmine": "4.0.1",
"karma-jasmine-html-reporter": "1.5.4",
"license-check-and-add": "3.0.4",
"license-checker": "25.0.1",
"protractor": "7.0.0",
"ts-node": "9.0.0",
"tslint": "6.1.3",
"typescript": "4.6.2"
}
}
@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>skills</groupId>
<artifactId>skills-client-integration</artifactId>
<version>3.5.0-SNAPSHOT</version>
</parent>
<artifactId>skills-int-client-ng</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<configuration>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<!--TODO: uncomment when we have at least 1 unit test-->
<!--<execution>-->
<!--<id>npm run test</id>-->
<!--<goals>-->
<!--<goal>npm</goal>-->
<!--</goals>-->
<!--<phase>test</phase>-->
<!--<configuration>-->
<!--<arguments>run unit</arguments>-->
<!--</configuration>-->
<!--</execution>-->
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -1,7 +0,0 @@
{
"/api":
{
"target": "http://localhost:8090",
"secure": false
}
}
@@ -1,39 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ReportSkillsComponent } from './components/report-skills/report-skills.component';
import { SkillsDisplayComponent } from './components/skills-display/skills-display.component';
const routes: Routes = [{
path: '',
redirectTo: 'reportSkills',
pathMatch: 'full'
}, {
path: 'angular/reportSkills',
component: ReportSkillsComponent
}, {
path: 'angular/showSkills',
component: SkillsDisplayComponent
}
];
@NgModule({
imports: [RouterModule.forRoot(routes, { anchorScrolling: 'enabled'})],
exports: [RouterModule]
})
export class AppRoutingModule { }
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,21 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div>
<app-navigation></app-navigation>
<div class="container-fluid mt-3">
<router-outlet></router-outlet>
</div>
</div>
@@ -1,50 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'skills-int-client-ng'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('skills-int-client-ng');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('skills-int-client-ng app is running!');
});
});
@@ -1,25 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'skills-int-client-ng';
}
@@ -1,72 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { HighlightModule, HIGHLIGHT_OPTIONS } from 'ngx-highlightjs';
import { SkillsLevelModule, SkillsDisplayModule, SkilltreeModule } from '@skilltree/skills-client-ng'
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { NavigationComponent } from './components/navigation/navigation.component';
import { CodeExampleLayoutComponent } from './components/report-skills/code-example/code-example-layout.component';
import { ButtonCodeExampleComponent } from './components/report-skills/code-example/button-code-example.component';
import { InputCodeExampleComponent } from './components/report-skills/code-example/input-code-example.component';
import { AnySkillCodeExampleComponent } from './components/report-skills/code-example/anyskill-code-example.component';
import { ExampleService } from './components/report-skills/code-example/example.service';
import { ReportSkillsComponent } from './components/report-skills/report-skills.component';
import { SkillsDisplayComponent } from './components/skills-display/skills-display.component';
import { PlaceholderDirective } from './directives/placeholder.directive';
@NgModule({
declarations: [
AppComponent,
ReportSkillsComponent,
NavigationComponent,
SkillsDisplayComponent,
CodeExampleLayoutComponent,
ButtonCodeExampleComponent,
AnySkillCodeExampleComponent,
InputCodeExampleComponent,
PlaceholderDirective
],
imports: [
BrowserModule,
AppRoutingModule,
NgbModule,
FormsModule,
HighlightModule,
SkillsLevelModule,
SkilltreeModule,
SkillsDisplayModule,
RouterModule.forRoot([
{ path: '', component: ReportSkillsComponent },
])
],
providers: [
ExampleService,
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
fullLibraryLoader: () => import('highlight.js'),
}
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,35 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div>
<div>
<nav class="navbar navbar-dark bg-info">
<a href="/angular/reportSkills" class="navbar-brand">Angular Integration Examples</a>
<ul class="navbar-nav flex-row mr-auto">
<li [routerLinkActive]="['active']" class="nav-item active pr-3">
<a class="nav-link" routerLink="/angular/reportSkills">Report Skill Events</a>
</li>
<li [routerLinkActive]="['active']" class="nav-item pr-3">
<a class="nav-link" routerLink="/angular/showSkills">User Display</a>
</li>
</ul>
<button type="button" class="btn btn-primary">
<span id="skillLevel"></span>
<skills-level></skills-level>
</button>
</nav>
</div>
</div>
@@ -1,40 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NavigationComponent } from './navigation.component';
describe('NavigationComponent', () => {
let component: NavigationComponent;
let fixture: ComponentFixture<NavigationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NavigationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NavigationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,32 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.css']
})
export class NavigationComponent implements OnInit {
constructor(public route: ActivatedRoute) {
}
ngOnInit(): void {
}
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,22 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div data-cy="anySkillDropDown" ngbDropdown class="d-inline-block mx-2">
<button data-cy="anySkillDropDownButton" class="btn btn-outline-primary" id="dropdownBasic1" ngbDropdownToggle>{{skillId}}</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<button data-cy="anySkillDropDownItemButton" ngbDropdownItem *ngFor="let selectedSkill of available" (click)="setSelectedSkill(selectedSkill)">{{selectedSkill}}</button>
</div>
</div>
<button class="btn btn-outline-primary" [disabled]="!hasSelectedSkill()" (click)="reportSkill()">Report Skill</button>
@@ -1,73 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import axios from 'axios';
import { Example } from './example';
import { SkillsReporter } from '@skilltree/skills-client-ng';
@Component({
selector: 'app-anyskill-code-example',
templateUrl: './anyskill-code-example.component.html',
styleUrls: ['./anyskill-code-example.component.css']
})
export class AnySkillCodeExampleComponent implements OnInit {
@Input() example: Example
placeholder: string = 'Select a skill id';
skillId: string;
available: string[] = [''];
@Output() skillReportSuccess = new EventEmitter<string>();
constructor() {
}
ngOnInit(): void {
this.skillId = this.placeholder;
axios.get("/api/skills")
.then((result) => {
this.available = result.data as string[];
});
}
hasSelectedSkill() {
return this.skillId && this.skillId !== this.placeholder;
}
setSelectedSkill(selectedSkill: string) {
this.skillId = selectedSkill;
}
reportSkill() {
SkillsReporter.reportSkill(this.skillId)
.then((res) => {
this.skillReportSuccess.emit(res);
})
.catch((res) => {
this.skillReportSuccess.emit(res);
});
}
getSampleCode() {
let sampleCode = `SkillsReporter.reportSkill(this.skill)
.then((res) => {
this.reportResult = res;
});`;
sampleCode = 'SkillsReporter.reportSkill(this.skill)\n .then((res) => {\n this.reportResult = res;\n \});';
return sampleCode;
}
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,16 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<button class="btn btn-outline-primary" [skilltree]="skillId" (skills-report-success)="onReporterResponse($event)" (skills-report-error)="onReporterResponse($event)" >Report Skill</button>
@@ -1,50 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Example } from './example';
@Component({
selector: 'app-button-code-example',
templateUrl: './button-code-example.component.html',
styleUrls: ['./button-code-example.component.css']
})
export class ButtonCodeExampleComponent implements OnInit {
@Input() example: Example
skillId: string
@Output() skillReportSuccess = new EventEmitter<string>();
constructor() {
}
ngOnInit(): void {
this.skillId = this.example.skillId;
}
onReporterResponse(event) {
this.skillReportSuccess.emit(event.detail)
}
getSampleCode() {
let sampleCode = `<button \n [skilltree]="\'${this.example.skillId}\'" \n (skills-report-success)="onReporterResponse($event)"`;
if (this.example.handleError) {
sampleCode += '\n (skills-report-error)="onReporterError($event)"';
}
sampleCode += '>\n Report Skill\n</button>'
return sampleCode
}
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,33 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div>
<h5 class="text-info"><strong>{{ title }}</strong></h5>
<div class="card card-body bg-light">
<pre><code [highlight]="sampleCode" [languages]="['html', 'javascript']"></code></pre>
</div>
<div class="card card-body mt-3" [id]="formatId(title)">
<div id="exampleDirectiveClickEvent">
<div class="code-example">
<ng-template appPlaceholder></ng-template>
</div>
</div>
<hr>
<div class="text-primary">Result:</div>
<div class="border rounded p-3 bg-light">
<pre>{{ reportResult }}</pre>
</div>
</div>
</div>
@@ -1,63 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, OnInit, AfterViewInit, Input, ViewChild, ComponentFactoryResolver } from '@angular/core';
import { PlaceholderDirective } from 'src/app/directives/placeholder.directive';
import { Example } from './example';
@Component({
selector: 'app-code-example-layout',
templateUrl: './code-example-layout.component.html',
styleUrls: ['./code-example-layout.component.css']
})
export class CodeExampleLayoutComponent implements OnInit, AfterViewInit {
@ViewChild(PlaceholderDirective) codeExampleHost: PlaceholderDirective;
@Input() example: Example;
skillId: string;
title: string;
sampleCode: string;
reportResult: string = "";
constructor(private componentFactoryResolver: ComponentFactoryResolver) {
}
formatId(title: string) {
return title.replace(/ /gi,'').replace(/-/g,'');
}
ngOnInit(): void {
this.skillId = this.example.skillId;
this.title = this.example.title;
}
ngAfterViewInit(): void {
setTimeout(() => {
this.viewLoaded();
});
}
viewLoaded() {
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.example.component);
const viewContainerRef = this.codeExampleHost.viewContainerRef;
viewContainerRef.clear();
const componentRef = viewContainerRef.createComponent(componentFactory);
componentRef.instance.example = this.example;
this.sampleCode = componentRef.instance.getSampleCode();
componentRef.instance.skillReportSuccess.subscribe(val => this.reportResult = JSON.stringify(val, null, ' '));
}
}
@@ -1,57 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Injectable } from '@angular/core';
import { Example } from './example'
import { ButtonCodeExampleComponent } from './button-code-example.component';
import { InputCodeExampleComponent } from './input-code-example.component';
import { AnySkillCodeExampleComponent } from './anyskill-code-example.component';
@Injectable()
export class ExampleService {
getExamples() {
return [
new Example(
ButtonCodeExampleComponent,
'Skills Directive - Click Event',
'IronMan',
),
new Example(
InputCodeExampleComponent,
'Skills Directive - Input Event',
'Thor',
),
new Example(
ButtonCodeExampleComponent,
'Skills Directive - Error with Button',
'DoesNotExist',
true
),
new Example(
InputCodeExampleComponent,
'Skills Directive - Error with Input',
'DoesNotExist',
true
),
new Example(
AnySkillCodeExampleComponent,
'Pure JS - Report Any Skill',
'',
true
)
];
}
}
@@ -1,25 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Type } from "@angular/core";
export class Example {
constructor(
public component: Type<any>,
public title: string,
public skillId: string,
// public sampleCode: string,
public handleError: boolean = false) { }
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,16 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<input class="form-control" type="text" [skilltree]="skillId" (skills-report-success)="onReporterResponse($event)" (skills-report-error)="onReporterResponse($event)"/>
@@ -1,50 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Example } from './example';
@Component({
selector: 'app-input-code-example',
templateUrl: './input-code-example.component.html',
styleUrls: ['./input-code-example.component.css']
})
export class InputCodeExampleComponent implements OnInit {
@Input() example: Example
skillId: string
@Output() skillReportSuccess = new EventEmitter<string>();
constructor() {
}
ngOnInit(): void {
this.skillId = this.example.skillId;
}
onReporterResponse(event) {
this.skillReportSuccess.emit(event.detail)
}
getSampleCode() {
let sampleCode = `<input \n type="text" \n [skilltree]="\'${this.example.skillId}\'" \n (skills-report-success)="onReporterResponse($event)"`;
if (this.example.handleError) {
sampleCode += '\n (skills-report-error)="onReporterError($event)"';
}
sampleCode += ' />'
return sampleCode;
}
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,35 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<h2>Report Skills Examples</h2>
<div class="text-primary">Global Event Result:</div>
<div id="globalEventResultDiv" class="border rounded p-3 bg-light">
<pre data-cy="globalEventResult">{{ globalEventResult }}</pre>
</div>
<div class="mt-5 mb-5" *ngFor="let example of examples">
<ng-template #examplesTarget></ng-template>
</div>
</div>
<footer class="text-muted bg-light py-5">
<div class="container">
<p class="float-right">
<a href="angular/reportSkills#">Back to top</a>
</p>
<p>Angular Examples Guide</p>
</div>
</footer>
@@ -1,40 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportSkillsComponent } from './report-skills.component';
describe('ReportSkillsComponent', () => {
let component: ReportSkillsComponent;
let fixture: ComponentFixture<ReportSkillsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReportSkillsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ReportSkillsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,87 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import {
Component,
OnInit,
AfterViewInit,
OnDestroy,
ComponentFactoryResolver,
ViewChildren,
ViewContainerRef,
QueryList,
ChangeDetectorRef
} from '@angular/core';
import { Example } from './code-example/example'
import { ExampleService } from './code-example/example.service';
import { CodeExampleLayoutComponent } from './code-example/code-example-layout.component'
import { SkillsReporter } from '@skilltree/skills-client-ng';
@Component({
selector: 'app-report-skills',
templateUrl: './report-skills.component.html',
styleUrls: ['./report-skills.component.css']
})
export class ReportSkillsComponent implements OnInit, AfterViewInit, OnDestroy {
globalEventResult: string = ''
examples: Example[]
private loadedComponents = [];
@ViewChildren('examplesTarget', { read: ViewContainerRef }) exampleTargets: QueryList<ViewContainerRef>;
constructor(private exampleService: ExampleService, private componentFactoryResolver: ComponentFactoryResolver, private ref: ChangeDetectorRef) { }
ngOnInit() {
SkillsReporter.addSuccessHandler(result => {
this.globalEventResult = JSON.stringify(result, null, ' ')
// force change detection
this.ref.detectChanges();
});
}
ngAfterViewInit(): void {
setTimeout(() => {
this.viewLoaded();
});
}
ngOnDestroy(): void {
this.loadedComponents.forEach(component => component.destroy());
}
async viewLoaded() {
this.exampleTargets.changes.subscribe(() => {
this.loadExampleComponents();
});
await this.loadExamples();
}
async loadExamples() {
this.examples = this.exampleService.getExamples();
}
private loadExampleComponents() {
this.exampleTargets.toArray().forEach((viewContainerRef, i) => {
let example = this.examples[i];
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(CodeExampleLayoutComponent);
let componentRef = viewContainerRef.createComponent(componentFactory);
componentRef.instance.example = example;
componentRef.changeDetectorRef.detectChanges();
this.loadedComponents.push(componentRef);
});
}
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,65 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<div class="d-flex align-items-center mb-3">
<div ngbDropdown class="d-inline-block">
<button class="btn btn-outline-primary" id="dropdownBasic1" ngbDropdownToggle>Change Theme</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<button ngbDropdownItem *ngFor="let themeItem of themes"
(click)="setIsThemeUrlParam(themeItem)">{{themeItem.name}}</button>
</div>
</div>
<div class="custom-control custom-switch d-inline-block ml-3 border-right pr-2">
<input type="checkbox" class="custom-control-input" id="customSwitch1" (click)="setIsSummaryOnlyUrlParam()"
[checked]="displayOptions.isSummaryOnly">
<label class="custom-control-label" for="customSwitch1">Summary Only</label>
</div>
<div class="custom-control custom-switch d-inline-block ml-3 border-right pr-2">
<input type="checkbox" class="custom-control-input" id="customSwitch2" (click)="setInternalBackButtonUrlParam()"
[checked]="displayOptions.internalBackButton">
<label class="custom-control-label" for="customSwitch2">Internal Back Button</label>
</div>
<button class="btn btn-outline-primary" id="navButton" data-cy="navigateButton" (click)="navigate()">Navigate</button>
<a href="javascript:void(0)" class="ml-2" (click)="scrollTo('sample-code')">Show Source</a>
</div>
<div>
<span id="skillsDisplayPath" data-cy="skillsDisplayPath">Skills Display Path: [{{ skillsDisplayRoutePath }}]</span>
</div>
<div class="border rounded">
<skills-display #skillsDisplay *ngIf="selectedTheme" [options]="displayOptions" [version]="version" [theme]="selectedTheme.theme" [handleRouteChanged]="skillsDisplayRouteChanged">
</skills-display>
</div>
<div [hidden]="!showSampleCode" id="sample-code" class="row">
<div class="col-12">
<div class="mb-5 mt-5 card bg-light">
<h5 class=" card-header text-info">
<strong>Sample Code</strong>
</h5>
<div class="card-body py-0">
<pre><code [highlight]="getSampleCode()" [languages]="['html', 'javascript']"></code></pre>
</div>
</div>
</div>
</div>
</div>
@@ -1,40 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SkillsDisplayComponent } from './skills-display.component';
describe('SkillsDisplayComponent', () => {
let component: SkillsDisplayComponent;
let fixture: ComponentFixture<SkillsDisplayComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SkillsDisplayComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SkillsDisplayComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,120 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { themes } from './themes'
import { ViewportScroller } from '@angular/common';
import { js_beautify } from 'js-beautify'
@Component({
selector: 'app-skills-display',
templateUrl: './skills-display.component.html',
styleUrls: ['./skills-display.component.css']
})
export class SkillsDisplayComponent implements OnInit {
@ViewChild('skillsDisplay')
skillsDisplay: any;
displayOptions: any;
version: number;
selectedTheme: any;
themes: Array<any> = themes;
showSampleCode: boolean = false;
skillsDisplayRoutePath: string = '/';
constructor(private route: ActivatedRoute, private router: Router, private viewportScroller: ViewportScroller) { }
ngOnInit(): void {
this.route.queryParams.subscribe(params => {
this.version = params['skillsVersion'] ? JSON.parse(params['skillsVersion']) : 1000;
this.displayOptions = {
autoScrollStrategy: 'top-of-page',
isSummaryOnly: params['isSummaryOnly'] ? JSON.parse(params['isSummaryOnly']) : false,
internalBackButton: params['internalBackButton'] ? JSON.parse(params['internalBackButton']) : false,
};
this.selectedTheme = params['themeName'] ? this.findTheme(params['themeName']) : this.themes[0];
});
}
navigate() {
this.skillsDisplay.navigate('/subjects/subj0')
}
findTheme(name: string) {
return this.themes.find((item) => item.name === name);
}
skillsDisplayRouteChanged = (newPath: string) => {
this.skillsDisplayRoutePath = newPath;
}
refreshPage() {
setTimeout(() => {
document.location.reload();
}, 250);
}
setIsThemeUrlParam(theme) {
this.router.navigate(['angular/showSkills'], { queryParams: { themeName: theme.name }, queryParamsHandling: 'merge' });
this.refreshPage();
}
setIsSummaryOnlyUrlParam() {
this.displayOptions.isSummaryOnly = !this.displayOptions.isSummaryOnly;
this.router.navigate(['angular/showSkills'], { queryParams: { isSummaryOnly: this.displayOptions.isSummaryOnly }, queryParamsHandling: 'merge' });
this.refreshPage();
}
setInternalBackButtonUrlParam() {
this.displayOptions.internalBackButton = !this.displayOptions.internalBackButton;
this.router.navigate(['angular/showSkills'], { queryParams: { internalBackButton: this.displayOptions.internalBackButton }, queryParamsHandling: 'merge' });
this.refreshPage();
}
scrollTo(elementId: string) {
this.showSampleCode = true;
setTimeout(() => {
this.viewportScroller.scrollToAnchor(elementId);
}, 250);
}
getSampleCode() {
let sampleCode = `
<template>
<skills-level /> <!-- You can display the user's current Level using the SkillsLevel component -->
<skills-display :theme="selectedTheme" ${(this.displayOptions.isSummaryOnly || this.displayOptions.internalBackButton) ? ':options="displayOptions"' : ''}/>
</template>
<script>
${js_beautify(`
import { SkillsDisplay, SkillsLevel } from '@skilltree/skills-client-vue';
export default {
components: {
SkillsDisplay,
},
data() {
return {${this.displayOptions.isSummaryOnly ? '\ndisplayOptions: { isSummaryOnly: true, },' : ''}
selectedTheme: ${JSON.stringify(this.selectedTheme, null, ' ')}
};
},
};
`)}
</script>
`;
return sampleCode;
}
}
@@ -1,65 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const themes : Array<any> = [
{
name: 'Bright (default)',
theme: {
backgroundColor: '#f7f7f7',
},
},
{
name: 'Dark Blue',
theme: {
backgroundColor: '#626d7d',
pageTitleTextColor: 'white',
textSecondaryColor: 'white',
textPrimaryColor: 'white',
stars: {
unearnedColor: '#787886',
earnedColor: 'gold',
},
progressIndicators: {
beforeTodayColor: '#3e4d44',
earnedTodayColor: '#667da4',
completeColor: '#59ad52',
incompleteColor: '#cdcdcd',
},
charts: {
axisLabelColor: 'white',
},
tiles: {
backgroundColor:'#152E4d',
watermarkIconColor: '#a6c5f7',
},
graphLegendBorderColor: '1px solid grey',
},
}
];
@@ -1,23 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { PlaceholderDirective } from './placeholder.directive';
describe('PlaceholderDirective', () => {
it('should create an instance', () => {
const directive = new PlaceholderDirective();
expect(directive).toBeTruthy();
});
});
@@ -1,25 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Directive, ViewContainerRef } from '@angular/core';
@Directive({
selector: '[appPlaceholder]'
})
export class PlaceholderDirective {
constructor(public viewContainerRef: ViewContainerRef) { }
}
@@ -1,15 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
@@ -1,18 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export const environment = {
production: true
};
@@ -1,31 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

@@ -1,28 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SkillsIntClientNg</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
@@ -1,37 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import axios from 'axios';
import { SkillsConfiguration, Logger } from '@skilltree/skills-client-ng'
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
axios.get("/api/config")
.then((result) => {
SkillsConfiguration.configure(result.data);
})
.then(() => {
if ((<any> window).Cypress) {
(<any> window).skillsLogger = Logger;
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
})
@@ -1,82 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
// import '@angular/localize/init';
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
@@ -1,16 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* You can add global styles to this file, and also import other style files */
@@ -1,40 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
@@ -1,15 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [ "node"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
@@ -1,20 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
}
}
@@ -1,20 +0,0 @@
/*
This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
It is not intended to be used to perform a compilation.
To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
{
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
},
{
"path": "./e2e/tsconfig.json"
}
]
}
@@ -1,18 +0,0 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
@@ -1,152 +0,0 @@
{
"extends": "tslint:recommended",
"rules": {
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-return-shorthand": true,
"curly": true,
"deprecation": {
"severity": "warning"
},
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
],
"eofline": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": {
"options": [
"spaces"
]
},
"max-classes-per-file": false,
"max-line-length": [
true,
140
],
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"quotemark": [
true,
"single"
],
"semicolon": {
"options": [
"always"
]
},
"space-before-function-paren": {
"options": {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"typedef": [
true,
"call-signature"
],
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
},
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
},
"rulesDirectory": [
"codelyzer"
]
}
@@ -1 +0,0 @@
BROWSER=none
@@ -1,23 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
@@ -1 +0,0 @@
package-lock=false
@@ -1,83 +0,0 @@
<!---
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
@@ -1,25 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const path = require('path');
module.exports = {
webpack: {
alias: {
'react': path.resolve('./node_modules/react'),
'react-dom': path.resolve('./node_modules/react-dom'),
},
},
};
@@ -1,56 +0,0 @@
{
"name": "skills-int-client-react",
"version": "3.5.0",
"license": "Apache-2.0",
"description": "SkillTree Client Lib Integration Tests - React",
"homepage": "/react/",
"dependencies": {
"@skilltree/skills-client-react": "3.5.0",
"axios": "1.6.0",
"bootstrap": "4.5.3",
"core-js": "3.6.5",
"highlightjs": "9.16.2",
"js-beautify": "1.13.0",
"prop-types": "15.7.2",
"react": "16.13.1",
"react-bootstrap": "1.3.0",
"react-dom": "16.13.1",
"react-highlight": "0.12.0",
"react-router": "5.2.0",
"react-router-dom": "5.2.0"
},
"scripts": {
"serve": "PORT=8083 craco start",
"buildDepsAndServe": "cd ../../skills-client-js/ && npm run build && cd ../skills-client-react/ && npm run build && cd ../skills-client-integration/skills-int-client-react/ && npm run serve",
"licenseDepCheck": "license-checker --production --onlyAllow='MIT;ISC;BSD-3;BSD-2-Clause;Apache-2.0' --summary",
"licenseHeaderCheck": "license-check-and-add check -f '../license-add/license-add-config.json'",
"licenseHeaderAdd": "license-check-and-add add -f ../license-add/license-add-config.json",
"licenseCheck": "npm run licenseHeaderCheck && npm run licenseDepCheck ",
"clean": "find node_modules/ -maxdepth 1 ! -name \"@skilltree\" ! -name node_modules -exec rm -rf {} \\;",
"reinstall": "npm run clean && npm install",
"build": "npm run licenseCheck && craco build",
"test": "craco test",
"eject": "craco eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"license-check-and-add": "3.0.4",
"license-checker": "25.0.1",
"react-scripts": "4.0.3",
"@craco/craco": "6.4.0"
}
}
@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>skills</groupId>
<artifactId>skills-client-integration</artifactId>
<version>3.5.0-SNAPSHOT</version>
</parent>
<artifactId>skills-int-client-react</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<configuration>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v12.6.0</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<!--TODO: uncomment when we have at least 1 unit test-->
<!--<execution>-->
<!--<id>npm run test</id>-->
<!--<goals>-->
<!--<goal>npm</goal>-->
<!--</goals>-->
<!--<phase>test</phase>-->
<!--<configuration>-->
<!--<arguments>run unit</arguments>-->
<!--</configuration>-->
<!--</execution>-->
</executions>
</plugin>
</plugins>
</build>
</project>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

@@ -1,60 +0,0 @@
<!--
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="~highlight.js/styles/darcula.css">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

@@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,2 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
@@ -1,37 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #09d3ac;
}
@@ -1,45 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import Navigation from "./skillsDisplay/Navigation";
import './App.css';
import {
HashRouter as Router,
Switch,
Route,
} from "react-router-dom";
import ShowSkills from "./skillsDisplay/ShowSkills";
import ReportSkill from "./skillsDisplay/ReportSkill";
export default function App() {
return (
<Router>
<div className="App">
<Navigation projectId="movies"/>
</div>
<Switch>
<Route exact path="/showSkills">
<ShowSkills/>
</Route>
<Route exact path="/">
<ReportSkill/>
</Route>
{/*<Route exact path="/reportSkillEvent">
</Route>*/}
</Switch>
</Router>
);
}
@@ -1,28 +0,0 @@
/*
Copyright 2020 SkillTree
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
@@ -1,41 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import ReactDOM from 'react-dom';
import axios from 'axios';
import './index.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { SkillsConfiguration, Logger } from '@skilltree/skills-client-react';
axios.get("/api/config")
.then((result) => {
SkillsConfiguration.configure(result.data);
})
.then(() => {
SkillsConfiguration.afterConfigure().then(() => {
if (window.Cypress) {
window.skillsLogger = Logger;
}
ReactDOM.render(<App />, document.getElementById('root'));
})
});
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 170.96 159.93"><defs><style>.cls-1{fill:#09d3ac;}</style></defs><path class="cls-1" d="M141.35,73.27c0-6.89-8.11-13-20.58-16.73,3-12.67,1.69-22.75-4.28-26.16a9.55,9.55,0,0,0-4.79-1.2c-5.57,0-12.61,3.89-19.72,10.62-7.11-6.68-14.13-10.55-19.69-10.55a9.46,9.46,0,0,0-4.86,1.22c-5.94,3.42-7.17,13.44-4.21,26.05-12.41,3.71-20.48,9.77-20.5,16.63s8.12,13,20.59,16.72c-3,12.68-1.7,22.75,4.28,26.16a9.41,9.41,0,0,0,4.78,1.2c5.58,0,12.62-3.89,19.73-10.62,7.1,6.68,14.12,10.55,19.69,10.55a9.59,9.59,0,0,0,4.86-1.22c5.94-3.42,7.16-13.44,4.21-26C133.27,86.18,141.34,80.12,141.35,73.27ZM96.56,42.06c8.19-7.33,13.31-8.12,15.13-8.12h0a4.71,4.71,0,0,1,2.42.58c2.86,1.63,4,7.38,3.09,15a56.73,56.73,0,0,1-1,5.79,97.7,97.7,0,0,0-12.58-2.07,98.47,98.47,0,0,0-8.24-10.08C95.75,42.79,96.15,42.42,96.56,42.06ZM71.77,78.94c.78,1.5,1.61,3,2.47,4.51S76,86.49,77,88c-2.71-.39-5.34-.88-7.84-1.46C69.86,84,70.75,81.5,71.77,78.94ZM69,59.9c2.53-.59,5.18-1.08,7.93-1.46-1,1.48-1.86,3-2.76,4.59s-1.69,3-2.46,4.52Q70.18,63.65,69,59.9Zm5.21,13.34q1.86-3.93,4.09-7.86c1.5-2.62,3.11-5.17,4.77-7.61,2.91-.22,5.91-.34,9-.33s6,.12,8.89.35c1.66,2.42,3.25,5,4.75,7.55s2.88,5.22,4.12,7.83c-1.23,2.62-2.6,5.25-4.08,7.85s-3.11,5.18-4.77,7.62c-2.91.23-5.91.34-9,.34s-6-.13-8.89-.36c-1.66-2.42-3.26-4.94-4.76-7.55S75.5,75.85,74.25,73.24Zm32.86-14.77c2.72.38,5.35.87,7.84,1.45-.74,2.47-1.62,5-2.64,7.55-.79-1.5-1.61-3-2.48-4.51S108,59.93,107.11,58.47Zm2.76,24.92q1.29-2.27,2.46-4.53c1,2.6,2,5.16,2.7,7.66-2.52.59-5.17,1.07-7.92,1.45Q108.52,85.75,109.87,83.39ZM92,46.56c1.8,1.92,3.57,4,5.3,6.23-1.71-.07-3.46-.12-5.23-.12s-3.58,0-5.33.12C88.45,50.57,90.2,48.48,92,46.56Zm-22.18-12A4.82,4.82,0,0,1,72.29,34a13.11,13.11,0,0,1,5.19,1.31,39.07,39.07,0,0,1,10,6.78l1.17,1.07a98.49,98.49,0,0,0-8.16,10,98.88,98.88,0,0,0-12.65,2.06c-.44-1.94-.8-3.84-1-5.67C65.8,42,67,36.24,69.81,34.6ZM64.53,85.26a58.75,58.75,0,0,1-5.54-2c-7.1-3-11.5-6.85-11.5-10.14S51.91,66,59,63.05a57.63,57.63,0,0,1,5.44-1.94A97.93,97.93,0,0,0,69,73.25,98.72,98.72,0,0,0,64.53,85.26Zm23,19.1c-8.19,7.33-13.31,8.11-15.14,8.11a4.69,4.69,0,0,1-2.42-.58c-2.86-1.63-4-7.38-3.09-15a56.07,56.07,0,0,1,1-5.78,99.51,99.51,0,0,0,12.58,2.06,97.17,97.17,0,0,0,8.24,10.08Zm4.57-4.51c-1.8-1.92-3.57-4-5.31-6.23,1.72.08,3.47.12,5.24.12s3.58,0,5.33-.11C95.63,95.85,93.87,97.93,92.09,99.85Zm22.18,12a4.82,4.82,0,0,1-2.48.59c-1.82,0-7-.8-15.16-8.1l-1.17-1.07a98.44,98.44,0,0,0,8.15-10,97,97,0,0,0,12.66-2.06c.44,1.94.79,3.84,1,5.67C118.27,104.42,117.12,110.18,114.27,111.81Zm10.8-28.44c-1.71.7-3.52,1.35-5.44,1.93a98.54,98.54,0,0,0-4.57-12.14,98.1,98.1,0,0,0,4.49-12,58.75,58.75,0,0,1,5.54,2c7.09,3,11.5,6.85,11.49,10.14S132.17,80.42,125.07,83.37ZM92,82.39a9.18,9.18,0,1,0-9.17-9.19A9.17,9.17,0,0,0,92,82.39ZM31,17.88V128.53H153.07V17.88ZM148.3,123.77H35.78V22.65H148.3Zm-85-33.9c-3,12.68-1.7,22.75,4.28,26.16a9.41,9.41,0,0,0,4.78,1.2c5.58,0,12.62-3.89,19.73-10.62,7.1,6.68,14.12,10.55,19.69,10.55a9.59,9.59,0,0,0,4.86-1.22c5.94-3.42,7.16-13.44,4.21-26,12.41-3.72,20.48-9.78,20.49-16.63s-8.11-13-20.58-16.73c3-12.67,1.69-22.75-4.28-26.16a9.55,9.55,0,0,0-4.79-1.2c-5.57,0-12.61,3.89-19.72,10.62-7.11-6.68-14.13-10.55-19.69-10.55a9.46,9.46,0,0,0-4.86,1.22c-5.94,3.42-7.17,13.44-4.21,26.05-12.41,3.71-20.48,9.77-20.5,16.63S50.84,86.13,63.31,89.87Zm24.21,14.49c-8.19,7.33-13.31,8.11-15.14,8.11a4.69,4.69,0,0,1-2.42-.58c-2.86-1.63-4-7.38-3.09-15a56.07,56.07,0,0,1,1-5.78,99.51,99.51,0,0,0,12.58,2.06,97.17,97.17,0,0,0,8.24,10.08Zm24.79-36.89c-.79-1.5-1.61-3-2.48-4.51s-1.8-3-2.72-4.49c2.72.38,5.35.87,7.84,1.45C114.21,62.39,113.33,64.92,112.31,67.47Zm2.72,19c-2.52.59-5.17,1.07-7.92,1.45q1.41-2.22,2.76-4.58t2.46-4.53C113.37,81.46,114.28,84,115,86.52Zm-5.21-13.35c-1.23,2.62-2.6,5.25-4.08,7.85s-3.11,5.18-4.77,7.62c-2.91.23-5.91.34-9,.34s-6-.13-8.89-.36c-1.66-2.42-3.26-4.94-4.76-7.55s-2.87-5.22-4.12-7.83q1.86-3.93,4.09-7.86c1.5-2.62,3.11-5.17,4.77-7.61,2.91-.22,5.91-.34,9-.33s6,.12,8.89.35c1.66,2.42,3.25,5,4.75,7.55S108.58,70.56,109.82,73.17ZM77,88c-2.71-.39-5.34-.88-7.84-1.46.74-2.46,1.63-5,2.65-7.55.78,1.5,1.61,3,2.47,4.51S76,86.49,77,88ZM74.21,63c-.87,1.5-1.69,3-2.46,4.52Q70.18,63.65,69,59.9c2.53-.59,5.18-1.08,7.93-1.46C76,59.92,75.11,61.45,74.21,63ZM92.09,99.85c-1.8-1.92-3.57-4-5.31-6.23,1.72.08,3.47.12,5.24.12s3.58,0,5.33-.11C95.63,95.85,93.87,97.93,92.09,99.85Zm22.18,12a4.82,4.82,0,0,1-2.48.59c-1.82,0-7-.8-15.16-8.1l-1.17-1.07a98.44,98.44,0,0,0,8.15-10,97,97,0,0,0,12.66-2.06c.44,1.94.79,3.84,1,5.67C118.27,104.42,117.12,110.18,114.27,111.81Zm5.28-50.66a58.75,58.75,0,0,1,5.54,2c7.09,3,11.5,6.85,11.49,10.14s-4.41,7.16-11.51,10.11c-1.71.7-3.52,1.35-5.44,1.93a98.54,98.54,0,0,0-4.57-12.14A98.1,98.1,0,0,0,119.55,61.15Zm-23-19.09c8.19-7.33,13.31-8.12,15.13-8.12h0a4.71,4.71,0,0,1,2.42.58c2.86,1.63,4,7.38,3.09,15a56.73,56.73,0,0,1-1,5.79,97.7,97.7,0,0,0-12.58-2.07,98.47,98.47,0,0,0-8.24-10.08C95.75,42.79,96.15,42.42,96.56,42.06ZM92,46.56c1.8,1.92,3.57,4,5.3,6.23-1.71-.07-3.46-.12-5.23-.12s-3.58,0-5.33.12C88.45,50.57,90.2,48.48,92,46.56Line truncated

Before

Width:  |  Height:  |  Size: 8.0 KiB

@@ -1,150 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,25 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use(
'/api',
proxy({
target: 'http://localhost:8090',
changeOrigin: true,
})
);
};
@@ -1,54 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from "react";
import Navbar from 'react-bootstrap/Navbar';
import Nav from "react-bootstrap/Nav";
import Button from "react-bootstrap/Button"
import { SkillsLevel } from '@skilltree/skills-client-react';
import {
NavLink
} from "react-router-dom";
const Navigation = () => {
const tmpStyle = {
position:'fixed',
zIndex:1100,
right:0,
left:0,
};
return (
<div style={tmpStyle}>
<Navbar bg="info" variant="dark">
<Navbar.Brand>React Integration Examples</Navbar.Brand>
<Navbar.Toggle target="nav-collapse"></Navbar.Toggle>
<Navbar.Collapse id="nav-collapse" is-nav="true">
<Nav>
<NavLink activeClassName="router-link-active" className="nav-link" to="/">Report Skill Events</NavLink>
<NavLink activeClassName="router-link-active" className="nav-link" to="/showSkills?isSummaryOnly=false&internalBackButton=false&themeName=Bright%20(default)&skillsVersion=">User Display</NavLink>
</Nav>
</Navbar.Collapse>
<Button variant="primary">
<SkillsLevel />
</Button>
</Navbar>
</div>
);
};
export default Navigation;
@@ -1,112 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { SkillsReporter } from '@skilltree/skills-client-react';
import axios from 'axios';
const beautify = require('js-beautify').js;
let selectedSkillId = '';
const ReportSkill = () => {
const reportSkill = (skillId, resultContainer) => {
SkillsReporter.reportSkill(skillId)
.then((response) => {
document.querySelector(resultContainer).innerHTML = JSON.stringify(response, null, 2);
})
.catch((error) => {
console.error(error);
});
};
const sampleCode = () => {
return beautify(`SkillsReporter.reportSkill(this.skill)
.then((res) => {
this.reportResult = res;
});`, {indent_size: 2, indent_level: 1, end_with_newline: false})
};
const handleInputChange = (inputValue) => {
selectedSkillId = inputValue.target.value;
};
const [selectData, setSelectData] = React.useState([]);
React.useEffect(()=>{
axios.get("/api/skills")
.then((result) => {
setSelectData(result.data);
if (result.data && result.data.length > 0) {
selectedSkillId = result.data[0];
}
});
SkillsReporter.addSuccessHandler((result) => {
document.querySelector('#global-event-result-container').innerHTML = JSON.stringify(result, null, 2);
});
}, []);
const style = {
paddingTop: '55px'
};
return (
<div className="container-fluid" style={style}>
<div className="container">
<h2>Report Skills Examples</h2>
<div className="text-primary">Global Event Result:</div>
<div id="globalEventResultDiv" className="border rounded p-3 mb-5 bg-light">
<pre id="global-event-result-container" data-cy="globalEventResult"></pre>
</div>
<div>
<h5 className="text-info"><strong>Report Any Skill</strong></h5>
<div className="card card-body bg-light">
<pre className="m-0 sample-code">
<code className="javascript">{sampleCode()}</code></pre>
</div>
<div className="card card-body mt-3">
<div id="exampleDirectiveClickEvent">
<div className="float-left mr-3">
<select onChange={(event) => handleInputChange(event)} className="custom-select custom-select-m mb-3">
{selectData.map((skill)=>{
return <option key={skill} value={skill}>{skill}</option>
})}
</select>
</div>
<div className="float-left">
<button
className="btn btn-outline-primary"
onClick={() => reportSkill(selectedSkillId, '#report-result-container')}>
Report Skill
</button>
</div>
</div>
<hr />
<div className="text-primary">Result:</div>
<div className="border rounded p-3 bg-light">
<pre id="report-result-container"></pre>
</div>
</div>
</div>
<div className="mt-5"></div>
</div>
</div>
)
};
export default ReportSkill;
@@ -1,68 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import Highlight from 'react-highlight';
import PropTypes from 'prop-types';
const beautify = require('js-beautify').js;
const beautifyHtml = require('js-beautify').html;
const SampleCode = ({options, selectedTheme}) => {
const sampleCode = () => {
const tags = beautifyHtml(`
<div id="myApp">
<SkillsDisplay options="${JSON.stringify(options)}" theme={selectedThemeObj.theme} />
</div>
`,{indent_size: 4, indent_level: 2, end_with_newline: false, "html.format.contentUnformatted": "", "html.format.unformatted": ""});
const js = beautify(`
import { SkillsDisplay } from '@skilltree/skills-client-react';
const selectedThemeObj = ${JSON.stringify(selectedTheme)};
const MyComponent = () => {
return (
placeholder
)
};`, {indent_size: 2, indent_level: 1, end_with_newline: false});
const replacedText = js.replace('placeholder', tags);
return replacedText;
};
return (
<div id="sample-code" className="row">
<div className="col-12">
<div className="mb-5 mt-5 card bg-light">
<h5 className=" card-header text-info">
<strong>Sample Code</strong>
</h5>
<div className="card-body py-0">
<Highlight className="javascript">
<pre><code className="javascript p-0 m-0">{sampleCode()}</code></pre>
</Highlight>
</div>
</div>
</div>
</div>
);
};
SampleCode.propTypes = {
options: PropTypes.object.isRequired,
selectedTheme: PropTypes.object.isRequired
};
export default React.memo(SampleCode);
@@ -1,168 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import SkillsDisplayThemeFactory from './ThemeFactory.js';
import SampleCode from './SampleCode';
import { SkillsDisplay } from '@skilltree/skills-client-react';
import DropdownButton from "react-bootstrap/DropdownButton";
import Dropdown from 'react-bootstrap/Dropdown';
import Button from 'react-bootstrap/Button';
import { useHistory } from "react-router-dom";
const getThemes = () => {
return Object.values(SkillsDisplayThemeFactory);
};
const findTheme = (name) => {
return getThemes().find((item) => item.name === name);
};
const scrollToRef = (ref) => window.scrollTo(0, ref.current.offsetTop);
const handleRouteChanged = (newPath) => {
document.querySelector('#skillsDisplayPath').innerHTML = `Skills Display Path: [${newPath}]`;
};
function usePrevious(value){
const ref = React.useRef();
React.useEffect(() => {
ref.current = value;
});
return ref.current;
}
const ShowSkill = () => {
const history = useHistory();
const getUrlParam = (name) => {
const urlSearchParams = new URLSearchParams(history.location.search);
return urlSearchParams.get(name);
};
const [selectedTheme, saveSelectedTheme] = React.useState(() => {
const urlTheme = getUrlParam("themeName");
if(urlTheme) {
return findTheme(urlTheme);
}
return getThemes()[0];
});
const [isSummaryOnly, setIsSummaryOnly] = React.useState(() => {
const urlSummaryOnly = getUrlParam('isSummaryOnly');
if ( urlSummaryOnly ) {
return JSON.parse(urlSummaryOnly)
}
return false;
});
const [internalBackButton, setInternalBackButton] = React.useState(() => {
const urlInternalBackButton = getUrlParam('internalBackButton');
if ( urlInternalBackButton ) {
return JSON.parse(urlInternalBackButton)
}
return false;
});
const [skillsVersion] = React.useState(() => {
const skillsVersion = getUrlParam("skillsVersion");
if(skillsVersion) {
return skillsVersion;
}
return '';
});
const [options, setOptions] = React.useState({ isSummaryOnly: isSummaryOnly, internalBackButton: internalBackButton, autoScrollStrategy: 'top-offset', scrollTopOffset: 134 });
const previousIsSummaryOnly = usePrevious(isSummaryOnly);
const previousInternalBackButton = usePrevious(internalBackButton);
const previousSelectedTheme = usePrevious(selectedTheme);
const previousSkillsVersion = usePrevious(skillsVersion);
React.useEffect(() => {
const saveUrlParam = (paramsObj) => {
let params = '?';
Object.keys(paramsObj).forEach((key) =>{
params+=`${key}=${paramsObj[key]}&`;
});
params = params.replace(/&$/,'');
history.replace({pathname:history.location.pathname, search: params});
};
if (isSummaryOnly !== previousIsSummaryOnly || internalBackButton !== previousInternalBackButton || selectedTheme !== previousSelectedTheme) {
saveUrlParam({'isSummaryOnly': isSummaryOnly, 'internalBackButton': internalBackButton, 'themeName': selectedTheme.name, 'skillsVersion': skillsVersion});
}
}, [isSummaryOnly, internalBackButton, selectedTheme, skillsVersion, previousIsSummaryOnly, previousInternalBackButton, previousSelectedTheme, previousSkillsVersion, history]);
const sampleCodeRef = React.createRef();
const skillsDisplayRef = React.createRef();
const executeScroll = () => scrollToRef(sampleCodeRef);
const navigate = () => {
skillsDisplayRef.current.navigate('/subjects/subj0');
};
const style = {
paddingTop: '55px'
};
return (
<div className="container" style={style}>
<div className="d-flex align-items-center">
<DropdownButton
id="dropdown-1"
className="mb-3"
title="Theme"
variant="Primary">
{ getThemes().map ( (theme) => {
return <Dropdown.Item
onClick={() => saveSelectedTheme(theme)}
key={theme.name}
eventKey={theme.name} {... (selectedTheme.name === theme.name ? {disabled:true} : "")}>
{theme.name}
</Dropdown.Item>
})}
</DropdownButton>
<Button variant={isSummaryOnly ? 'primary' : 'outline-primary'}
onClick={() => { setIsSummaryOnly(!isSummaryOnly);
setOptions({isSummaryOnly:!isSummaryOnly,internalBackButton:internalBackButton,autoScrollStrategy: 'top-offset', scrollTopOffset: 134}) }}>Summary Only</Button>
<Button variant={internalBackButton ? 'primary' : 'outline-primary'}
onClick={() => { setInternalBackButton(!internalBackButton);
setOptions({isSummaryOnly:isSummaryOnly,internalBackButton:!internalBackButton,autoScrollStrategy: 'top-offset', scrollTopOffset: 134}) }}>Internal Back Button</Button>
<Button variant={internalBackButton ? 'primary' : 'outline-primary'}
onClick={navigate} data-cy="navigateButton">Navigate</Button>
<Button variant="link" onClick={executeScroll}>Show Source</Button>
</div>
<div>
<span id="skillsDisplayPath" data-cy="skillsDisplayPath"></span>
</div>
<div className="border rounded">
<SkillsDisplay ref={skillsDisplayRef} options={options} theme={selectedTheme.theme} version={skillsVersion} handleRouteChanged={handleRouteChanged}/>
</div>
<div ref={sampleCodeRef}>
<SampleCode options={options} selectedTheme={selectedTheme}/>
</div>
</div>
);
};
export default ShowSkill;
@@ -1,51 +0,0 @@
/*
* Copyright 2020 SkillTree
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const exported = {
default: {
name: 'Bright (default)',
theme: {
backgroundColor: '#f7f7f7',
},
},
darkBlue: {
name: 'Dark Blue',
theme: {
backgroundColor: '#626d7d',
pageTitleTextColor: 'white',
textSecondaryColor: 'white',
textPrimaryColor: 'white',
stars: {
unearnedColor: '#787886',
earnedColor: 'gold',
},
progressIndicators: {
beforeTodayColor: '#3e4d44',
earnedTodayColor: '#667da4',
completeColor: '#59ad52',
incompleteColor: '#cdcdcd',
},
charts: {
axisLabelColor: 'white',
},
tiles: {
backgroundColor:'#152E4d',
watermarkIconColor: '#a6c5f7',
},
graphLegendBorderColor: '1px solid grey',
},
}
};
export default exported;
@@ -1 +0,0 @@
BROWSER=none
@@ -1,24 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/skills-int-client-react.iml
@@ -1 +0,0 @@
package-lock=false
Loaded 100 of 247 files, more files were not shown because too many files have changed in this diff. Show more