Skip to content

Commit

Permalink
add login error setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym Veres authored and Maksym Veres committed Jan 5, 2024
1 parent 13b4e2e commit b24ed97
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/scenarioserver/scenarioserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ func (s ScenarioServer) prepareScenario(scenario hfv1.Scenario, printable bool)
ps.Pauseable = scenario.Spec.Pauseable
ps.Printable = printable
ps.StepCount = len(scenario.Spec.Steps)
ps.ManagedBy = scenario.Labels["managed-by"]

ps.ManagedBy = "hobbyfarm"
if scenario.Labels["managed-by"] != "" {
ps.ManagedBy = scenario.Labels["managed-by"]
}
return ps, nil
}

Expand Down
1 change: 1 addition & 0 deletions pkg/setting/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
ImprintLink SettingName = "imprint-link"
ImprintLinkName SettingName = "imprint-linkname"
AboutModalButtons SettingName = "aboutmodal-buttons"
LoginSettingErrorMessage SettingName = "login-error-message"
)

var DataTypeMappingToProto = map[property.DataType]settingProto.DataType{
Expand Down
13 changes: 13 additions & 0 deletions services/settingsvc/internal/preinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,18 @@ func predefinedSettings() []*settingProto.CreateSettingRequest {
DisplayName: "Strict AccessCode Validation",
},
},
{
Name: string(settingUtil.LoginSettingErrorMessage),
Namespace: util.GetReleaseNamespace(),
Labels: map[string]string{
labels.SettingScope: "public",
},
Value: "",
Property: &settingProto.Property{
DataType: settingProto.DataType_DATA_TYPE_STRING,
ValueType: settingProto.ValueType_VALUE_TYPE_SCALAR,
DisplayName: "Login Error Message",
},
},
}
}

0 comments on commit b24ed97

Please sign in to comment.