@@ -928,23 +928,43 @@ export class CliActions {
928
928
* Sets the form customizer for a content type on a list.
929
929
*/
930
930
public static async setFormCustomizer ( ) {
931
- const siteUrl = await window . showInputBox ( {
932
- prompt : 'Enter the site URL' ,
931
+ const relativeUrl = await window . showInputBox ( {
932
+ prompt : 'Enter the relative URL of the site ' ,
933
933
ignoreFocusOut : true ,
934
- validateInput : ( value ) => value ? undefined : 'Site URL is required'
934
+ placeHolder : 'e.g., sites/sales' ,
935
+ validateInput : ( input ) => {
936
+ if ( ! input ) {
937
+ return 'site URL is required' ;
938
+ }
939
+
940
+ const trimmedInput = input . trim ( ) ;
941
+
942
+ if ( trimmedInput . startsWith ( 'https://' ) ) {
943
+ return 'Please provide a relative URL, not an absolute URL.' ;
944
+ }
945
+ if ( trimmedInput . startsWith ( '/' ) ) {
946
+ return 'Please provide a relative URL without a leading slash.' ;
947
+ }
948
+
949
+ return undefined ;
950
+ }
935
951
} ) ;
936
952
937
- if ( ! siteUrl ) {
953
+ if ( relativeUrl === undefined ) {
954
+ Notifications . warning ( 'No site URL provided. Setting form customizer aborted.' ) ;
938
955
return ;
939
956
}
940
957
958
+ const siteUrl = `${ EnvironmentInformation . tenantUrl } /${ relativeUrl . trim ( ) } ` ;
959
+
941
960
const listTitle = await window . showInputBox ( {
942
961
prompt : 'Enter the list title' ,
943
962
ignoreFocusOut : true ,
944
963
validateInput : ( value ) => value ? undefined : 'List title is required'
945
964
} ) ;
946
965
947
966
if ( ! listTitle ) {
967
+ Notifications . warning ( 'No list title provided. Setting form customizer aborted.' ) ;
948
968
return ;
949
969
}
950
970
@@ -955,21 +975,22 @@ export class CliActions {
955
975
} ) ;
956
976
957
977
if ( ! contentType ) {
978
+ Notifications . warning ( 'No content type name provided. Setting form customizer aborted.' ) ;
958
979
return ;
959
980
}
960
981
961
982
const editFormClientSideComponentId = await window . showInputBox ( {
962
- prompt : 'Enter the Edit form customizer (leave empty to skip)' ,
983
+ prompt : 'Enter the Edit form customizer ID (leave empty to skip)' ,
963
984
ignoreFocusOut : true
964
985
} ) ;
965
986
966
- const newFormClientSideComponentId = await window . showInputBox ( {
967
- prompt : 'Enter the New form customizer (leave empty to skip)' ,
987
+ const newFormClientSideComponentId = await window . showInputBox ( {
988
+ prompt : 'Enter the New form customizer ID (leave empty to skip)' ,
968
989
ignoreFocusOut : true
969
990
} ) ;
970
991
971
992
const displayFormClientSideComponentId = await window . showInputBox ( {
972
- prompt : 'Enter the View form customizer (leave empty to skip)' ,
993
+ prompt : 'Enter the View form customizer ID (leave empty to skip)' ,
973
994
ignoreFocusOut : true
974
995
} ) ;
975
996
@@ -984,7 +1005,7 @@ export class CliActions {
984
1005
}
985
1006
986
1007
if ( newFormClientSideComponentId ) {
987
- commandOptions . newFormCustomizer = newFormClientSideComponentId ;
1008
+ commandOptions . NewFormClientSideComponentId = newFormClientSideComponentId ;
988
1009
}
989
1010
990
1011
if ( displayFormClientSideComponentId ) {
0 commit comments