diff --git a/.eslintrc.json b/.eslintrc.json index c23e0ec..491f2b5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,7 +11,9 @@ "node_modules/**", "src/app/generated/**", "src/app/api/*", - "src/app/model/*" + "src/app/model/*", + "src/**/*.ico", + "src/**/*.svg" ], "overrides": [ { diff --git a/karma.conf.js b/karma.conf.js index 974669e..fcdd1d0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -11,7 +11,6 @@ module.exports = function (config) { require('karma-coverage'), require('karma-jasmine'), require('karma-jasmine-html-reporter'), - require('karma-junit-reporter'), require('karma-sonarqube-unit-reporter'), require('@angular-devkit/build-angular/plugins/karma') ], @@ -27,15 +26,6 @@ module.exports = function (config) { jasmineHtmlReporter: { suppressAll: true // removes the duplicated traces }, - junitReporter: { - outputDir: 'reports/unit-test-results', // results will be saved as $outputDir/$browserName.xml - outputFile: 'results-junit-tests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: 'models', // suite will become the package name attribute in xml testsuite element - useBrowserName: false, // add browser name to report and classes names - nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element - classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element - properties: {} // key value pair of properties to add to the section of the report - }, sonarqubeReporter: { basePath: 'src/app', // test files folder filePattern: '**/*.spec.ts', // test files glob pattern @@ -55,9 +45,9 @@ module.exports = function (config) { includeAllSources: true, dir: 'reports', subdir: 'coverage', - reporters: [{ type: 'html' }, { type: 'text-summary' }, { type: 'lcov' }] + reporters: [{ type: 'html' }, { type: 'text-summary' }] }, - reporters: ['progress', 'kjhtml', 'coverage', 'sonarqubeUnit', 'junit'], + reporters: ['progress', 'kjhtml', 'coverage', 'sonarqubeUnit'], preprocessors: { 'src/**/*.js': ['coverage'] }, port: 9876, colors: true, diff --git a/package.json b/package.json index a7877d1..6363c00 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,11 @@ { "name": "onecx-theme-ui", + "private": true, "version": "0.0.0", "license": "Apache-2.0", + "contributors": [ + "OneCX Development Team " + ], "config": { "openapiYaml": "src/assets/api/themes-bff-api.yaml", "openapiOutput": "src/app/generated" @@ -13,7 +17,7 @@ "start": "ng serve --configuration=development --proxy-config=proxy.conf.js", "prepare": "husky install", "lint": "ng lint", - "eslint": "eslint --ext .js,.ts src", + "eslint": "eslint --quiet --ext .js,.ts src/**", "format": "ng lint --fix", "browsers": "npx browserslist", "test": "ng test", @@ -25,7 +29,6 @@ "apigen-generate": "openapi-generator-cli generate -i $npm_package_config_openapiYaml -g typescript-angular -c apigen.yaml -o $npm_package_config_openapiOutput --type-mappings=AnyType=object,set=Array", "apigen": "npm run apigen-cleanup && npm run apigen-generate && npm run apigen-format" }, - "private": true, "husky": { "hooks": { "pre-commit": "pretty-quick --staged" @@ -39,9 +42,7 @@ "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "codeCoverageExclude": [ - "src/app/generated/**/*", - "src/app/**/*.spec.ts", - "src/app/test/**/*" + "src/app/generated/**/*" ] } }, diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index f2846fb..96e818c 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -52,7 +52,9 @@ export const basePathProvider = (mfeInfo: MfeInfo) => { } export function HttpLoaderFactory(http: HttpClient, mfeInfo: MfeInfo) { - console.log(`Configuring translation loader ${mfeInfo?.remoteBaseUrl}`) + if (mfeInfo) { + console.log(`Configuring translation loader ${mfeInfo?.remoteBaseUrl}`) + } // if running standalone then load the app assets directly from remote base URL const appAssetPrefix = mfeInfo && mfeInfo.remoteBaseUrl ? mfeInfo.remoteBaseUrl : './' return new TranslateCombinedLoader( diff --git a/src/app/theme/theme-import/theme-import.component.ts b/src/app/theme/theme-import/theme-import.component.ts index 7d8f4c7..db28bd7 100644 --- a/src/app/theme/theme-import/theme-import.component.ts +++ b/src/app/theme/theme-import/theme-import.component.ts @@ -84,14 +84,14 @@ export class ThemeImportComponent implements OnInit { }) .subscribe({ next: (data) => { - this.msgService.success({ summaryKey: 'PORTAL_IMPORT.IMPORT_THEME_SUCCESS' }) + this.msgService.success({ summaryKey: 'THEME.IMPORT.IMPORT_THEME_SUCCESS' }) this.onImportThemeClear() this.displayThemeImport = false this.uploadEmitter.emit() this.router.navigate([`./${data.id}`], { relativeTo: this.route }) }, error: () => { - this.msgService.error({ summaryKey: 'PORTAL_IMPORT.IMPORT_THEME_FAIL' }) + this.msgService.error({ summaryKey: 'THEME.IMPORT.IMPORT_THEME_FAIL' }) } }) }