Skip to content
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
3 changes: 1 addition & 2 deletions framework/python/src/common/risk_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ def __init__(self, profile_json=None, profile_format=None):
'r',
encoding='utf-8') as device_format_file:
device_format_json = json.load(device_format_file)
for step in device_format_json:
self._device_format.extend(step['questions'])
self._device_format = device_format_json
except (IOError, ValueError) as e:
LOGGER.error(
'An error occurred whilst loading the device profile format')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
margin: 20px 0 8px;
font-size: 18px;
line-height: 24px;
color: colors.$grey-800;
color: colors.$on-surface-variant;
}

.device-tests-description {
margin: 0;
font-family: variables.$font-secondary;
font-family: variables.$font-text;
font-size: 14px;
line-height: 20px;
letter-spacing: 0.2px;
color: colors.$grey-800;
color: colors.$on-surface-variant;
}

.device-form-test-modules {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
@use 'variables';

.field-label {
margin: 0;
color: colors.$grey-800;
font-size: 18px;
font-family: variables.$font-text;
font-style: normal;
font-weight: 500;
font-size: 16px;
line-height: 24px;
padding-top: 24px;
padding-bottom: 16px;
letter-spacing: 0.1px;
color: colors.$on-surface-variant;
padding: 20px 20px 8px 16px;
display: inline-block;
&:has(+ .field-select-multiple.ng-invalid.ng-dirty) {
color: mat.get-theme-color($light-theme, error, 40);
Expand Down
78 changes: 32 additions & 46 deletions modules/ui/src/app/mocks/device.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
Device,
DeviceStatus,
DeviceQuestionnaireSection,
} from '../model/device';
import { Device, DeviceStatus } from '../model/device';
import { ProfileRisk } from '../model/profile';
import { FormControlType } from '../model/question';
import { FormControlType, QuestionFormat } from '../model/question';

export const device = {
status: DeviceStatus.VALID,
Expand Down Expand Up @@ -71,55 +67,45 @@ export const MOCK_TEST_MODULES = [

export const MOCK_MODULES = ['Connection', 'Udmi'];

export const DEVICES_FORM: DeviceQuestionnaireSection[] = [
export const DEVICES_FORM: QuestionFormat[] = [
{
step: 1,
title: 'Step 1 title',
description: 'Step 1 description',
questions: [
question: 'What type of device is this?',
type: FormControlType.SELECT,
options: [
{
text: 'Building Automation Gateway',
risk: ProfileRisk.HIGH,
id: 1,
question: 'What type of device is this?',
type: FormControlType.SELECT,
options: [
{
text: 'Building Automation Gateway',
risk: ProfileRisk.HIGH,
id: 1,
},
{
text: 'IoT Gateway',
risk: ProfileRisk.LIMITED,
id: 2,
},
],
},
{
text: 'IoT Gateway',
risk: ProfileRisk.LIMITED,
id: 2,
question: 'Does your device process any sensitive information? ',
type: FormControlType.SELECT,
options: [
{
id: 1,
text: 'Yes',
risk: ProfileRisk.LIMITED,
},
{
id: 2,
text: 'No',
risk: ProfileRisk.HIGH,
},
],
},
],
},
{
question: 'Does your device process any sensitive information? ',
type: FormControlType.SELECT,
options: [
{
id: 1,
text: 'Yes',
risk: ProfileRisk.LIMITED,
},
{
id: 3,
question: 'Please select the technology this device falls into',
type: FormControlType.SELECT,
options: [
{ text: 'Hardware - Access Control' },
{ text: 'Hardware - Air quality' },
],
id: 2,
text: 'No',
risk: ProfileRisk.HIGH,
},
],
},
{
question: 'Please select the technology this device falls into',
type: FormControlType.SELECT,
options: [
{ text: 'Hardware - Access Control' },
{ text: 'Hardware - Air quality' },
],
},
];
12 changes: 0 additions & 12 deletions modules/ui/src/app/model/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { QuestionFormat } from './question';
import { Question } from './profile';

export interface Device {
Expand Down Expand Up @@ -57,17 +56,6 @@ export enum DeviceView {
WithActions = 'with actions',
}

export interface DeviceQuestionnaireSection {
step: number;
title?: string;
description?: string;
questions: QuestionnaireFormat[];
}

export interface QuestionnaireFormat extends QuestionFormat {
id: number;
}

export enum TestingType {
Pilot = 'Pilot Assessment',
Qualification = 'Device Qualification',
Expand Down
Loading
Loading