@@ -22,31 +22,32 @@ import { ifDefined } from "lit/directives/if-defined.js";
2222
2323import PFContent from "@patternfly/patternfly/components/Content/content.css" ;
2424
25- enum blueprintSource {
26- file = "file" ,
27- oci = "oci" ,
28- internal = "internal" ,
25+ enum BlueprintSource {
26+ File = "file" ,
27+ OCI = "oci" ,
28+ Internal = "internal" ,
2929}
3030
3131@customElement ( "ak-blueprint-form" )
3232export class BlueprintForm extends ModelForm < BlueprintInstance , string > {
3333 @state ( )
34- source : blueprintSource = blueprintSource . file ;
34+ protected source : BlueprintSource = BlueprintSource . File ;
3535
36- reset ( ) : void {
36+ public override reset ( ) : void {
3737 super . reset ( ) ;
38- this . source = blueprintSource . file ;
38+
39+ this . source = BlueprintSource . File ;
3940 }
4041
4142 async loadInstance ( pk : string ) : Promise < BlueprintInstance > {
4243 const inst = await new ManagedApi ( DEFAULT_CONFIG ) . managedBlueprintsRetrieve ( {
4344 instanceUuid : pk ,
4445 } ) ;
4546 if ( inst . path ?. startsWith ( "oci://" ) ) {
46- this . source = blueprintSource . oci ;
47+ this . source = BlueprintSource . OCI ;
4748 }
4849 if ( inst . content !== "" ) {
49- this . source = blueprintSource . internal ;
50+ this . source = BlueprintSource . Internal ;
5051 }
5152 return inst ;
5253 }
@@ -91,17 +92,17 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
9192 < div class ="pf-c-card__body ">
9293 < ak-toggle-group
9394 value =${ this . source }
94- @ak-toggle =${ ( ev : CustomEvent < { value : blueprintSource } > ) => {
95+ @ak-toggle =${ ( ev : CustomEvent < { value : BlueprintSource } > ) => {
9596 this . source = ev . detail . value ;
9697 } }
9798 >
98- < option value =${ blueprintSource . file } > ${ msg ( "Local path" ) } </ option >
99- < option value =${ blueprintSource . oci } > ${ msg ( "OCI Registry" ) } </ option >
100- < option value =${ blueprintSource . internal } > ${ msg ( "Internal" ) } </ option >
99+ < option value =${ BlueprintSource . File } > ${ msg ( "Local path" ) } </ option >
100+ < option value =${ BlueprintSource . OCI } > ${ msg ( "OCI Registry" ) } </ option >
101+ < option value =${ BlueprintSource . Internal } > ${ msg ( "Internal" ) } </ option >
101102 </ ak-toggle-group >
102103 </ div >
103104 < div class ="pf-c-card__footer ">
104- ${ this . source === blueprintSource . file
105+ ${ this . source === BlueprintSource . File
105106 ? html `< ak-form-element-horizontal label =${ msg ( "Path" ) } name ="path">
106107 < ak-search-select
107108 .fetchObjects =${ async (
@@ -132,7 +133,7 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
132133 </ ak-search-select >
133134 </ ak-form-element-horizontal > `
134135 : nothing }
135- ${ this . source === blueprintSource . oci
136+ ${ this . source === BlueprintSource . OCI
136137 ? html ` < ak-text-input
137138 name ="path "
138139 label =${ msg ( "OCI URL" ) }
@@ -164,7 +165,7 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
164165 >
165166 </ ak-text-input > `
166167 : nothing }
167- ${ this . source === blueprintSource . internal
168+ ${ this . source === BlueprintSource . Internal
168169 ? html `< ak-form-element-horizontal label =${ msg ( "Blueprint" ) } name ="content">
169170 < ak-codemirror
170171 mode ="yaml "
0 commit comments