custom layout definitions
This commit is contained in:
Родитель
899d87bee3
Коммит
43561ce215
|
@ -11,6 +11,8 @@ export const settingsSchema = require('./schemas/settings.json');
|
|||
export const basicFilterSchema = require('./schemas/basicFilter.json');
|
||||
export const createReportSchema = require('./schemas/reportCreateConfiguration.json');
|
||||
export const saveAsParametersSchema = require('./schemas/saveAsParameters.json');
|
||||
export const customLayoutSchema = require('./schemas/customLayout.json');
|
||||
export const pageSizeSchema = require('./schemas/pageSize.json');
|
||||
/* tslint:enable:no-var-requires */
|
||||
|
||||
import * as jsen from 'jsen';
|
||||
|
@ -62,16 +64,44 @@ function validate(schema: any, options?: any) {
|
|||
};
|
||||
}
|
||||
|
||||
export enum PageSizeType {
|
||||
Widescreen,
|
||||
Standard,
|
||||
Cortana,
|
||||
Letter,
|
||||
Custom
|
||||
}
|
||||
|
||||
export enum DisplayOption {
|
||||
FitToPage,
|
||||
FitToWidth,
|
||||
ActualSize
|
||||
}
|
||||
|
||||
export interface IPageSize {
|
||||
type: PageSizeType;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export interface ICustomLayout {
|
||||
pageSize?: IPageSize;
|
||||
displayOption?: DisplayOption;
|
||||
}
|
||||
|
||||
export interface ISettings {
|
||||
filterPaneEnabled?: boolean;
|
||||
navContentPaneEnabled?: boolean;
|
||||
useCustomSaveAsDialog?: boolean;
|
||||
customLayout?: ICustomLayout;
|
||||
}
|
||||
|
||||
export const validateSettings = validate(settingsSchema, {
|
||||
schemas: {
|
||||
basicFilter: basicFilterSchema,
|
||||
advancedFilter: advancedFilterSchema
|
||||
advancedFilter: advancedFilterSchema,
|
||||
customLayout: customLayoutSchema,
|
||||
pageSize: pageSizeSchema
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -90,7 +120,9 @@ export const validateReportLoad = validate(loadSchema, {
|
|||
schemas: {
|
||||
settings: settingsSchema,
|
||||
basicFilter: basicFilterSchema,
|
||||
advancedFilter: advancedFilterSchema
|
||||
advancedFilter: advancedFilterSchema,
|
||||
customLayout: customLayoutSchema,
|
||||
pageSize: pageSizeSchema
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pageSize": {
|
||||
"$ref": "#pageSize"
|
||||
},
|
||||
"displayOption": {
|
||||
"type": "number",
|
||||
"enum": [0, 1, 2],
|
||||
"default": 0,
|
||||
"invalidMessage": "displayOption property is invalid"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"width": {
|
||||
"type": "number",
|
||||
"messages": {
|
||||
"type": "width must be a number"
|
||||
}
|
||||
},
|
||||
"height": {
|
||||
"type": "number",
|
||||
"messages": {
|
||||
"type": "height must be a number"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "number",
|
||||
"enum": [0, 1, 2, 3, 4, 5],
|
||||
"default": 0,
|
||||
"invalidMessage": "type property is invalid"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
}
|
|
@ -19,6 +19,9 @@
|
|||
"messages": {
|
||||
"type": "useCustomSaveAsDialog must be a boolean"
|
||||
}
|
||||
},
|
||||
"customLayout": {
|
||||
"$ref": "#customLayout"
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче