Add Current Navigation Application Customizer
- Created a new SPFx Application Customizer for current navigation. - Implemented core functionality to fetch and render navigation items from a SharePoint term set. - Added styles for the navigation component using SCSS. - Included localization support for English and German languages. - Developed unit tests for core navigation functionalities. - Configured TypeScript and TSLint settings for the project. - Added validation scripts for static assets and package configuration.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
var fs = require('fs');
|
||||
function read(path) { return fs.readFileSync(path, 'utf8'); }
|
||||
function json(path) { return JSON.parse(read(path)); }
|
||||
function assert(name, condition) { if (!condition) { throw new Error('FAILED: ' + name); } console.log('OK:', name); }
|
||||
var packageJson = json('package.json');
|
||||
var solution = json('config/package-solution.json').solution;
|
||||
var manifest = json('src/extensions/currentNavigation/CurrentNavigationApplicationCustomizer.manifest.json');
|
||||
var app = read('src/extensions/currentNavigation/CurrentNavigationApplicationCustomizer.ts');
|
||||
var renderer = read('src/extensions/currentNavigation/CurrentNavigationRenderer.ts');
|
||||
var service = read('src/services/CurrentNavigationTaxonomyService.ts');
|
||||
assert('package version', packageJson.version === '1.0.0');
|
||||
assert('solution version', solution.version === '1.0.0.0');
|
||||
assert('tenant deployment', solution.skipFeatureDeployment === true);
|
||||
assert('component type', manifest.extensionType === 'ApplicationCustomizer');
|
||||
assert('safe renderer', renderer.indexOf('innerHTML') < 0 && app.indexOf('innerHTML') < 0);
|
||||
assert('placeholder lifecycle cleanup', app.indexOf('changedEvent.remove') >= 0);
|
||||
assert('local properties loaded', service.indexOf('LocalCustomProperties') >= 0);
|
||||
assert('root property present', read('src/services/CurrentNavigationCore.ts').indexOf('CurrentNavigation.Root') >= 0);
|
||||
assert('hidden property present', read('src/services/CurrentNavigationCore.ts').indexOf('CurrentNavigation.Hidden') >= 0);
|
||||
console.log('CurrentNavigation static tests passed.');
|
||||
Reference in New Issue
Block a user