Skip to content

Commit

Permalink
bug(policy): 970 fix hidden right operand
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mmaul committed Jul 10, 2024
1 parent 8224cb0 commit d686be1
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
### Changed
- #1173 Update IRS-Helm from 7.1.4 to 7.2.0 - updated Compatibility Matrix
- #1082 fix duplicate key errors when synchronizing assets with IRS
- #970 fixed bug where the right operand of policies was not showing up in table and detailed view

## [12.0.0 - 05.07.2024]

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/mocks/services/policy-mock/policy.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,28 +187,28 @@ export const MockPolicyResponseMap: PolicyResponseMap = {
'operator': {
'@id': OperatorType.EQ,
},
'odrl:rightOperand': 'traceability:1.0',
'rightOperand': 'traceability:1.0',
},
{
'leftOperand': 'cx-policy:FrameworkAgreement',
'operator': {
'@id': OperatorType.EQ,
},
'odrl:rightOperand': 'traceability:1.0',
'rightOperand': 'traceability:1.0',
},
{
'leftOperand': 'cx-policy:FrameworkAgreement',
'operator': {
'@id': OperatorType.EQ,
},
'odrl:rightOperand': 'traceability:1.0',
'rightOperand': 'traceability:1.0',
},
{
'leftOperand': 'cx-policy:FrameworkAgreement',
'operator': {
'@id': OperatorType.EQ,
},
'odrl:rightOperand': 'traceability:1.0',
'rightOperand': 'traceability:1.0',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const mockPolicy: Policy = {
leftOperand: 'left1',
operator: { '@id': OperatorType.EQ },
operatorTypeResponse: OperatorType.EQ,
'odrl:rightOperand': 'right1',
'rightOperand': 'right1',
},
],
or: [
{
leftOperand: 'left2',
operator: { '@id': OperatorType.NEQ },
operatorTypeResponse: OperatorType.NEQ,
'odrl:rightOperand': 'right2',
'rightOperand': 'right2',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export class PoliciesAssembler {
permission.constraint?.and?.forEach((andConstraint, index) => {
constrainsList.push(andConstraint.leftOperand);
constrainsList.push(getOperatorTypeSign(OperatorType[andConstraint.operator['@id'].toUpperCase()]));
constrainsList.push(andConstraint['odrl:rightOperand']);
constrainsList.push(andConstraint.rightOperand);
if (index !== permission.constraint.and.length - 1) {
constrainsList.push('*AND ');
}
});
permission.constraint?.or?.forEach((orConstraint, index) => {
constrainsList.push(orConstraint.leftOperand);
constrainsList.push(getOperatorTypeSign(OperatorType[orConstraint.operator['@id'].toUpperCase()]));
constrainsList.push(orConstraint['odrl:rightOperand']);
constrainsList.push(orConstraint.rightOperand);
if (index !== permission.constraint.or.length - 1) {
constrainsList.push('*OR ');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ describe('PolicyEditorComponent', () => {
leftOperand: 'left1',
operator: { '@id': OperatorType.EQ },
operatorTypeResponse: OperatorType.EQ,
'odrl:rightOperand': 'right1',
'rightOperand': 'right1',
},
],
or: [
{
leftOperand: 'left2',
operator: { '@id': OperatorType.NEQ },
operatorTypeResponse: OperatorType.NEQ,
'odrl:rightOperand': 'right2',
'rightOperand': 'right2',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export interface PolicyConstraint {
operator?: { '@id': OperatorType };
'odrl:operator'?: { '@id': OperatorType };
rightOperand?: string;
'odrl:rightOperand'?: string;
}

export enum OperatorType {
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/app/modules/shared/service/policy.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ describe('PolicyService', () => {
leftOperand: 'left1',
operator: { '@id': OperatorType.EQ },
operatorTypeResponse: OperatorType.EQ,
'odrl:rightOperand': 'right1',
'rightOperand': 'right1',
},
],
or: [
{
leftOperand: 'left2',
operator: { '@id': OperatorType.NEQ },
operatorTypeResponse: OperatorType.NEQ,
'odrl:rightOperand': 'right2',
'rightOperand': 'right2',
},
],
},
Expand Down Expand Up @@ -154,15 +154,15 @@ describe('PolicyService', () => {
leftOperand: 'left1',
operator: { '@id': OperatorType.EQ },
operatorTypeResponse: OperatorType.EQ,
'odrl:rightOperand': 'right1',
'rightOperand': 'right1',
},
],
or: [
{
leftOperand: 'left2',
operator: { '@id': OperatorType.NEQ },
operatorTypeResponse: OperatorType.NEQ,
'odrl:rightOperand': 'right2',
'rightOperand': 'right2',
},
],
},
Expand Down Expand Up @@ -206,15 +206,15 @@ describe('PolicyService', () => {
leftOperand: 'left1',
operator: { '@id': OperatorType.EQ },
operatorTypeResponse: OperatorType.EQ,
'odrl:rightOperand': 'right1',
'rightOperand': 'right1',
},
],
or: [
{
leftOperand: 'left2',
operator: { '@id': OperatorType.NEQ },
operatorTypeResponse: OperatorType.NEQ,
'odrl:rightOperand': 'right2',
'rightOperand': 'right2',
},
],
},
Expand Down

0 comments on commit d686be1

Please sign in to comment.