Skip to content
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

BUG - Annotations Not Generated in CAP Project When addAnnotation is Enabled with In-Memory FS #2890

Open
3 tasks
kjose90 opened this issue Feb 7, 2025 · 0 comments
Assignees

Comments

@kjose90
Copy link
Member

kjose90 commented Feb 7, 2025

Description

In generating annotations for a CAP Project when addAnnotation is enabled and an in-memory file system is passed, annotations fail to be added. This issue originated from PR #2849.

To resolve this, changes need to be made in @sap-ux/fiori-annotation-api to support an optional in-memory file system. This will ensure that CAP files are correctly identified and annotations are written as expected.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a Fiori LROP Project
  2. Choose a CAP Project as data source
  3. Complete the project generation process.
  4. Observe that annotations are not added to the app/project/annotation.cds file.

Expected results

Annotations added correctly to annotation.cds file

using IncidentsService as service from '../../srv/incidents-service';

annotate service.Incidents with @(
    UI.LineItem : [
        {
            $Type : 'UI.DataField',
            Value : title,
        },
        {
            $Type : 'UI.DataField',
            Label : 'urgency_code',
            Value : urgency_code,
        },
        {
            $Type : 'UI.DataField',
            Label : 'status_code',
            Value : status_code,
        },
    ]
);
annotate service.Incidents with @(
    UI.FieldGroup #GeneratedGroup1 : {
        $Type : 'UI.FieldGroupType',
        Data : [
            {
                $Type : 'UI.DataField',
                Value : title,
            },
            {
                $Type : 'UI.DataField',
                Label : 'urgency_code',
                Value : urgency_code,
            },
            {
                $Type : 'UI.DataField',
                Label : 'status_code',
                Value : status_code,
            },
        ],
    },
    UI.Facets : [
        {
            $Type : 'UI.ReferenceFacet',
            ID : 'GeneratedFacet1',
            Label : 'General Information',
            Target : '@UI.FieldGroup#GeneratedGroup1',
        },
    ]
);

Actual results

Annotations not added correctly to annotation.cds file

using IncidentsService as service from '../../srv/incidents-service';

Screenshots

If applicable, add screenshots to help explain the problem.

Version/Components/Environment

Add any other context about the problem here
OS:

  • Mac OS
  • Windows
  • Other

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant