diff --git a/src/models.ts b/src/models.ts index 39c48bf..5ce2dec 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1162,10 +1162,13 @@ export interface ISettings { export interface IReportBars { actionBar?: IActionBar; + statusBar?: IStatusBar; } export interface IActionBar extends IHideable { } +export interface IStatusBar extends IHideable { } + export interface IReportPanes extends IPanes { bookmarks?: IBookmarksPane; fields?: IFieldsPane; diff --git a/src/validators/core/validator.ts b/src/validators/core/validator.ts index 821f51f..a418f7e 100644 --- a/src/validators/core/validator.ts +++ b/src/validators/core/validator.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { ActionBarValidator, ReportBarsValidator } from '../models/barsValidator'; +import { ActionBarValidator, StatusBarValidator, ReportBarsValidator } from '../models/barsValidator'; import { AddBookmarkRequestValidator, ApplyBookmarkByNameRequestValidator, ApplyBookmarkStateRequestValidator, CaptureBookmarkOptionsValidator, CaptureBookmarkRequestValidator, PlayBookmarkRequestValidator } from '../models/bookmarkValidator'; import { CommandsSettingsValidator, SingleCommandSettingsValidator, PaginatedReportCommandsValidator } from '../models/commandsSettingsValidator'; import { CustomThemeValidator } from '../models/customThemeValidator'; @@ -81,6 +81,7 @@ export const Validators = { anyFilterValidator: new AnyOfValidator([new BasicFilterValidator(), new AdvancedFilterValidator(), new IncludeExcludeFilterValidator(), new NotSupportedFilterValidator(), new RelativeDateFilterValidator(), new TopNFilterValidator(), new RelativeTimeFilterValidator(), new HierarchyFilterValidator()]), anyValueValidator: new AnyOfValidator([new StringValidator(), new NumberValidator(), new BooleanValidator()]), actionBarValidator: new ActionBarValidator(), + statusBarValidator: new StatusBarValidator(), applyBookmarkByNameRequestValidator: new ApplyBookmarkByNameRequestValidator(), applyBookmarkStateRequestValidator: new ApplyBookmarkStateRequestValidator(), applyBookmarkValidator: new AnyOfValidator([new ApplyBookmarkByNameRequestValidator(), new ApplyBookmarkStateRequestValidator()]), diff --git a/src/validators/models/barsValidator.ts b/src/validators/models/barsValidator.ts index 2fb4d76..71384f0 100644 --- a/src/validators/models/barsValidator.ts +++ b/src/validators/models/barsValidator.ts @@ -19,6 +19,10 @@ export class ReportBarsValidator extends ObjectValidator { { field: "actionBar", validators: [Validators.actionBarValidator] + }, + { + field: "statusBar", + validators: [Validators.statusBarValidator] } ]; @@ -48,3 +52,25 @@ export class ActionBarValidator extends ObjectValidator { return multipleFieldsValidator.validate(input, path, field); } } + +export class StatusBarValidator extends ObjectValidator { + public validate(input: any, path?: string, field?: string): IValidationError[] { + if (input == null) { + return null; + } + const errors = super.validate(input, path, field); + if (errors) { + return errors; + } + + const fields: IFieldValidatorsPair[] = [ + { + field: "visible", + validators: [Validators.booleanValidator] + }, + ]; + + const multipleFieldsValidator = new MultipleFieldsValidator(fields); + return multipleFieldsValidator.validate(input, path, field); + } +}