Skip to content

Commit

Permalink
feat: improve sorting of ui fields
Browse files Browse the repository at this point in the history
See #1196
  • Loading branch information
aeneasr committed Apr 9, 2021
1 parent cb670a8 commit 797b49d
Show file tree
Hide file tree
Showing 64 changed files with 1,036 additions and 210 deletions.
3 changes: 2 additions & 1 deletion cmd/daemon/serve.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package daemon

import (
"github.com/ory/kratos/selfservice/flow/recovery"
"net/http"
"strings"
"sync"

"github.com/ory/kratos/selfservice/flow/recovery"

"github.com/ory/x/reqlog"

"github.com/ory/kratos/cmd/courier"
Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
5.1.0
20 changes: 10 additions & 10 deletions internal/httpclient/docs/AdminApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Name | Type | Description | Notes

### Return type

[**RecoveryLink**](recoveryLink.md)
[**RecoveryLink**](RecoveryLink.md)

### Authorization

Expand Down Expand Up @@ -414,7 +414,7 @@ Name | Type | Description | Notes

### Return type

[**ErrorContainer**](errorContainer.md)
[**ErrorContainer**](ErrorContainer.md)

### Authorization

Expand Down Expand Up @@ -480,7 +480,7 @@ Name | Type | Description | Notes

### Return type

[**LoginFlow**](loginFlow.md)
[**LoginFlow**](LoginFlow.md)

### Authorization

Expand Down Expand Up @@ -546,7 +546,7 @@ Name | Type | Description | Notes

### Return type

[**RecoveryFlow**](recoveryFlow.md)
[**RecoveryFlow**](RecoveryFlow.md)

### Authorization

Expand Down Expand Up @@ -612,7 +612,7 @@ Name | Type | Description | Notes

### Return type

[**RegistrationFlow**](registrationFlow.md)
[**RegistrationFlow**](RegistrationFlow.md)

### Authorization

Expand Down Expand Up @@ -678,7 +678,7 @@ Name | Type | Description | Notes

### Return type

[**SettingsFlow**](settingsFlow.md)
[**SettingsFlow**](SettingsFlow.md)

### Authorization

Expand Down Expand Up @@ -744,7 +744,7 @@ Name | Type | Description | Notes

### Return type

[**VerificationFlow**](verificationFlow.md)
[**VerificationFlow**](VerificationFlow.md)

### Authorization

Expand Down Expand Up @@ -805,7 +805,7 @@ Other parameters are passed through a pointer to a apiGetVersionRequest struct v

### Return type

[**InlineResponse2001**](inline_response_200_1.md)
[**InlineResponse2001**](InlineResponse2001.md)

### Authorization

Expand Down Expand Up @@ -866,7 +866,7 @@ Other parameters are passed through a pointer to a apiIsAliveRequest struct via

### Return type

[**InlineResponse200**](inline_response_200.md)
[**InlineResponse200**](InlineResponse200.md)

### Authorization

Expand Down Expand Up @@ -927,7 +927,7 @@ Other parameters are passed through a pointer to a apiIsReadyRequest struct via

### Return type

[**InlineResponse200**](inline_response_200.md)
[**InlineResponse200**](InlineResponse200.md)

### Authorization

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/GenericError.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Error** | Pointer to [**GenericErrorPayload**](genericErrorPayload.md) | | [optional]
**Error** | Pointer to [**GenericErrorPayload**](GenericErrorPayload.md) | | [optional]

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/LoginFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**IssuedAt** | **time.Time** | IssuedAt is the time (UTC) when the flow started. |
**RequestUrl** | **string** | RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example. |
**Type** | **string** | The flow type can either be `api` or `browser`. |
**Ui** | [**UiContainer**](uiContainer.md) | |
**Ui** | [**UiContainer**](UiContainer.md) | |

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/LoginViaApiResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Session** | [**Session**](session.md) | |
**Session** | [**Session**](Session.md) | |
**SessionToken** | **string** | The Session Token A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization Header: Authorization: bearer ${session-token} The session token is only issued for API flows, not for Browser flows! |

## Methods
Expand Down
30 changes: 15 additions & 15 deletions internal/httpclient/docs/PublicApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Name | Type | Description | Notes

### Return type

[**SettingsViaApiResponse**](settingsViaApiResponse.md)
[**SettingsViaApiResponse**](SettingsViaApiResponse.md)

### Authorization

Expand Down Expand Up @@ -405,7 +405,7 @@ Name | Type | Description | Notes

### Return type

[**ErrorContainer**](errorContainer.md)
[**ErrorContainer**](ErrorContainer.md)

### Authorization

Expand Down Expand Up @@ -471,7 +471,7 @@ Name | Type | Description | Notes

### Return type

[**LoginFlow**](loginFlow.md)
[**LoginFlow**](LoginFlow.md)

### Authorization

Expand Down Expand Up @@ -537,7 +537,7 @@ Name | Type | Description | Notes

### Return type

[**RecoveryFlow**](recoveryFlow.md)
[**RecoveryFlow**](RecoveryFlow.md)

### Authorization

Expand Down Expand Up @@ -603,7 +603,7 @@ Name | Type | Description | Notes

### Return type

[**RegistrationFlow**](registrationFlow.md)
[**RegistrationFlow**](RegistrationFlow.md)

### Authorization

Expand Down Expand Up @@ -669,7 +669,7 @@ Name | Type | Description | Notes

### Return type

[**SettingsFlow**](settingsFlow.md)
[**SettingsFlow**](SettingsFlow.md)

### Authorization

Expand Down Expand Up @@ -735,7 +735,7 @@ Name | Type | Description | Notes

### Return type

[**VerificationFlow**](verificationFlow.md)
[**VerificationFlow**](VerificationFlow.md)

### Authorization

Expand Down Expand Up @@ -860,7 +860,7 @@ Name | Type | Description | Notes

### Return type

[**LoginFlow**](loginFlow.md)
[**LoginFlow**](LoginFlow.md)

### Authorization

Expand Down Expand Up @@ -980,7 +980,7 @@ Other parameters are passed through a pointer to a apiInitializeSelfServiceRecov

### Return type

[**RecoveryFlow**](recoveryFlow.md)
[**RecoveryFlow**](RecoveryFlow.md)

### Authorization

Expand Down Expand Up @@ -1100,7 +1100,7 @@ Other parameters are passed through a pointer to a apiInitializeSelfServiceRegis

### Return type

[**RegistrationFlow**](registrationFlow.md)
[**RegistrationFlow**](RegistrationFlow.md)

### Authorization

Expand Down Expand Up @@ -1220,7 +1220,7 @@ Other parameters are passed through a pointer to a apiInitializeSelfServiceSetti

### Return type

[**SettingsFlow**](settingsFlow.md)
[**SettingsFlow**](SettingsFlow.md)

### Authorization

Expand Down Expand Up @@ -1340,7 +1340,7 @@ Other parameters are passed through a pointer to a apiInitializeSelfServiceVerif

### Return type

[**VerificationFlow**](verificationFlow.md)
[**VerificationFlow**](VerificationFlow.md)

### Authorization

Expand Down Expand Up @@ -1529,7 +1529,7 @@ Name | Type | Description | Notes

### Return type

[**LoginViaApiResponse**](loginViaApiResponse.md)
[**LoginViaApiResponse**](LoginViaApiResponse.md)

### Authorization

Expand Down Expand Up @@ -1595,7 +1595,7 @@ Name | Type | Description | Notes

### Return type

[**RegistrationViaApiResponse**](registrationViaApiResponse.md)
[**RegistrationViaApiResponse**](RegistrationViaApiResponse.md)

### Authorization

Expand Down Expand Up @@ -1663,7 +1663,7 @@ Name | Type | Description | Notes

### Return type

[**Session**](session.md)
[**Session**](Session.md)

### Authorization

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/RecoveryFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**RequestUrl** | **string** | RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example. |
**State** | **string** | |
**Type** | Pointer to **string** | The flow type can either be `api` or `browser`. | [optional]
**Ui** | [**UiContainer**](uiContainer.md) | |
**Ui** | [**UiContainer**](UiContainer.md) | |

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/RegistrationFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
**IssuedAt** | **time.Time** | IssuedAt is the time (UTC) when the flow occurred. |
**RequestUrl** | **string** | RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example. |
**Type** | Pointer to **string** | The flow type can either be `api` or `browser`. | [optional]
**Ui** | [**UiContainer**](uiContainer.md) | |
**Ui** | [**UiContainer**](UiContainer.md) | |

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/RegistrationViaApiResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Identity** | [**Identity**](Identity.md) | |
**Session** | Pointer to [**Session**](session.md) | | [optional]
**Session** | Pointer to [**Session**](Session.md) | | [optional]
**SessionToken** | **string** | The Session Token This field is only set when the session hook is configured as a post-registration hook. A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization Header: Authorization: bearer ${session-token} The session token is only issued for API flows, not for Browser flows! |

## Methods
Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/SettingsFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Name | Type | Description | Notes
**RequestUrl** | **string** | RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example. |
**State** | **string** | |
**Type** | Pointer to **string** | The flow type can either be `api` or `browser`. | [optional]
**Ui** | [**UiContainer**](uiContainer.md) | |
**Ui** | [**UiContainer**](UiContainer.md) | |

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/SettingsViaApiResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Flow** | [**SettingsFlow**](settingsFlow.md) | |
**Flow** | [**SettingsFlow**](SettingsFlow.md) | |
**Identity** | [**Identity**](Identity.md) | |

## Methods
Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/UiNode.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Attributes** | [**UiNodeAttributes**](uiNodeAttributes.md) | |
**Attributes** | [**UiNodeAttributes**](UiNodeAttributes.md) | |
**Group** | **string** | |
**Messages** | [**[]UiText**](UiText.md) | |
**Type** | **string** | |
Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/UiNodeAnchorAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Href** | **string** | The link's href (destination) URL. format: uri |
**Title** | [**UiText**](uiText.md) | |
**Title** | [**UiText**](UiText.md) | |

## Methods

Expand Down
8 changes: 4 additions & 4 deletions internal/httpclient/docs/UiNodeAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Disabled** | **bool** | Sets the input's disabled field to true or false. |
**Label** | Pointer to [**UiText**](uiText.md) | | [optional]
**Label** | Pointer to [**UiText**](UiText.md) | | [optional]
**Name** | **string** | The input's element name. |
**Pattern** | Pointer to **string** | The input's pattern. | [optional]
**Required** | Pointer to **bool** | Mark this input field as required. | [optional]
**Type** | **string** | |
**Value** | Pointer to [**UiNodeInputAttributesValue**](uiNodeInputAttributesValue.md) | | [optional]
**Text** | [**UiText**](uiText.md) | |
**Value** | Pointer to [**UiNodeInputAttributesValue**](UiNodeInputAttributesValue.md) | | [optional]
**Text** | [**UiText**](UiText.md) | |
**Src** | **string** | The image's source URL. format: uri |
**Href** | **string** | The link's href (destination) URL. format: uri |
**Title** | [**UiText**](uiText.md) | |
**Title** | [**UiText**](UiText.md) | |

## Methods

Expand Down
4 changes: 2 additions & 2 deletions internal/httpclient/docs/UiNodeInputAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Disabled** | **bool** | Sets the input's disabled field to true or false. |
**Label** | Pointer to [**UiText**](uiText.md) | | [optional]
**Label** | Pointer to [**UiText**](UiText.md) | | [optional]
**Name** | **string** | The input's element name. |
**Pattern** | Pointer to **string** | The input's pattern. | [optional]
**Required** | Pointer to **bool** | Mark this input field as required. | [optional]
**Type** | **string** | |
**Value** | Pointer to [**UiNodeInputAttributesValue**](uiNodeInputAttributesValue.md) | | [optional]
**Value** | Pointer to [**UiNodeInputAttributesValue**](UiNodeInputAttributesValue.md) | | [optional]

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/UiNodeTextAttributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Text** | [**UiText**](uiText.md) | |
**Text** | [**UiText**](UiText.md) | |

## Methods

Expand Down
2 changes: 1 addition & 1 deletion internal/httpclient/docs/VerificationFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Name | Type | Description | Notes
**RequestUrl** | Pointer to **string** | RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example. | [optional]
**State** | **string** | |
**Type** | **string** | The flow type can either be `api` or `browser`. |
**Ui** | [**UiContainer**](uiContainer.md) | |
**Ui** | [**UiContainer**](UiContainer.md) | |

## Methods

Expand Down
5 changes: 5 additions & 0 deletions selfservice/flow/login/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ func (s *ErrorHandler) WriteFlowError(w http.ResponseWriter, r *http.Request, f
return
}

if err := sortNodes(f.UI.Nodes); err != nil {
s.forward(w, r, f, err)
return
}

if err := s.d.LoginFlowPersister().UpdateLoginFlow(r.Context(), f); err != nil {
s.forward(w, r, f, err)
return
Expand Down
Loading

0 comments on commit 797b49d

Please sign in to comment.