generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: compile error when new .cds files are added to memfs
- Loading branch information
Showing
13 changed files
with
322 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sap-ux/fiori-annotation-api': patch | ||
--- | ||
|
||
Fixed CDS compile error when new .cds files are created in memfs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
packages/fiori-annotation-api/test/data/cds/cap-no-apps/db/schema.cds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
namespace scp.cloud; | ||
|
||
using { | ||
managed, | ||
cuid, | ||
sap.common | ||
} from '@sap/cds/common'; | ||
|
||
type Url : String; | ||
|
||
type TechnicalBooleanFlag : Boolean @( | ||
UI.Hidden, | ||
Core.Computed | ||
); | ||
type Criticality : Integer @( | ||
UI.Hidden, | ||
Core.Computed | ||
); | ||
|
||
type Identifier : String(100)@(title : 'Identifier'); | ||
@cds.autoexpose | ||
abstract entity identified : cuid { | ||
identifier : Identifier not null; | ||
} | ||
|
||
//Bolded display of first table column values can be achieved by defining annotations Common.SemanticKey and | ||
//Common.TextArrangement for the entities key and referring to a 'human-readable' identifier to be displayed instead. | ||
|
||
annotate identified with @( | ||
Common.SemanticKey : [identifier], | ||
UI.Identification : [{Value : identifier}] | ||
) { | ||
|
||
ID @Common : { | ||
Text : identifier, | ||
TextArrangement : #TextOnly | ||
|
||
}; | ||
} | ||
entity Incidents : managed, identified { | ||
title : String(50) @title : '{i18n>Title}'; | ||
category : Association to one Category @title : '{i18n>Category}'; | ||
priority : Association to one Priority @title : '{i18n>Priority}'; | ||
incidentStatus : Association to one IncidentStatus @title : '{i18n>IncidentStatus}'; | ||
description : String(1000) @title : '{i18n>IncidentDescription}'; | ||
assignedIndividual : Association to one Individual; | ||
incidentFlow : Association to many IncidentFlow | ||
on incidentFlow.incident = $self; | ||
incidentProcessTimeline : Association to many IncidentProcessTimeline | ||
on incidentProcessTimeline.incident = $self; | ||
processingThreshold : Association to one ProcessingThreshold | ||
on processingThreshold.incident = $self; | ||
} | ||
|
||
entity ProcessingThreshold { | ||
key id : String(10); | ||
processingDays : Integer; | ||
processingLimit : Integer; | ||
incident : Association to one Incidents; | ||
} | ||
entity IncidentFlow : managed { | ||
key id : UUID; | ||
processStep : String(30)@title : '{i18n>ProcessStep}'; | ||
stepStatus : String(10)@title : '{i18n>ProcessStepStatus}'; | ||
criticality : Integer; | ||
stepStartDate : Date @title : '{i18n>StepStartDate}'; | ||
stepEndDate : Date @title : '{i18n>StepEndDate}'; | ||
incident : Association to Incidents; | ||
} | ||
|
||
entity IncidentProcessTimeline : managed { | ||
key id : UUID; | ||
text : String; | ||
type : String; | ||
startTime : DateTime; | ||
endTime : DateTime; | ||
incident : Association to Incidents; | ||
} | ||
|
||
entity Individual : managed { | ||
key id : UUID; | ||
//Begin add additional properties | ||
businessPartnerID : String; | ||
addressID : String; | ||
//End add additional properties | ||
Incidents : Association to many Incidents | ||
on Incidents.assignedIndividual = $self; | ||
} | ||
|
||
entity IncidentsCodeList : common.CodeList { | ||
key code : String(20); | ||
} | ||
|
||
entity Category : IncidentsCodeList {} | ||
|
||
entity Priority : IncidentsCodeList { | ||
criticality : Criticality not null default 3; | ||
} | ||
|
||
entity IncidentStatus : IncidentsCodeList {} |
26 changes: 26 additions & 0 deletions
26
packages/fiori-annotation-api/test/data/cds/cap-no-apps/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "teched2020-iis360", | ||
"version": "1.0.0", | ||
"description": "A simple CAP project.", | ||
"repository": "<Add your repository here>", | ||
"license": "UNLICENSED", | ||
"private": true, | ||
"dependencies": { | ||
"@sap/cds": "6.7.0" | ||
}, | ||
"devDependencies": {}, | ||
"cds": { | ||
"requires": { | ||
"db": { | ||
"kind": "sql" | ||
} | ||
}, | ||
"odata": { | ||
"version": "v4" | ||
} | ||
}, | ||
"scripts": { | ||
"start": "cds run" | ||
}, | ||
"sapux": [] | ||
} |
94 changes: 94 additions & 0 deletions
94
packages/fiori-annotation-api/test/data/cds/cap-no-apps/srv/common.cds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
namespace scp.cloud; | ||
using IncidentService as service from './incidentservice'; | ||
|
||
using { | ||
cuid | ||
} from '@sap/cds/common'; | ||
|
||
annotate cuid with { | ||
ID @( | ||
title : '{i18n>ID}', | ||
UI.HiddenFilter, | ||
Core.Computed | ||
); | ||
} | ||
|
||
|
||
annotate service.Incidents with { | ||
ID @UI.Hidden: true; | ||
assignedIndividual @UI.Hidden : true; | ||
}; | ||
|
||
annotate service.Incidents with { | ||
incidentStatus @Common : { | ||
Text : incidentStatus.code, | ||
TextArrangement : #TextOnly, | ||
ValueListWithFixedValues | ||
}; | ||
category @Common : { | ||
Text : category.code, | ||
TextArrangement : #TextOnly, | ||
ValueListWithFixedValues | ||
}; | ||
priority @Common : { | ||
Text : priority.code, | ||
TextArrangement : #TextOnly, | ||
ValueListWithFixedValues | ||
}; | ||
}; | ||
|
||
annotate service.Category with { | ||
code @Common : { | ||
Text : name, | ||
TextArrangement : #TextOnly | ||
} @title : '{i18n>Category}' | ||
}; | ||
|
||
annotate service.Priority with { | ||
code @Common : { | ||
Text : name, | ||
TextArrangement : #TextOnly | ||
} @title : '{i18n>Priority}' | ||
}; | ||
|
||
annotate service.IncidentStatus with { | ||
code @Common : { | ||
Text : name, | ||
TextArrangement : #TextOnly | ||
} @title : '{i18n>IncidentStatus}' | ||
}; | ||
|
||
annotate service.Incidents with @( | ||
Aggregation.ApplySupported : { | ||
$Type : 'Aggregation.ApplySupportedType', | ||
Transformations : [ | ||
'aggregate', | ||
'topcount', | ||
'bottomcount', | ||
'identity', | ||
'concat', | ||
'groupby', | ||
'filter', | ||
'expand', | ||
'top', | ||
'skip', | ||
'orderby', | ||
'search' | ||
], | ||
GroupableProperties : [ | ||
category_code | ||
], | ||
AggregatableProperties : [ | ||
{ | ||
$Type : 'Aggregation.AggregatablePropertyType', | ||
Property : ID | ||
} | ||
] | ||
}, | ||
Analytics.AggregatedProperties : [{ | ||
Name : 'IncidentsPerCategory', | ||
AggregationMethod : 'countdistinct', | ||
AggregatableProperty : ID, | ||
![@Common.Label] : '{i18n>IncidentsPerCategory}' | ||
}] | ||
); |
19 changes: 19 additions & 0 deletions
19
packages/fiori-annotation-api/test/data/cds/cap-no-apps/srv/incidentservice.cds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using scp.cloud from '../db/schema'; | ||
|
||
service IncidentService { | ||
|
||
entity Incidents as projection on cloud.Incidents; | ||
|
||
entity IncidentFlow as projection on cloud.IncidentFlow; | ||
|
||
entity IncidentProcessTimeline as projection on cloud.IncidentProcessTimeline; | ||
|
||
entity ProcessingThreshold as projection on cloud.ProcessingThreshold; | ||
|
||
entity Individual as projection on cloud.Individual; | ||
|
||
entity Category as projection on cloud.Category; | ||
|
||
entity Priority as projection on cloud.Priority; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.