Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taxonomy-editor create term changes #2

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage
dist
58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
# knowledge-platform-tools
## TaxonomyEditor

### Install latest version of sb-taxonomy-editor.

npm i sb-taxonomy-editor

### Add below element in sunbird-Ed-portal

<lib-taxonomy-view [environment]="environment" [taxonomyConfig]="taxonomyConfig">

### Save below "environment" and "taxonomyConfig" in local storage before initialize above library. (this need to change as input to a library).

environment = {
frameworkName: string,
channelId: string,
authToken: string,
isApprovalRequired: boolean // set default to false,
}



taxonomyConfig = {
frameworkId: string,
config: [
{
index:number,
category:string,
icon: 'string',
color: 'string'
}
]
}


## Local setup and run app.

### Install the node_modules

npm install

### Build and watch library.
ng build sb-taxonomy-edior --watch=true

### Build app.
npm run start

### open

http://localhost:4200

### Unit Test

ng test sb-taxonomy-editor --watch=true

### Code Coverage

ng test sb-taxonomy-editor --code-coverage
163 changes: 163 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"taxonomy-editor": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/taxonomy-editor",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": [
"./node_modules/leader-line/leader-line.min.js"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "1.5mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "taxonomy-editor:build:production"
},
"development": {
"browserTarget": "taxonomy-editor:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "taxonomy-editor:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
}
}
},
"sb-taxonomy-editor": {
"projectType": "library",
"root": "projects/sb-taxonomy-editor",
"sourceRoot": "projects/sb-taxonomy-editor/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/sb-taxonomy-editor/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/sb-taxonomy-editor/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/sb-taxonomy-editor/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/sb-taxonomy-editor/src/test.ts",
"tsConfig": "projects/sb-taxonomy-editor/tsconfig.spec.json",
"karmaConfig": "projects/sb-taxonomy-editor/karma.conf.js",
"codeCoverageExclude": [
"projects/sb-taxonomy-editor/src/lib/components/categories-preview/**",
"projects/sb-taxonomy-editor/src/lib/components/create-categories/**",
"projects/sb-taxonomy-editor/src/lib/containers/config-framework/**",
"projects/sb-taxonomy-editor/src/lib/services/connector.service.ts",
"projects/sb-taxonomy-editor/src/lib/services/local-connection.service.ts"
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/sb-taxonomy-editor/**/*.ts"
]
}
}

}
}
},
"cli": {
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
44 changes: 44 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/taxonomy-editor'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
Loading