@@ -17,7 +17,7 @@ import {
1717} from '../types' ;
1818import { AuthenticationType , type BackendSystem } from '@sap-ux/store' ;
1919import type { ChoiceOptions , ListChoiceOptions } from 'inquirer' ;
20- import { getSystemDisplayName } from '@sap-ux/fiori-generator-shared' ;
20+ import { getBackendSystemDisplayName , getSystemDisplayName } from '@sap-ux/fiori-generator-shared' ;
2121import type { AbapServiceProvider } from '@sap-ux/axios-extension' ;
2222
2323/**
@@ -40,32 +40,6 @@ function getDestinationChoices(destinations: Destinations = {}): AbapSystemChoic
4040 return systemChoices ;
4141}
4242
43- /**
44- * Returns the display name for the backend system.
45- *
46- * @param options options for display name
47- * @param options.backendSystem backend system
48- * @param options.includeUserName include user name in the display name
49- * @returns backend display name
50- */
51- function getBackendDisplayName ( {
52- backendSystem,
53- includeUserName = true
54- } : {
55- backendSystem : BackendSystem ;
56- includeUserName ?: boolean ;
57- } ) : string {
58- const userDisplayName = includeUserName && backendSystem . userDisplayName ? `${ backendSystem . userDisplayName } ` : '' ;
59- const systemDisplayName = getSystemDisplayName (
60- backendSystem . name ,
61- userDisplayName ,
62- ! ! backendSystem . serviceKeys ,
63- backendSystem . authenticationType === AuthenticationType . ReentranceTicket
64- ) ;
65-
66- return systemDisplayName ;
67- }
68-
6943/**
7044 * Returns a list of backend system choices.
7145 *
@@ -102,12 +76,12 @@ async function getBackendTargetChoices(
10276 }
10377 return {
10478 name : isDefault
105- ? `${ getBackendDisplayName ( { backendSystem : system } ) } (Source system)`
106- : getBackendDisplayName ( { backendSystem : system } ) ?? '' ,
79+ ? `${ getBackendSystemDisplayName ( system ) } (Source system)`
80+ : getBackendSystemDisplayName ( system ) ?? '' ,
10781 value : system . url ,
10882 isDefault,
109- scp : ! ! system . serviceKeys ,
110- isS4HC : system . authenticationType === AuthenticationType . ReentranceTicket ,
83+ scp : ! ! system . serviceKeys , // legacy service key store entries
84+ isAbapCloud : system . authenticationType === AuthenticationType . ReentranceTicket ,
11185 client : system . client
11286 } ;
11387 } ) ;
@@ -123,13 +97,14 @@ async function getBackendTargetChoices(
12397 name : `${ getSystemDisplayName (
12498 systemName ,
12599 user ,
126- target . scp ,
127- target . authenticationType === AuthenticationType . ReentranceTicket
100+ target . scp || target . authenticationType === AuthenticationType . ReentranceTicket
101+ ? 'ABAPCloud'
102+ : undefined // scp is retained for legacy apps yamls that contain this value
128103 ) } (Source system)`,
129104 value : target . url ,
130105 isDefault : true ,
131106 scp : target . scp ,
132- isS4HC : target . authenticationType === AuthenticationType . ReentranceTicket ,
107+ isAbapCloud : target . authenticationType === AuthenticationType . ReentranceTicket ,
133108 client : target . client
134109 } ) ;
135110 }
0 commit comments