New eslint rules auto fix (#3058)
* no-implicit-coercion and no-unneeded-ternary * End every line with a semicolon * Spacing and formatting * Enabled semi-spacing * Applies npm run lint:fix to code after master merge * Fix merge issues * Switched operator-linebreak to 'before' Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
@@ -42,7 +42,10 @@ describe('the plugin', function () {
|
||||
|
||||
beforeEach((done) => {
|
||||
testTelemetryObject = {
|
||||
identifier:{ namespace: "", key: "test-object"},
|
||||
identifier: {
|
||||
namespace: "",
|
||||
key: "test-object"
|
||||
},
|
||||
type: "test-object",
|
||||
name: "Test Object",
|
||||
telemetry: {
|
||||
@@ -121,7 +124,7 @@ describe('the plugin', function () {
|
||||
|
||||
it('provides a view', () => {
|
||||
const testViewObject = {
|
||||
id:"test-object",
|
||||
id: "test-object",
|
||||
type: "conditionSet",
|
||||
configuration: {
|
||||
conditionCollection: []
|
||||
@@ -143,142 +146,142 @@ describe('the plugin', function () {
|
||||
let component;
|
||||
let styleViewComponentObject;
|
||||
const conditionSetDomainObject = {
|
||||
"configuration":{
|
||||
"conditionTestData":[
|
||||
"configuration": {
|
||||
"conditionTestData": [
|
||||
{
|
||||
"telemetry":"",
|
||||
"metadata":"",
|
||||
"input":""
|
||||
"telemetry": "",
|
||||
"metadata": "",
|
||||
"input": ""
|
||||
}
|
||||
],
|
||||
"conditionCollection":[
|
||||
"conditionCollection": [
|
||||
{
|
||||
"id":"39584410-cbf9-499e-96dc-76f27e69885d",
|
||||
"configuration":{
|
||||
"name":"Unnamed Condition",
|
||||
"output":"Sine > 0",
|
||||
"trigger":"all",
|
||||
"criteria":[
|
||||
"id": "39584410-cbf9-499e-96dc-76f27e69885d",
|
||||
"configuration": {
|
||||
"name": "Unnamed Condition",
|
||||
"output": "Sine > 0",
|
||||
"trigger": "all",
|
||||
"criteria": [
|
||||
{
|
||||
"id":"85fbb2f7-7595-42bd-9767-a932266c5225",
|
||||
"telemetry":{
|
||||
"namespace":"",
|
||||
"key":"be0ba97f-b510-4f40-a18d-4ff121d5ea1a"
|
||||
"id": "85fbb2f7-7595-42bd-9767-a932266c5225",
|
||||
"telemetry": {
|
||||
"namespace": "",
|
||||
"key": "be0ba97f-b510-4f40-a18d-4ff121d5ea1a"
|
||||
},
|
||||
"operation":"greaterThan",
|
||||
"input":[
|
||||
"operation": "greaterThan",
|
||||
"input": [
|
||||
"0"
|
||||
],
|
||||
"metadata":"sin"
|
||||
"metadata": "sin"
|
||||
},
|
||||
{
|
||||
"id":"35400132-63b0-425c-ac30-8197df7d5862",
|
||||
"telemetry":"any",
|
||||
"operation":"enumValueIs",
|
||||
"input":[
|
||||
"id": "35400132-63b0-425c-ac30-8197df7d5862",
|
||||
"telemetry": "any",
|
||||
"operation": "enumValueIs",
|
||||
"input": [
|
||||
"0"
|
||||
],
|
||||
"metadata":"state"
|
||||
"metadata": "state"
|
||||
}
|
||||
]
|
||||
},
|
||||
"summary":"Match if all criteria are met: Sine Wave Generator Sine > 0 and any telemetry State is OFF "
|
||||
"summary": "Match if all criteria are met: Sine Wave Generator Sine > 0 and any telemetry State is OFF "
|
||||
},
|
||||
{
|
||||
"isDefault":true,
|
||||
"id":"2532d90a-e0d6-4935-b546-3123522da2de",
|
||||
"configuration":{
|
||||
"name":"Default",
|
||||
"output":"Default",
|
||||
"trigger":"all",
|
||||
"criteria":[
|
||||
"isDefault": true,
|
||||
"id": "2532d90a-e0d6-4935-b546-3123522da2de",
|
||||
"configuration": {
|
||||
"name": "Default",
|
||||
"output": "Default",
|
||||
"trigger": "all",
|
||||
"criteria": [
|
||||
]
|
||||
},
|
||||
"summary":""
|
||||
"summary": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"composition":[
|
||||
"composition": [
|
||||
{
|
||||
"namespace":"",
|
||||
"key":"be0ba97f-b510-4f40-a18d-4ff121d5ea1a"
|
||||
"namespace": "",
|
||||
"key": "be0ba97f-b510-4f40-a18d-4ff121d5ea1a"
|
||||
},
|
||||
{
|
||||
"namespace":"",
|
||||
"key":"077ffa67-e78f-4e99-80e0-522ac33a3888"
|
||||
"namespace": "",
|
||||
"key": "077ffa67-e78f-4e99-80e0-522ac33a3888"
|
||||
}
|
||||
],
|
||||
"telemetry":{
|
||||
"telemetry": {
|
||||
},
|
||||
"name":"Condition Set",
|
||||
"type":"conditionSet",
|
||||
"identifier":{
|
||||
"namespace":"",
|
||||
"key":"863012c1-f6ca-4ab0-aed7-fd43d5e4cd12"
|
||||
"name": "Condition Set",
|
||||
"type": "conditionSet",
|
||||
"identifier": {
|
||||
"namespace": "",
|
||||
"key": "863012c1-f6ca-4ab0-aed7-fd43d5e4cd12"
|
||||
}
|
||||
|
||||
};
|
||||
const staticStyle = {
|
||||
"style":{
|
||||
"backgroundColor":"#717171",
|
||||
"border":"1px solid #00ffff"
|
||||
"style": {
|
||||
"backgroundColor": "#717171",
|
||||
"border": "1px solid #00ffff"
|
||||
}
|
||||
};
|
||||
const conditionalStyle = {
|
||||
"conditionId":"39584410-cbf9-499e-96dc-76f27e69885d",
|
||||
"style":{
|
||||
"isStyleInvisible":"",
|
||||
"backgroundColor":"#717171",
|
||||
"border":"1px solid #ffff00"
|
||||
"conditionId": "39584410-cbf9-499e-96dc-76f27e69885d",
|
||||
"style": {
|
||||
"isStyleInvisible": "",
|
||||
"backgroundColor": "#717171",
|
||||
"border": "1px solid #ffff00"
|
||||
}
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
displayLayoutItem = {
|
||||
"composition":[
|
||||
"composition": [
|
||||
],
|
||||
"configuration":{
|
||||
"items":[
|
||||
"configuration": {
|
||||
"items": [
|
||||
{
|
||||
"fill":"#717171",
|
||||
"stroke":"",
|
||||
"x":1,
|
||||
"y":1,
|
||||
"width":10,
|
||||
"height":5,
|
||||
"type":"box-view",
|
||||
"id":"89b88746-d325-487b-aec4-11b79afff9e8"
|
||||
"fill": "#717171",
|
||||
"stroke": "",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"width": 10,
|
||||
"height": 5,
|
||||
"type": "box-view",
|
||||
"id": "89b88746-d325-487b-aec4-11b79afff9e8"
|
||||
},
|
||||
{
|
||||
"x":18,
|
||||
"y":9,
|
||||
"x2":23,
|
||||
"y2":4,
|
||||
"stroke":"#717171",
|
||||
"type":"line-view",
|
||||
"id":"57d49a28-7863-43bd-9593-6570758916f0"
|
||||
"x": 18,
|
||||
"y": 9,
|
||||
"x2": 23,
|
||||
"y2": 4,
|
||||
"stroke": "#717171",
|
||||
"type": "line-view",
|
||||
"id": "57d49a28-7863-43bd-9593-6570758916f0"
|
||||
}
|
||||
],
|
||||
"layoutGrid":[
|
||||
"layoutGrid": [
|
||||
10,
|
||||
10
|
||||
]
|
||||
},
|
||||
"name":"Display Layout",
|
||||
"type":"layout",
|
||||
"identifier":{
|
||||
"namespace":"",
|
||||
"key":"c5e636c1-6771-4c9c-b933-8665cab189b3"
|
||||
"name": "Display Layout",
|
||||
"type": "layout",
|
||||
"identifier": {
|
||||
"namespace": "",
|
||||
"key": "c5e636c1-6771-4c9c-b933-8665cab189b3"
|
||||
}
|
||||
};
|
||||
lineLayoutItem = {
|
||||
"x":18,
|
||||
"y":9,
|
||||
"x2":23,
|
||||
"y2":4,
|
||||
"stroke":"#717171",
|
||||
"type":"line-view",
|
||||
"id":"57d49a28-7863-43bd-9593-6570758916f0"
|
||||
"x": 18,
|
||||
"y": 9,
|
||||
"x2": 23,
|
||||
"y2": 4,
|
||||
"stroke": "#717171",
|
||||
"type": "line-view",
|
||||
"id": "57d49a28-7863-43bd-9593-6570758916f0"
|
||||
};
|
||||
boxLayoutItem = {
|
||||
"fill": "#717171",
|
||||
@@ -294,13 +297,13 @@ describe('the plugin', function () {
|
||||
[{
|
||||
context: {
|
||||
"layoutItem": lineLayoutItem,
|
||||
"index":1
|
||||
"index": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
context: {
|
||||
"item": displayLayoutItem,
|
||||
"supportsMultiSelect":true
|
||||
"supportsMultiSelect": true
|
||||
}
|
||||
}],
|
||||
[{
|
||||
@@ -312,7 +315,7 @@ describe('the plugin', function () {
|
||||
{
|
||||
context: {
|
||||
item: displayLayoutItem,
|
||||
"supportsMultiSelect":true
|
||||
"supportsMultiSelect": true
|
||||
}
|
||||
}]
|
||||
];
|
||||
@@ -329,6 +332,7 @@ describe('the plugin', function () {
|
||||
},
|
||||
template: '<styles-view/>'
|
||||
});
|
||||
|
||||
return Vue.nextTick().then(() => {
|
||||
styleViewComponentObject = component.$root.$children[0];
|
||||
styleViewComponentObject.setEditState(true);
|
||||
@@ -352,6 +356,7 @@ describe('the plugin', function () {
|
||||
styleViewComponentObject.initializeConditionalStyles();
|
||||
expect(styleViewComponentObject.conditionalStyles.length).toBe(2);
|
||||
styleViewComponentObject.updateConditionalStyle(conditionalStyle, 'border');
|
||||
|
||||
return Vue.nextTick().then(() => {
|
||||
expect(styleViewComponentObject.domainObject.configuration.objectStyles).toBeDefined();
|
||||
[boxLayoutItem, lineLayoutItem].forEach((item) => {
|
||||
@@ -373,6 +378,7 @@ describe('the plugin', function () {
|
||||
|
||||
it('updates applicable static styles', () => {
|
||||
styleViewComponentObject.updateStaticStyle(staticStyle, 'border');
|
||||
|
||||
return Vue.nextTick().then(() => {
|
||||
expect(styleViewComponentObject.domainObject.configuration.objectStyles).toBeDefined();
|
||||
[boxLayoutItem, lineLayoutItem].forEach((item) => {
|
||||
@@ -393,64 +399,64 @@ describe('the plugin', function () {
|
||||
describe('the condition check for staleness', () => {
|
||||
let conditionSetDomainObject;
|
||||
|
||||
beforeEach(()=>{
|
||||
beforeEach(() => {
|
||||
conditionSetDomainObject = {
|
||||
"configuration":{
|
||||
"conditionTestData":[
|
||||
"configuration": {
|
||||
"conditionTestData": [
|
||||
{
|
||||
"telemetry":"",
|
||||
"metadata":"",
|
||||
"input":""
|
||||
"telemetry": "",
|
||||
"metadata": "",
|
||||
"input": ""
|
||||
}
|
||||
],
|
||||
"conditionCollection":[
|
||||
"conditionCollection": [
|
||||
{
|
||||
"id":"39584410-cbf9-499e-96dc-76f27e69885d",
|
||||
"configuration":{
|
||||
"name":"Unnamed Condition",
|
||||
"output":"Any stale telemetry",
|
||||
"trigger":"all",
|
||||
"criteria":[
|
||||
"id": "39584410-cbf9-499e-96dc-76f27e69885d",
|
||||
"configuration": {
|
||||
"name": "Unnamed Condition",
|
||||
"output": "Any stale telemetry",
|
||||
"trigger": "all",
|
||||
"criteria": [
|
||||
{
|
||||
"id":"35400132-63b0-425c-ac30-8197df7d5862",
|
||||
"telemetry":"any",
|
||||
"operation":"isStale",
|
||||
"input":[
|
||||
"id": "35400132-63b0-425c-ac30-8197df7d5862",
|
||||
"telemetry": "any",
|
||||
"operation": "isStale",
|
||||
"input": [
|
||||
"1"
|
||||
],
|
||||
"metadata":"dataReceived"
|
||||
"metadata": "dataReceived"
|
||||
}
|
||||
]
|
||||
},
|
||||
"summary":"Match if all criteria are met: Any telemetry is stale after 5 seconds"
|
||||
"summary": "Match if all criteria are met: Any telemetry is stale after 5 seconds"
|
||||
},
|
||||
{
|
||||
"isDefault":true,
|
||||
"id":"2532d90a-e0d6-4935-b546-3123522da2de",
|
||||
"configuration":{
|
||||
"name":"Default",
|
||||
"output":"Default",
|
||||
"trigger":"all",
|
||||
"criteria":[
|
||||
"isDefault": true,
|
||||
"id": "2532d90a-e0d6-4935-b546-3123522da2de",
|
||||
"configuration": {
|
||||
"name": "Default",
|
||||
"output": "Default",
|
||||
"trigger": "all",
|
||||
"criteria": [
|
||||
]
|
||||
},
|
||||
"summary":""
|
||||
"summary": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"composition":[
|
||||
"composition": [
|
||||
{
|
||||
"namespace":"",
|
||||
"key":"test-object"
|
||||
"namespace": "",
|
||||
"key": "test-object"
|
||||
}
|
||||
],
|
||||
"telemetry":{
|
||||
"telemetry": {
|
||||
},
|
||||
"name":"Condition Set",
|
||||
"type":"conditionSet",
|
||||
"identifier":{
|
||||
"namespace":"",
|
||||
"key":"cf4456a9-296a-4e6b-b182-62ed29cd15b9"
|
||||
"name": "Condition Set",
|
||||
"type": "conditionSet",
|
||||
"identifier": {
|
||||
"namespace": "",
|
||||
"key": "cf4456a9-296a-4e6b-b182-62ed29cd15b9"
|
||||
}
|
||||
|
||||
};
|
||||
@@ -467,7 +473,10 @@ describe('the plugin', function () {
|
||||
setTimeout(() => {
|
||||
expect(mockListener).toHaveBeenCalledWith({
|
||||
output: 'Any stale telemetry',
|
||||
id: { namespace: '', key: 'cf4456a9-296a-4e6b-b182-62ed29cd15b9' },
|
||||
id: {
|
||||
namespace: '',
|
||||
key: 'cf4456a9-296a-4e6b-b182-62ed29cd15b9'
|
||||
},
|
||||
conditionId: '39584410-cbf9-499e-96dc-76f27e69885d',
|
||||
utc: undefined
|
||||
});
|
||||
@@ -490,7 +499,10 @@ describe('the plugin', function () {
|
||||
setTimeout(() => {
|
||||
expect(mockListener).toHaveBeenCalledWith({
|
||||
output: 'Default',
|
||||
id: { namespace: '', key: 'cf4456a9-296a-4e6b-b182-62ed29cd15b9' },
|
||||
id: {
|
||||
namespace: '',
|
||||
key: 'cf4456a9-296a-4e6b-b182-62ed29cd15b9'
|
||||
},
|
||||
conditionId: '2532d90a-e0d6-4935-b546-3123522da2de',
|
||||
utc: undefined
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user