web/admin: add flow export button on flow view page

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-26 22:03:19 +02:00
parent b7f4d15a94
commit 0403f6d373
6 changed files with 47 additions and 8 deletions

View file

@ -40,6 +40,11 @@ class ReevaluateMarker(StageMarker):
self, plan: "FlowPlan", stage: Stage, http_request: Optional[HttpRequest] self, plan: "FlowPlan", stage: Stage, http_request: Optional[HttpRequest]
) -> Optional[Stage]: ) -> Optional[Stage]:
"""Re-evaluate policies bound to stage, and if they fail, remove from plan""" """Re-evaluate policies bound to stage, and if they fail, remove from plan"""
LOGGER.debug(
"f(plan_inst)[re-eval marker]: running re-evaluation",
stage=stage,
binding=self.binding,
)
engine = PolicyEngine(self.binding, self.user) engine = PolicyEngine(self.binding, self.user)
engine.use_cache = False engine.use_cache = False
if http_request: if http_request:

View file

@ -1372,8 +1372,8 @@ msgid "Evaluate policies before the Stage is present to the user."
msgstr "Evaluate policies before the Stage is present to the user." msgstr "Evaluate policies before the Stage is present to the user."
#: src/pages/flows/StageBindingForm.ts #: src/pages/flows/StageBindingForm.ts
msgid "Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with this option disabled, policies are **not** evaluated." msgid "Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with both options disabled, policies are **not** evaluated."
msgstr "Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with this option disabled, policies are **not** evaluated." msgstr "Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with both options disabled, policies are **not** evaluated."
#: src/pages/events/EventListPage.ts #: src/pages/events/EventListPage.ts
msgid "Event Log" msgid "Event Log"
@ -1451,9 +1451,14 @@ msgid "Explicit Consent"
msgstr "Explicit Consent" msgstr "Explicit Consent"
#: src/pages/flows/FlowListPage.ts #: src/pages/flows/FlowListPage.ts
#: src/pages/flows/FlowViewPage.ts
msgid "Export" msgid "Export"
msgstr "Export" msgstr "Export"
#: src/pages/flows/FlowViewPage.ts
msgid "Export flow"
msgstr "Export flow"
#: src/pages/events/EventInfo.ts #: src/pages/events/EventInfo.ts
#: src/pages/policies/expression/ExpressionPolicyForm.ts #: src/pages/policies/expression/ExpressionPolicyForm.ts
#: src/pages/property-mappings/PropertyMappingLDAPForm.ts #: src/pages/property-mappings/PropertyMappingLDAPForm.ts

View file

@ -1364,7 +1364,7 @@ msgid "Evaluate policies before the Stage is present to the user."
msgstr "" msgstr ""
#: #:
msgid "Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with this option disabled, policies are **not** evaluated." msgid "Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with both options disabled, policies are **not** evaluated."
msgstr "" msgstr ""
#: #:
@ -1442,10 +1442,15 @@ msgstr ""
msgid "Explicit Consent" msgid "Explicit Consent"
msgstr "" msgstr ""
#:
#: #:
msgid "Export" msgid "Export"
msgstr "" msgstr ""
#:
msgid "Export flow"
msgstr ""
#: #:
#: #:
#: #:

View file

@ -51,9 +51,9 @@ export class FlowViewPage extends LitElement {
return html``; return html``;
} }
return html`<ak-page-header return html`<ak-page-header
icon="pf-icon pf-icon-process-automation" icon="pf-icon pf-icon-process-automation"
header=${this.flow.name} header=${this.flow.name}
description=${this.flow.title}> description=${this.flow.title}>
</ak-page-header> </ak-page-header>
<ak-tabs> <ak-tabs>
<div slot="page-overview" data-tab-title="${t`Flow Overview`}" class="pf-c-page__main-section pf-m-no-padding-mobile"> <div slot="page-overview" data-tab-title="${t`Flow Overview`}" class="pf-c-page__main-section pf-m-no-padding-mobile">
@ -69,7 +69,7 @@ export class FlowViewPage extends LitElement {
<dd class="pf-c-description-list__description"> <dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text"> <div class="pf-c-description-list__text">
<button <button
class="pf-c-button pf-m-secondary" class="pf-c-button pf-m-primary"
@click=${() => { @click=${() => {
new FlowsApi(DEFAULT_CONFIG).flowsInstancesExecuteRetrieve({ new FlowsApi(DEFAULT_CONFIG).flowsInstancesExecuteRetrieve({
slug: this.flow.slug slug: this.flow.slug
@ -82,6 +82,16 @@ export class FlowViewPage extends LitElement {
</button> </button>
</div> </div>
</dd> </dd>
<dt class="pf-c-description-list__term">
<span class="pf-c-description-list__text">${t`Export flow`}</span>
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
<a class="pf-c-button pf-m-secondary" href=${this.flow.exportUrl}>
${t`Export`}
</a>
</div>
</dd>
</div> </div>
</dl> </dl>
</div> </div>

View file

@ -123,7 +123,7 @@ export class StageBindingForm extends ModelForm<FlowStageBinding, string> {
</label> </label>
</div> </div>
<p class="pf-c-form__helper-text"> <p class="pf-c-form__helper-text">
${t`Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with this option disabled, policies are **not** evaluated.`} ${t`Evaluate policies during the Flow planning process. Disable this for input-based policies. Should be used in conjunction with 'Re-evaluate policies', as with both options disabled, policies are **not** evaluated.`}
</p> </p>
</ak-form-element-horizontal> </ak-form-element-horizontal>
<ak-form-element-horizontal name="reEvaluatePolicies"> <ak-form-element-horizontal name="reEvaluatePolicies">

View file

@ -116,6 +116,20 @@ slug: "2021.6"
- web/admin: handle elements in slot=form not being forms - web/admin: handle elements in slot=form not being forms
- web/admin: sort inputs on authenticator validation stage form - web/admin: sort inputs on authenticator validation stage form
## Fixed in 2021.6.3
- core: fix flow background not correctly loading on initial draw
- events: only create SYSTEM_EXCEPTION event when error would've been sent to sentry
- expressions: fix regex_match result being inverted
- outposts: check docker container ports match
- outposts/ldap: fixed IsActive and IsSuperuser returning swapped incorrect values (#1078)
- providers/oauth2: fix exp of JWT when not using seconds
- sources/ldap: improve error handling when checking for password complexity on non-ad setups
- stages/authenticator_duo: fix component not being set in API
- web/admin: fix deletion of authenticator not reloading the state correctly
- web/admin: fix only recovery flows being selectable for unenrollment flow in tenant form
- web/admin: fix text color on pf-c-card
## Upgrading ## Upgrading
This release does not introduce any new requirements. This release does not introduce any new requirements.