Update MegaMenu Application Customizer: Version bump to 1.1.0, localization support added, and unnecessary files removed
- Deleted obsolete localization file for English (en-us). - Updated version number from 1.0.4 to 1.1.0 in manifests.js and manifests.json. - Added localization support for German (de-de) in a new localization file. - Removed unnecessary dependencies from manifests. - Added .gitignore to exclude build artifacts and temporary files.
This commit is contained in:
@@ -12,29 +12,11 @@ const LOG_SOURCE: string = 'TaxonomyNavigationService';
|
||||
|
||||
export class TaxonomyNavigationService implements ITaxonomyNavigationService {
|
||||
private _taxonomyPickerService: SPTermStorePickerService;
|
||||
private _noTerm: ITerm = {
|
||||
_ObjectType_: '',
|
||||
_ObjectIdentity_: '',
|
||||
CustomSortOrderIndex: 0,
|
||||
Description: '',
|
||||
Id: '',
|
||||
IsAvailableForTagging: false,
|
||||
IsDeprecated: false,
|
||||
IsRoot: true,
|
||||
LocalCustomProperties: {
|
||||
_Sys_Nav_HoverText: 'Es wurden keine Terms gefunden. Bitte ueberpruefen Sie Ihre Einstellungen.',
|
||||
_Sys_Nav_ExcludedProviders: undefined,
|
||||
_Sys_Nav_SimpleLinkUrl: undefined
|
||||
},
|
||||
Name: 'Es wurden keine Terms gefunden. Bitte ueberpruefen Sie Ihre Einstellungen.',
|
||||
PathOfTerm: '',
|
||||
TermSet: undefined
|
||||
};
|
||||
|
||||
constructor(
|
||||
private context: ApplicationCustomizerContext,
|
||||
private termSetName: string,
|
||||
private debug: boolean = false
|
||||
private termSetNameOrId: string,
|
||||
private debug: boolean = false,
|
||||
private cacheMinutes: number = 15
|
||||
) {
|
||||
sp.setup({
|
||||
spfxContext: context
|
||||
@@ -42,10 +24,11 @@ export class TaxonomyNavigationService implements ITaxonomyNavigationService {
|
||||
this._taxonomyPickerService = new SPTermStorePickerService(
|
||||
{
|
||||
anchorId: '',
|
||||
termsetNameOrID: termSetName,
|
||||
termsetNameOrID: termSetNameOrId,
|
||||
useSessionStorage: true,
|
||||
hideDeprecatedTags: true,
|
||||
hideTagsNotAvailableForTagging: false
|
||||
hideTagsNotAvailableForTagging: false,
|
||||
cacheMinutes: cacheMinutes
|
||||
},
|
||||
this.context,
|
||||
this.debug
|
||||
@@ -54,13 +37,19 @@ export class TaxonomyNavigationService implements ITaxonomyNavigationService {
|
||||
|
||||
public async getMenuItems(): Promise<IMenuItem[]> {
|
||||
const siteCollectionUrl: string = this.context.pageContext.site.absoluteUrl;
|
||||
const termset: ITermSet = await this._taxonomyPickerService.getAllTerms(this.termSetName);
|
||||
const termset: ITermSet = await this._taxonomyPickerService.getAllTerms(
|
||||
this.termSetNameOrId,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
this.cacheMinutes
|
||||
);
|
||||
const itemsDict: ItemDictionary<IMenuItem> = new ItemDictionary<IMenuItem>();
|
||||
const menuItems: IMenuItem[] = [];
|
||||
|
||||
if (!termset || !termset.Terms) {
|
||||
if (!termset || !termset.Terms || termset.Terms.length === 0) {
|
||||
debugWarn(this.debug, LOG_SOURCE, 'No terms found in the term set.');
|
||||
return [new MenuItem(this._noTerm, 0, siteCollectionUrl)];
|
||||
throw new Error('The configured navigation term set was not found or contains no terms.');
|
||||
}
|
||||
|
||||
termset.Terms.forEach((term: ITerm) => {
|
||||
@@ -80,4 +69,4 @@ export class TaxonomyNavigationService implements ITaxonomyNavigationService {
|
||||
|
||||
return menuItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user