Skip to content

Commit

Permalink
rename Split to SplitScreen for login page layout (#15)
Browse files Browse the repository at this point in the history
* rename Split to SplitScreen for login page layout

* update docs
  • Loading branch information
mrmauer authored Oct 3, 2024
1 parent 6640890 commit b551880
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/resources/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Optional:
- `frame_text_color` (String) The color of the text within the frame in the login page. If the the `layout` is `Frameless`, this color is applied to text within input components on the page. The default value is `#0f0f0f`
- `gradient_background_parameters` (Attributes) The parameters required for a gradient background in the login page (see [below for nested schema](#nestedatt--login_page_theme--gradient_background_parameters))
- `image_background_parameters` (Attributes) The parameters required for an image background in the login page (see [below for nested schema](#nestedatt--login_page_theme--image_background_parameters))
- `layout` (String) The layout of the login page. Options include `Frame`, `Frameless`, and `Split`. The default value is `Frame`
- `layout` (String) The layout of the login page. Options include `Frame`, `Frameless`, and `SplitScreen`. The default value is `Frame`
- `primary_color` (String) The primary color of action buttons and links in the login page. The default value is `#50c878`
- `primary_text_color` (String) The color of the text on action buttons in the login page. The default value is `#f7f7f7`
- `solid_background_parameters` (Attributes) The parameters required for a solid background in the login page (see [below for nested schema](#nestedatt--login_page_theme--solid_background_parameters))
Expand Down
12 changes: 6 additions & 6 deletions internal/provider/theme_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ func (r *themeResource) Schema(ctx context.Context, req resource.SchemaRequest,
Computed: true,
Default: stringdefault.StaticString("Frame"),
Validators: []validator.String{
stringvalidator.OneOf("Frame", "Frameless", "Split"),
stringvalidator.OneOf("Frame", "Frameless", "SplitScreen"),
},
Description: "The layout of the login page. Options include `Frame`, `Frameless`, and `Split`. " +
Description: "The layout of the login page. Options include `Frame`, `Frameless`, and `SplitScreen`. " +
"The default value is `Frame`",
},
"background_type": schema.StringAttribute{
Expand Down Expand Up @@ -535,11 +535,11 @@ func (r *themeResource) ValidateConfig(ctx context.Context, req resource.Validat
}
}

if plan.LoginPageTheme.Layout.ValueString() == "Split" && plan.LoginPageTheme.SplitLoginPageParameters == nil {
if plan.LoginPageTheme.Layout.ValueString() == "SplitScreen" && plan.LoginPageTheme.SplitLoginPageParameters == nil {
resp.Diagnostics.AddAttributeError(
path.Root("login_page_theme"),
"Missing `split_login_page_parameters`",
"`Split` login page layout requires `split_login_page_parameters` to be set",
"`SplitScreen` login page layout requires `split_login_page_parameters` to be set",
)
return
}
Expand Down Expand Up @@ -687,7 +687,7 @@ func convertPlanToTheme(plan *themeResourceModel) *propelauth.Theme {
theme.BackgroundTextColor = convertHexColorToRgb(plan.LoginPageTheme.ImageBackgroundParameters.BackgroundTextColor.ValueString())
}

if plan.LoginPageTheme.Layout.ValueString() == "Split" {
if plan.LoginPageTheme.Layout.ValueString() == "SplitScreen" {
var splitscreenParams propelauth.SplitscreenParams
splitscreenParams.Direction = plan.LoginPageTheme.SplitLoginPageParameters.Direction.ValueString()
splitscreenParams.ContentType = plan.LoginPageTheme.SplitLoginPageParameters.ContentType.ValueString()
Expand Down Expand Up @@ -750,7 +750,7 @@ func updateStateFromTheme(theme propelauth.Theme, state *themeResourceModel) {
}
}

if theme.LoginLayout == "Split" {
if theme.LoginLayout == "SplitScreen" {
state.LoginPageTheme.SplitLoginPageParameters = &splitLoginPageParameters{
Direction: types.StringValue(theme.Splitscreen.Direction),
ContentType: types.StringValue(theme.Splitscreen.ContentType),
Expand Down

0 comments on commit b551880

Please sign in to comment.