Skip to content

Switch to BPA Report schema for builder #1725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ const _nav = [
},
{
component: CNavItem,
name: 'BPA Field Builder',
to: '/tenant/tools/bpa-field-builder',
name: 'BPA Report Builder',
to: '/tenant/tools/bpa-report-builder',
},
],
},
Expand Down
257 changes: 257 additions & 0 deletions src/data/BPAReport.schema.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
{
"title": "BPA Report Builder",
"type": "object",
"required": ["name", "style", "Fields"],
"properties": {
"name": {
"type": "string",
"title": "Report Name",
"description": "The title or name of the report."
},
"style": {
"type": "string",
"title": "Report Style",
"default": "Table",
"enum": ["Table", "Tenant"],
"description": "Specifies the layout or presentation style of the report."
},
"Fields": {
"title": "Report Fields",
"type": "array",
"minItems": 1,
"items": {
"required": ["name"],
"properties": {
"name": {
"type": "string",
"title": "Field Name",
"description": "Identifier for each set or category of data."
},
"UseExistingInfo": {
"type": "boolean",
"title": "Use Existing Info?",
"default": false
},
"FrontendFields": {
"type": "array",
"title": "Frontend Fields",
"description": "Describes how each data attribute will be displayed in the report.",
"items": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "Label for the data in the report.",
"type": "string"
},
"value": {
"title": "Value",
"description": "Reference to the data's location or attribute.",
"type": "string"
},
"formatter": {
"title": "Formatter",
"description": "Specifies how the data will be formatted for display.",
"type": "string",
"anyOf": [
{
"const": "string",
"title": "Display as plain text"
},
{
"const": "bool",
"title": "True/False"
},
{
"const": "warnBool",
"title": "True/False values with potential visual warnings"
},
{
"const": "reverseBool",
"title": "Inverts the True/False value for display"
},
{
"const": "table",
"title": "Represents the data in a table format"
},
{
"const": "number",
"title": "Displays as a numerical value"
}
]
}
}
},
"minItems": 1,
"required": ["name", "value", "formatter"]
},
"desc": {
"title": "Field Description",
"description": "A description field shown on the end of the card on the tenant overview page",
"type": "string"
}
},
"allOf": [
{
"if": {
"properties": {
"UseExistingInfo": {
"enum": [false]
}
}
},
"then": {
"required": ["API", "StoreAs", "ExtractFields"],
"properties": {
"where": {
"title": "Where",
"description": "A conditional filter to determine which data gets displayed or processed. Use PowerShell's Where-Object Filterscript format.",
"type": "string"
},
"StoreAs": {
"type": "string",
"title": "Store As",
"description": "The format in which to store the fetched data.",
"anyOf": [
{
"const": "string",
"title": "String - For plain text"
},
{
"const": "JSON",
"title": "JSON - For structured data"
},
{
"const": "bool",
"title": "Boolean - True/False values"
}
]
},
"API": {
"type": "string",
"title": "API",
"anyOf": [
{
"const": "Graph",
"title": "Graph"
},
{
"const": "Exchange",
"title": "Exchange"
},
{
"const": "CIPPFunction",
"title": "CIPP Function"
}
],
"default": "Graph",
"description": "Defines the source or type of API to fetch the data."
},
"ExtractFields": {
"title": "Extract Fields",
"description": "Lists the attributes or fields to extract from the returned data.",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"allOf": [
{
"if": {
"properties": {
"API": {
"enum": ["CIPPFunction"]
}
}
},
"then": {
"properties": {
"Command": {
"type": "string",
"pattern": "^Get-CIPP",
"description": "Command for CIPP Function (Get-CIPP)"
}
},
"required": ["Command"]
}
},
{
"if": {
"properties": {
"API": {
"enum": ["Exchange"]
}
}
},
"then": {
"properties": {
"Command": {
"type": "string",
"title": "Command",
"pattern": "^Get-",
"description": "Command for Exchange (Get only)"
}
},
"required": ["Command"]
}
},
{
"if": {
"properties": {
"API": {
"enum": ["Graph"]
}
}
},
"then": {
"properties": {
"parameters": {
"type": "object",
"title": "Parameters",
"description": "Additional settings or parameters required for the API call.",
"properties": {
"asApp": {
"title": "Use Application Permissions",
"type": "boolean"
}
},
"additionalProperties": true
},
"URL": {
"type": "string",
"pattern": "^https://graph.microsoft.com/",
"description": "The endpoint for Graph"
}
},
"required": ["URL"]
}
},
{
"if": {
"properties": {
"API": {
"enum": ["Exchange", "CIPPFunction"]
}
}
},
"then": {
"properties": {
"parameters": {
"type": "object",
"title": "Parameters",
"description": "Additional settings or parameters required for the API call.",
"additionalProperties": true
}
}
}
}
]
}
}
]
}
}
}
}
30 changes: 30 additions & 0 deletions src/data/BPAReport.uischema.v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"ui:disabled": false,
"ui:readonly": false,
"ui:order": ["name", "style", "*"],
"Fields": {
"items": {
"ui:order": [
"name",
"desc",
"UseExistingInfo",
"StoreAs",
"API",
"URL",
"Command",
"parameters",
"where",
"ExtractFields",
"FrontendFields",
"*"
],
"FrontendFields": {
"ui:classNames": "card card-title p-4 my-4"
},
"ui:classNames": "card card-title p-4 my-4"
}
},
"ui:submitButtonOptions": {
"norender": true
}
}
8 changes: 4 additions & 4 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DeviceComplianceReport = React.lazy(() =>
const BestPracticeAnalyzer = React.lazy(() =>
import('src/views/tenant/standards/BestPracticeAnalyser'),
)
const BPAFieldBuilder = React.lazy(() => import('src/views/tenant/standards/BPAFieldBuilder'))
const BPAReportBuilder = React.lazy(() => import('src/views/tenant/standards/BPAReportBuilder'))
const DomainsAnalyser = React.lazy(() => import('src/views/tenant/standards/DomainsAnalyser'))
const OffboardingWizard = React.lazy(() =>
import('src/views/identity/administration/OffboardingWizard'),
Expand Down Expand Up @@ -387,9 +387,9 @@ const routes = [
component: GeoIPLookup,
},
{
path: '/tenant/tools/bpa-field-builder',
name: 'BPA Field Builder',
component: BPAFieldBuilder,
path: '/tenant/tools/bpa-report-builder',
name: 'BPA Report Builder',
component: BPAReportBuilder,
},
{ path: '/tenant/standards/alert-list', name: 'Alert List (Alpha)', component: ListAlerts },
{ path: '/endpoint', name: 'Endpoint' },
Expand Down
56 changes: 0 additions & 56 deletions src/views/tenant/standards/BPAFieldBuilder.js

This file was deleted.

Loading