web: use single delete button with checkbox and icon-based action buttons

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-05 12:30:43 +02:00
parent ddd5047cc3
commit 1a17ce24f9
33 changed files with 911 additions and 631 deletions

View File

@ -20,6 +20,12 @@
"regenerator": true "regenerator": true
} }
], ],
"macros" "macros",
[
"@babel/plugin-proposal-private-property-in-object",
{
"loose": true
}
]
] ]
} }

View File

@ -22,6 +22,7 @@ export class UserOAuthCodeList extends Table<ExpiringBaseGrantModel> {
}); });
} }
checkbox = true;
order = "-expires"; order = "-expires";
columns(): TableColumn[] { columns(): TableColumn[] {
@ -29,16 +30,13 @@ export class UserOAuthCodeList extends Table<ExpiringBaseGrantModel> {
new TableColumn(t`Provider`, "provider"), new TableColumn(t`Provider`, "provider"),
new TableColumn(t`Expires`, "expires"), new TableColumn(t`Expires`, "expires"),
new TableColumn(t`Scopes`, "scope"), new TableColumn(t`Scopes`, "scope"),
new TableColumn("Actions"),
]; ];
} }
row(item: ExpiringBaseGrantModel): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`<a href="#/core/providers/${item.provider?.pk}"> ${item.provider?.name} </a>`, const item = this.selectedElements[0];
html`${item.expires?.toLocaleString()}`, return html`<ak-forms-delete
html`${item.scope.join(", ")}`,
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Authorization Code`} objectLabel=${t`Authorization Code`}
.usedBy=${() => { .usedBy=${() => {
@ -52,10 +50,17 @@ export class UserOAuthCodeList extends Table<ExpiringBaseGrantModel> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger"> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete Authorization Code`} ${t`Delete`}
</button> </button>
</ak-forms-delete>`, </ak-forms-delete>`;
}
row(item: ExpiringBaseGrantModel): TemplateResult[] {
return [
html`<a href="#/core/providers/${item.provider?.pk}"> ${item.provider?.name} </a>`,
html`${item.expires?.toLocaleString()}`,
html`${item.scope.join(", ")}`,
]; ];
} }
} }

View File

@ -29,6 +29,7 @@ export class UserOAuthRefreshList extends Table<RefreshTokenModel> {
}); });
} }
checkbox = true;
order = "-expires"; order = "-expires";
columns(): TableColumn[] { columns(): TableColumn[] {
@ -37,7 +38,6 @@ export class UserOAuthRefreshList extends Table<RefreshTokenModel> {
new TableColumn(t`Revoked?`, "revoked"), new TableColumn(t`Revoked?`, "revoked"),
new TableColumn(t`Expires`, "expires"), new TableColumn(t`Expires`, "expires"),
new TableColumn(t`Scopes`, "scope"), new TableColumn(t`Scopes`, "scope"),
new TableColumn("Actions"),
]; ];
} }
@ -53,17 +53,13 @@ export class UserOAuthRefreshList extends Table<RefreshTokenModel> {
</div> </div>
</td> </td>
<td></td> <td></td>
<td></td>
<td></td>`; <td></td>`;
} }
row(item: RefreshTokenModel): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`<a href="#/core/providers/${item.provider?.pk}"> ${item.provider?.name} </a>`, const item = this.selectedElements[0];
html`${item.revoked ? t`Yes` : t`No`}`, return html`<ak-forms-delete
html`${item.expires?.toLocaleString()}`,
html`${item.scope.join(", ")}`,
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Refresh Code`} objectLabel=${t`Refresh Code`}
.usedBy=${() => { .usedBy=${() => {
@ -77,10 +73,18 @@ export class UserOAuthRefreshList extends Table<RefreshTokenModel> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger"> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete Refresh Code`} ${t`Delete`}
</button> </button>
</ak-forms-delete>`, </ak-forms-delete>`;
}
row(item: RefreshTokenModel): TemplateResult[] {
return [
html`<a href="#/core/providers/${item.provider?.pk}"> ${item.provider?.name} </a>`,
html`${item.revoked ? t`Yes` : t`No`}`,
html`${item.expires?.toLocaleString()}`,
html`${item.scope.join(", ")}`,
]; ];
} }
} }

View File

@ -273,7 +273,7 @@ export abstract class Table<T> extends LitElement {
}), }),
); );
}} }}
class="pf-c-button pf-m-primary" class="pf-c-button pf-m-secondary"
> >
${t`Refresh`} ${t`Refresh`}
</button>`; </button>`;
@ -303,8 +303,7 @@ export abstract class Table<T> extends LitElement {
); );
}} }}
> >
</ak-table-search </ak-table-search>`;
>&nbsp;`;
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
@ -326,9 +325,10 @@ export abstract class Table<T> extends LitElement {
: html``} : html``}
<div class="pf-c-toolbar"> <div class="pf-c-toolbar">
<div class="pf-c-toolbar__content"> <div class="pf-c-toolbar__content">
${this.renderToolbarSelected()} &nbsp; ${this.renderSearch()} <div class="pf-m-search-filter">${this.renderSearch()}</div>
<div class="pf-c-toolbar__bulk-select">${this.renderToolbar()}</div> <div class="pf-c-toolbar__bulk-select">${this.renderToolbar()}</div>
${this.renderToolbarAfter()} <div class="pf-c-toolbar__group">${this.renderToolbarAfter()}</div>
<div class="pf-c-toolbar__group">${this.renderToolbarSelected()}</div>
<ak-table-pagination <ak-table-pagination
class="pf-c-toolbar__item pf-m-pagination" class="pf-c-toolbar__item pf-m-pagination"
.pages=${this.data?.pagination} .pages=${this.data?.pagination}

View File

@ -22,6 +22,7 @@ export class AuthenticatedSessionList extends Table<AuthenticatedSession> {
}); });
} }
checkbox = true;
order = "-expires"; order = "-expires";
columns(): TableColumn[] { columns(): TableColumn[] {
@ -30,17 +31,13 @@ export class AuthenticatedSessionList extends Table<AuthenticatedSession> {
new TableColumn(t`Browser`, "user_agent"), new TableColumn(t`Browser`, "user_agent"),
new TableColumn(t`Device`, "user_agent"), new TableColumn(t`Device`, "user_agent"),
new TableColumn(t`Expires`, "expires"), new TableColumn(t`Expires`, "expires"),
new TableColumn("Actions"),
]; ];
} }
row(item: AuthenticatedSession): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.lastIp}`, const item = this.selectedElements[0];
html`${item.userAgent.userAgent?.family}`, return html`<ak-forms-delete
html`${item.userAgent.os?.family}`,
html`${item.expires?.toLocaleString()}`,
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Session`} objectLabel=${t`Session`}
.usedBy=${() => { .usedBy=${() => {
@ -54,8 +51,18 @@ export class AuthenticatedSessionList extends Table<AuthenticatedSession> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete Session`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete Session`}
</button>
</ak-forms-delete>`;
}
row(item: AuthenticatedSession): TemplateResult[] {
return [
html`${item.lastIp}`,
html`${item.userAgent.userAgent?.family}`,
html`${item.userAgent.os?.family}`,
html`${item.expires?.toLocaleString()}`,
]; ];
} }
} }

View File

@ -22,21 +22,20 @@ export class UserConsentList extends Table<UserConsent> {
}); });
} }
checkbox = true;
order = "-expires"; order = "-expires";
columns(): TableColumn[] { columns(): TableColumn[] {
return [ return [
new TableColumn(t`Application`, "application"), new TableColumn(t`Application`, "application"),
new TableColumn(t`Expires`, "expires"), new TableColumn(t`Expires`, "expires"),
new TableColumn("Actions"),
]; ];
} }
row(item: UserConsent): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.application.name}`, const item = this.selectedElements[0];
html`${item.expires?.toLocaleString()}`, return html`<ak-forms-delete
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Consent`} objectLabel=${t`Consent`}
.usedBy=${() => { .usedBy=${() => {
@ -50,8 +49,13 @@ export class UserConsentList extends Table<UserConsent> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete Consent`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete Consent`}
]; </button>
</ak-forms-delete>`;
}
row(item: UserConsent): TemplateResult[] {
return [html`${item.application.name}`, html`${item.expires?.toLocaleString()}`];
} }
} }

View File

@ -94,6 +94,30 @@ msgstr "Access token URL"
msgid "Action" msgid "Action"
msgstr "Action" msgstr "Action"
#: src/pages/applications/ApplicationListPage.ts
#: src/pages/crypto/CertificateKeyPairListPage.ts
#: src/pages/events/EventListPage.ts
#: src/pages/events/RuleListPage.ts
#: src/pages/events/TransportListPage.ts
#: src/pages/flows/BoundStagesList.ts
#: src/pages/flows/FlowListPage.ts
#: src/pages/groups/GroupListPage.ts
#: src/pages/outposts/OutpostListPage.ts
#: src/pages/outposts/ServiceConnectionListPage.ts
#: src/pages/policies/BoundPoliciesList.ts
#: src/pages/policies/PolicyListPage.ts
#: src/pages/policies/reputation/IPReputationListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/providers/ProviderListPage.ts
#: src/pages/stages/StageListPage.ts
#: src/pages/stages/prompt/PromptListPage.ts
#: src/pages/system-tasks/SystemTaskListPage.ts
#: src/pages/tenants/TenantListPage.ts
#: src/pages/tokens/TokenListPage.ts
#: src/pages/users/UserListPage.ts
msgid "Actions"
msgstr "Actions"
#: src/pages/groups/MemberSelectModal.ts #: src/pages/groups/MemberSelectModal.ts
#: src/pages/users/UserListPage.ts #: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts #: src/pages/users/UserViewPage.ts
@ -1031,6 +1055,8 @@ msgid "Define how notifications are sent to users, like Email or Webhook."
msgstr "Define how notifications are sent to users, like Email or Webhook." msgstr "Define how notifications are sent to users, like Email or Webhook."
#: src/elements/forms/DeleteForm.ts #: src/elements/forms/DeleteForm.ts
#: src/elements/oauth/UserCodeList.ts
#: src/elements/oauth/UserRefreshList.ts
#: src/pages/applications/ApplicationListPage.ts #: src/pages/applications/ApplicationListPage.ts
#: src/pages/crypto/CertificateKeyPairListPage.ts #: src/pages/crypto/CertificateKeyPairListPage.ts
#: src/pages/events/RuleListPage.ts #: src/pages/events/RuleListPage.ts
@ -1056,9 +1082,9 @@ msgstr "Define how notifications are sent to users, like Email or Webhook."
msgid "Delete" msgid "Delete"
msgstr "Delete" msgstr "Delete"
#: src/elements/oauth/UserCodeList.ts #:
msgid "Delete Authorization Code" #~ msgid "Delete Authorization Code"
msgstr "Delete Authorization Code" #~ msgstr "Delete Authorization Code"
#: src/pages/flows/BoundStagesList.ts #: src/pages/flows/BoundStagesList.ts
#: src/pages/policies/BoundPoliciesList.ts #: src/pages/policies/BoundPoliciesList.ts
@ -1069,9 +1095,9 @@ msgstr "Delete Binding"
msgid "Delete Consent" msgid "Delete Consent"
msgstr "Delete Consent" msgstr "Delete Consent"
#: src/elements/oauth/UserRefreshList.ts #:
msgid "Delete Refresh Code" #~ msgid "Delete Refresh Code"
msgstr "Delete Refresh Code" #~ msgstr "Delete Refresh Code"
#: src/elements/user/SessionList.ts #: src/elements/user/SessionList.ts
msgid "Delete Session" msgid "Delete Session"
@ -1238,33 +1264,16 @@ msgstr "Duration after which events will be deleted from the database."
msgid "Each provider has a different issuer, based on the application slug." msgid "Each provider has a different issuer, based on the application slug."
msgstr "Each provider has a different issuer, based on the application slug." msgstr "Each provider has a different issuer, based on the application slug."
#: src/pages/applications/ApplicationListPage.ts
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/crypto/CertificateKeyPairListPage.ts
#: src/pages/events/RuleListPage.ts
#: src/pages/events/TransportListPage.ts
#: src/pages/flows/FlowListPage.ts
#: src/pages/groups/GroupListPage.ts
#: src/pages/outposts/OutpostListPage.ts
#: src/pages/outposts/OutpostListPage.ts
#: src/pages/outposts/ServiceConnectionListPage.ts
#: src/pages/policies/PolicyListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/providers/ProviderListPage.ts
#: src/pages/providers/ldap/LDAPProviderViewPage.ts #: src/pages/providers/ldap/LDAPProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/proxy/ProxyProviderViewPage.ts #: src/pages/providers/proxy/ProxyProviderViewPage.ts
#: src/pages/providers/saml/SAMLProviderViewPage.ts #: src/pages/providers/saml/SAMLProviderViewPage.ts
#: src/pages/sources/SourcesListPage.ts
#: src/pages/sources/ldap/LDAPSourceViewPage.ts #: src/pages/sources/ldap/LDAPSourceViewPage.ts
#: src/pages/sources/oauth/OAuthSourceViewPage.ts #: src/pages/sources/oauth/OAuthSourceViewPage.ts
#: src/pages/sources/plex/PlexSourceViewPage.ts #: src/pages/sources/plex/PlexSourceViewPage.ts
#: src/pages/sources/saml/SAMLSourceViewPage.ts #: src/pages/sources/saml/SAMLSourceViewPage.ts
#: src/pages/stages/StageListPage.ts
#: src/pages/stages/prompt/PromptListPage.ts
#: src/pages/tenants/TenantListPage.ts
#: src/pages/user-settings/tokens/UserTokenList.ts
#: src/pages/users/UserListPage.ts #: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts #: src/pages/users/UserViewPage.ts
msgid "Edit" msgid "Edit"
@ -1940,6 +1949,10 @@ msgstr "Integration"
msgid "Integration key" msgid "Integration key"
msgstr "Integration key" msgstr "Integration key"
#: src/interfaces/AdminInterface.ts
msgid "Integrations"
msgstr "Integrations"
#: src/pages/providers/proxy/ProxyProviderViewPage.ts #: src/pages/providers/proxy/ProxyProviderViewPage.ts
msgid "Internal Host" msgid "Internal Host"
msgstr "Internal Host" msgstr "Internal Host"
@ -2618,9 +2631,9 @@ msgstr "Only fail the policy, don't invalidate user's password."
msgid "Only send notification once, for example when sending a webhook into a chat channel." msgid "Only send notification once, for example when sending a webhook into a chat channel."
msgstr "Only send notification once, for example when sending a webhook into a chat channel." msgstr "Only send notification once, for example when sending a webhook into a chat channel."
#: src/pages/applications/ApplicationListPage.ts #:
msgid "Open application" #~ msgid "Open application"
msgstr "Open application" #~ msgstr "Open application"
#: src/pages/events/EventInfo.ts #: src/pages/events/EventInfo.ts
msgid "Open issue on GitHub..." msgid "Open issue on GitHub..."
@ -2695,9 +2708,13 @@ msgstr "Outpost"
msgid "Outpost Deployment Info" msgid "Outpost Deployment Info"
msgstr "Outpost Deployment Info" msgstr "Outpost Deployment Info"
#:
#~ msgid "Outpost Service-connection"
#~ msgstr "Outpost Service-connection"
#: src/pages/outposts/ServiceConnectionListPage.ts #: src/pages/outposts/ServiceConnectionListPage.ts
msgid "Outpost Service-connection" msgid "Outpost integration"
msgstr "Outpost Service-connection" msgstr "Outpost integration"
#: src/pages/admin-overview/AdminOverviewPage.ts #: src/pages/admin-overview/AdminOverviewPage.ts
msgid "Outpost status" msgid "Outpost status"
@ -3368,9 +3385,9 @@ msgstr "Server name for which this provider's certificate is valid for."
msgid "Server validation of credential failed: {err}" msgid "Server validation of credential failed: {err}"
msgstr "Server validation of credential failed: {err}" msgstr "Server validation of credential failed: {err}"
#: src/interfaces/AdminInterface.ts #:
msgid "Service Connections" #~ msgid "Service Connections"
msgstr "Service Connections" #~ msgstr "Service Connections"
#: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts
msgid "Service Provider Binding" msgid "Service Provider Binding"
@ -3652,6 +3669,11 @@ msgstr "Successfully created flow."
msgid "Successfully created group." msgid "Successfully created group."
msgstr "Successfully created group." msgstr "Successfully created group."
#: src/pages/outposts/ServiceConnectionDockerForm.ts
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts
msgid "Successfully created integration."
msgstr "Successfully created integration."
#: src/pages/stages/invitation/InvitationForm.ts #: src/pages/stages/invitation/InvitationForm.ts
msgid "Successfully created invitation." msgid "Successfully created invitation."
msgstr "Successfully created invitation." msgstr "Successfully created invitation."
@ -3691,10 +3713,10 @@ msgstr "Successfully created provider."
msgid "Successfully created rule." msgid "Successfully created rule."
msgstr "Successfully created rule." msgstr "Successfully created rule."
#: src/pages/outposts/ServiceConnectionDockerForm.ts #:
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts #:
msgid "Successfully created service-connection." #~ msgid "Successfully created service-connection."
msgstr "Successfully created service-connection." #~ msgstr "Successfully created service-connection."
#: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts #: src/pages/sources/oauth/OAuthSourceForm.ts
@ -3796,6 +3818,11 @@ msgstr "Successfully updated flow."
msgid "Successfully updated group." msgid "Successfully updated group."
msgstr "Successfully updated group." msgstr "Successfully updated group."
#: src/pages/outposts/ServiceConnectionDockerForm.ts
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts
msgid "Successfully updated integration."
msgstr "Successfully updated integration."
#: src/pages/stages/invitation/InvitationForm.ts #: src/pages/stages/invitation/InvitationForm.ts
msgid "Successfully updated invitation." msgid "Successfully updated invitation."
msgstr "Successfully updated invitation." msgstr "Successfully updated invitation."
@ -3835,10 +3862,10 @@ msgstr "Successfully updated provider."
msgid "Successfully updated rule." msgid "Successfully updated rule."
msgstr "Successfully updated rule." msgstr "Successfully updated rule."
#: src/pages/outposts/ServiceConnectionDockerForm.ts #:
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts #:
msgid "Successfully updated service-connection." #~ msgid "Successfully updated service-connection."
msgstr "Successfully updated service-connection." #~ msgstr "Successfully updated service-connection."
#: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts #: src/pages/sources/oauth/OAuthSourceForm.ts
@ -3994,7 +4021,6 @@ msgstr "Tenants"
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/events/TransportListPage.ts #: src/pages/events/TransportListPage.ts
#: src/pages/policies/PolicyListPage.ts #: src/pages/policies/PolicyListPage.ts
#: src/pages/policies/PolicyListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts
msgid "Test" msgid "Test"

View File

@ -94,6 +94,30 @@ msgstr ""
msgid "Action" msgid "Action"
msgstr "" msgstr ""
#: src/pages/applications/ApplicationListPage.ts
#: src/pages/crypto/CertificateKeyPairListPage.ts
#: src/pages/events/EventListPage.ts
#: src/pages/events/RuleListPage.ts
#: src/pages/events/TransportListPage.ts
#: src/pages/flows/BoundStagesList.ts
#: src/pages/flows/FlowListPage.ts
#: src/pages/groups/GroupListPage.ts
#: src/pages/outposts/OutpostListPage.ts
#: src/pages/outposts/ServiceConnectionListPage.ts
#: src/pages/policies/BoundPoliciesList.ts
#: src/pages/policies/PolicyListPage.ts
#: src/pages/policies/reputation/IPReputationListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/providers/ProviderListPage.ts
#: src/pages/stages/StageListPage.ts
#: src/pages/stages/prompt/PromptListPage.ts
#: src/pages/system-tasks/SystemTaskListPage.ts
#: src/pages/tenants/TenantListPage.ts
#: src/pages/tokens/TokenListPage.ts
#: src/pages/users/UserListPage.ts
msgid "Actions"
msgstr ""
#: src/pages/groups/MemberSelectModal.ts #: src/pages/groups/MemberSelectModal.ts
#: src/pages/users/UserListPage.ts #: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts #: src/pages/users/UserViewPage.ts
@ -1025,6 +1049,8 @@ msgid "Define how notifications are sent to users, like Email or Webhook."
msgstr "" msgstr ""
#: src/elements/forms/DeleteForm.ts #: src/elements/forms/DeleteForm.ts
#: src/elements/oauth/UserCodeList.ts
#: src/elements/oauth/UserRefreshList.ts
#: src/pages/applications/ApplicationListPage.ts #: src/pages/applications/ApplicationListPage.ts
#: src/pages/crypto/CertificateKeyPairListPage.ts #: src/pages/crypto/CertificateKeyPairListPage.ts
#: src/pages/events/RuleListPage.ts #: src/pages/events/RuleListPage.ts
@ -1050,9 +1076,9 @@ msgstr ""
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
#: src/elements/oauth/UserCodeList.ts #:
msgid "Delete Authorization Code" #~ msgid "Delete Authorization Code"
msgstr "" #~ msgstr ""
#: src/pages/flows/BoundStagesList.ts #: src/pages/flows/BoundStagesList.ts
#: src/pages/policies/BoundPoliciesList.ts #: src/pages/policies/BoundPoliciesList.ts
@ -1063,9 +1089,9 @@ msgstr ""
msgid "Delete Consent" msgid "Delete Consent"
msgstr "" msgstr ""
#: src/elements/oauth/UserRefreshList.ts #:
msgid "Delete Refresh Code" #~ msgid "Delete Refresh Code"
msgstr "" #~ msgstr ""
#: src/elements/user/SessionList.ts #: src/elements/user/SessionList.ts
msgid "Delete Session" msgid "Delete Session"
@ -1230,33 +1256,16 @@ msgstr ""
msgid "Each provider has a different issuer, based on the application slug." msgid "Each provider has a different issuer, based on the application slug."
msgstr "" msgstr ""
#: src/pages/applications/ApplicationListPage.ts
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/crypto/CertificateKeyPairListPage.ts
#: src/pages/events/RuleListPage.ts
#: src/pages/events/TransportListPage.ts
#: src/pages/flows/FlowListPage.ts
#: src/pages/groups/GroupListPage.ts
#: src/pages/outposts/OutpostListPage.ts
#: src/pages/outposts/OutpostListPage.ts
#: src/pages/outposts/ServiceConnectionListPage.ts
#: src/pages/policies/PolicyListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/providers/ProviderListPage.ts
#: src/pages/providers/ldap/LDAPProviderViewPage.ts #: src/pages/providers/ldap/LDAPProviderViewPage.ts
#: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts #: src/pages/providers/oauth2/OAuth2ProviderViewPage.ts
#: src/pages/providers/proxy/ProxyProviderViewPage.ts #: src/pages/providers/proxy/ProxyProviderViewPage.ts
#: src/pages/providers/saml/SAMLProviderViewPage.ts #: src/pages/providers/saml/SAMLProviderViewPage.ts
#: src/pages/sources/SourcesListPage.ts
#: src/pages/sources/ldap/LDAPSourceViewPage.ts #: src/pages/sources/ldap/LDAPSourceViewPage.ts
#: src/pages/sources/oauth/OAuthSourceViewPage.ts #: src/pages/sources/oauth/OAuthSourceViewPage.ts
#: src/pages/sources/plex/PlexSourceViewPage.ts #: src/pages/sources/plex/PlexSourceViewPage.ts
#: src/pages/sources/saml/SAMLSourceViewPage.ts #: src/pages/sources/saml/SAMLSourceViewPage.ts
#: src/pages/stages/StageListPage.ts
#: src/pages/stages/prompt/PromptListPage.ts
#: src/pages/tenants/TenantListPage.ts
#: src/pages/user-settings/tokens/UserTokenList.ts
#: src/pages/users/UserListPage.ts #: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts #: src/pages/users/UserViewPage.ts
msgid "Edit" msgid "Edit"
@ -1932,6 +1941,10 @@ msgstr ""
msgid "Integration key" msgid "Integration key"
msgstr "" msgstr ""
#: src/interfaces/AdminInterface.ts
msgid "Integrations"
msgstr ""
#: src/pages/providers/proxy/ProxyProviderViewPage.ts #: src/pages/providers/proxy/ProxyProviderViewPage.ts
msgid "Internal Host" msgid "Internal Host"
msgstr "" msgstr ""
@ -2610,9 +2623,9 @@ msgstr ""
msgid "Only send notification once, for example when sending a webhook into a chat channel." msgid "Only send notification once, for example when sending a webhook into a chat channel."
msgstr "" msgstr ""
#: src/pages/applications/ApplicationListPage.ts #:
msgid "Open application" #~ msgid "Open application"
msgstr "" #~ msgstr ""
#: src/pages/events/EventInfo.ts #: src/pages/events/EventInfo.ts
msgid "Open issue on GitHub..." msgid "Open issue on GitHub..."
@ -2687,8 +2700,12 @@ msgstr ""
msgid "Outpost Deployment Info" msgid "Outpost Deployment Info"
msgstr "" msgstr ""
#:
#~ msgid "Outpost Service-connection"
#~ msgstr ""
#: src/pages/outposts/ServiceConnectionListPage.ts #: src/pages/outposts/ServiceConnectionListPage.ts
msgid "Outpost Service-connection" msgid "Outpost integration"
msgstr "" msgstr ""
#: src/pages/admin-overview/AdminOverviewPage.ts #: src/pages/admin-overview/AdminOverviewPage.ts
@ -3360,9 +3377,9 @@ msgstr ""
msgid "Server validation of credential failed: {err}" msgid "Server validation of credential failed: {err}"
msgstr "" msgstr ""
#: src/interfaces/AdminInterface.ts #:
msgid "Service Connections" #~ msgid "Service Connections"
msgstr "" #~ msgstr ""
#: src/pages/providers/saml/SAMLProviderForm.ts #: src/pages/providers/saml/SAMLProviderForm.ts
msgid "Service Provider Binding" msgid "Service Provider Binding"
@ -3644,6 +3661,11 @@ msgstr ""
msgid "Successfully created group." msgid "Successfully created group."
msgstr "" msgstr ""
#: src/pages/outposts/ServiceConnectionDockerForm.ts
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts
msgid "Successfully created integration."
msgstr ""
#: src/pages/stages/invitation/InvitationForm.ts #: src/pages/stages/invitation/InvitationForm.ts
msgid "Successfully created invitation." msgid "Successfully created invitation."
msgstr "" msgstr ""
@ -3683,10 +3705,10 @@ msgstr ""
msgid "Successfully created rule." msgid "Successfully created rule."
msgstr "" msgstr ""
#: src/pages/outposts/ServiceConnectionDockerForm.ts #:
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts #:
msgid "Successfully created service-connection." #~ msgid "Successfully created service-connection."
msgstr "" #~ msgstr ""
#: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts #: src/pages/sources/oauth/OAuthSourceForm.ts
@ -3788,6 +3810,11 @@ msgstr ""
msgid "Successfully updated group." msgid "Successfully updated group."
msgstr "" msgstr ""
#: src/pages/outposts/ServiceConnectionDockerForm.ts
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts
msgid "Successfully updated integration."
msgstr ""
#: src/pages/stages/invitation/InvitationForm.ts #: src/pages/stages/invitation/InvitationForm.ts
msgid "Successfully updated invitation." msgid "Successfully updated invitation."
msgstr "" msgstr ""
@ -3827,10 +3854,10 @@ msgstr ""
msgid "Successfully updated rule." msgid "Successfully updated rule."
msgstr "" msgstr ""
#: src/pages/outposts/ServiceConnectionDockerForm.ts #:
#: src/pages/outposts/ServiceConnectionKubernetesForm.ts #:
msgid "Successfully updated service-connection." #~ msgid "Successfully updated service-connection."
msgstr "" #~ msgstr ""
#: src/pages/sources/ldap/LDAPSourceForm.ts #: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts #: src/pages/sources/oauth/OAuthSourceForm.ts
@ -3986,7 +4013,6 @@ msgstr ""
#: src/pages/applications/ApplicationViewPage.ts #: src/pages/applications/ApplicationViewPage.ts
#: src/pages/events/TransportListPage.ts #: src/pages/events/TransportListPage.ts
#: src/pages/policies/PolicyListPage.ts #: src/pages/policies/PolicyListPage.ts
#: src/pages/policies/PolicyListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts
#: src/pages/property-mappings/PropertyMappingListPage.ts #: src/pages/property-mappings/PropertyMappingListPage.ts
msgid "Test" msgid "Test"

View File

@ -28,6 +28,8 @@ export class ApplicationListPage extends TablePage<Application> {
return "pf-icon pf-icon-applications"; return "pf-icon pf-icon-applications";
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -62,10 +64,33 @@ export class ApplicationListPage extends TablePage<Application> {
new TableColumn(t`Slug`, "slug"), new TableColumn(t`Slug`, "slug"),
new TableColumn(t`Provider`), new TableColumn(t`Provider`),
new TableColumn(t`Provider Type`), new TableColumn(t`Provider Type`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Application`}
.usedBy=${() => {
return new CoreApi(DEFAULT_CONFIG).coreApplicationsUsedByList({
slug: item.slug,
});
}}
.delete=${() => {
return new CoreApi(DEFAULT_CONFIG).coreApplicationsDestroy({
slug: item.slug,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Application): TemplateResult[] { row(item: Application): TemplateResult[] {
return [ return [
item.metaIcon item.metaIcon
@ -91,7 +116,9 @@ export class ApplicationListPage extends TablePage<Application> {
<span slot="header"> ${t`Update Application`} </span> <span slot="header"> ${t`Update Application`} </span>
<ak-application-form slot="form" .instancePk=${item.slug}> <ak-application-form slot="form" .instancePk=${item.slug}>
</ak-application-form> </ak-application-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal> </ak-forms-modal>
${item.launchUrl ${item.launchUrl
? html`<a ? html`<a
@ -99,25 +126,9 @@ export class ApplicationListPage extends TablePage<Application> {
target="_blank" target="_blank"
class="pf-c-button pf-m-secondary" class="pf-c-button pf-m-secondary"
> >
${t`Open application`} <i class="fas fas fa-share-square"></i>
</a>` </a>`
: html``} : html``}`,
<ak-forms-delete
.obj=${item}
objectLabel=${t`Application`}
.usedBy=${() => {
return new CoreApi(DEFAULT_CONFIG).coreApplicationsUsedByList({
slug: item.slug,
});
}}
.delete=${() => {
return new CoreApi(DEFAULT_CONFIG).coreApplicationsDestroy({
slug: item.slug,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -18,6 +18,7 @@ import { DEFAULT_CONFIG } from "../../api/Config";
@customElement("ak-crypto-certificate-list") @customElement("ak-crypto-certificate-list")
export class CertificateKeyPairListPage extends TablePage<CertificateKeyPair> { export class CertificateKeyPairListPage extends TablePage<CertificateKeyPair> {
expandable = true; expandable = true;
checkbox = true;
searchEnabled(): boolean { searchEnabled(): boolean {
return true; return true;
@ -53,23 +54,14 @@ export class CertificateKeyPairListPage extends TablePage<CertificateKeyPair> {
new TableColumn(t`Name`, "name"), new TableColumn(t`Name`, "name"),
new TableColumn(t`Private key available?`), new TableColumn(t`Private key available?`),
new TableColumn(t`Expiry date`), new TableColumn(t`Expiry date`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
row(item: CertificateKeyPair): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.name}`, const item = this.selectedElements[0];
html`${item.privateKeyAvailable ? t`Yes` : t`No`}`, return html`<ak-forms-delete
html`${item.certExpiry?.toLocaleString()}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Certificate-Key Pair`} </span>
<ak-crypto-certificate-form slot="form" .instancePk=${item.pk}>
</ak-crypto-certificate-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button>
</ak-forms-modal>
<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Certificate-Key Pair`} objectLabel=${t`Certificate-Key Pair`}
.usedBy=${() => { .usedBy=${() => {
@ -83,8 +75,26 @@ export class CertificateKeyPairListPage extends TablePage<CertificateKeyPair> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: CertificateKeyPair): TemplateResult[] {
return [
html`${item.name}`,
html`${item.privateKeyAvailable ? t`Yes` : t`No`}`,
html`${item.certExpiry?.toLocaleString()}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Certificate-Key Pair`} </span>
<ak-crypto-certificate-form slot="form" .instancePk=${item.pk}>
</ak-crypto-certificate-form>
<button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal>`,
]; ];
} }

View File

@ -46,7 +46,7 @@ export class EventListPage extends TablePage<Event> {
new TableColumn(t`Creation Date`, "created"), new TableColumn(t`Creation Date`, "created"),
new TableColumn(t`Client IP`, "client_ip"), new TableColumn(t`Client IP`, "client_ip"),
new TableColumn(t`Tenant`, "tenant_name"), new TableColumn(t`Tenant`, "tenant_name"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }

View File

@ -16,6 +16,7 @@ import "./RuleForm";
@customElement("ak-event-rule-list") @customElement("ak-event-rule-list")
export class RuleListPage extends TablePage<NotificationRule> { export class RuleListPage extends TablePage<NotificationRule> {
expandable = true; expandable = true;
checkbox = true;
searchEnabled(): boolean { searchEnabled(): boolean {
return true; return true;
@ -47,22 +48,14 @@ export class RuleListPage extends TablePage<NotificationRule> {
new TableColumn(t`Name`, "name"), new TableColumn(t`Name`, "name"),
new TableColumn(t`Severity`, "severity"), new TableColumn(t`Severity`, "severity"),
new TableColumn(t`Sent to group`, "group"), new TableColumn(t`Sent to group`, "group"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
row(item: NotificationRule): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.name}`, const item = this.selectedElements[0];
html`${item.severity}`, return html`<ak-forms-delete
html`${item.groupObj?.name || t`None (rule disabled)`}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Notification Rule`} </span>
<ak-event-rule-form slot="form" .instancePk=${item.pk}> </ak-event-rule-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button>
</ak-forms-modal>
<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Notification rule`} objectLabel=${t`Notification rule`}
.usedBy=${() => { .usedBy=${() => {
@ -76,8 +69,25 @@ export class RuleListPage extends TablePage<NotificationRule> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: NotificationRule): TemplateResult[] {
return [
html`${item.name}`,
html`${item.severity}`,
html`${item.groupObj?.name || t`None (rule disabled)`}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Notification Rule`} </span>
<ak-event-rule-form slot="form" .instancePk=${item.pk}> </ak-event-rule-form>
<button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal>`,
]; ];
} }

View File

@ -28,6 +28,8 @@ export class TransportListPage extends TablePage<NotificationTransport> {
return "pf-icon pf-icon-export"; return "pf-icon pf-icon-export";
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -44,10 +46,33 @@ export class TransportListPage extends TablePage<NotificationTransport> {
return [ return [
new TableColumn(t`Name`, "name"), new TableColumn(t`Name`, "name"),
new TableColumn(t`Mode`, "mode"), new TableColumn(t`Mode`, "mode"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Notifications Transport`}
.usedBy=${() => {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsUsedByList({
uuid: item.pk,
});
}}
.delete=${() => {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsDestroy({
uuid: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: NotificationTransport): TemplateResult[] { row(item: NotificationTransport): TemplateResult[] {
return [ return [
html`${item.name}`, html`${item.name}`,
@ -66,24 +91,10 @@ export class TransportListPage extends TablePage<NotificationTransport> {
<span slot="header"> ${t`Update Notification Transport`} </span> <span slot="header"> ${t`Update Notification Transport`} </span>
<ak-event-transport-form slot="form" .instancePk=${item.pk}> <ak-event-transport-form slot="form" .instancePk=${item.pk}>
</ak-event-transport-form> </ak-event-transport-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
</ak-forms-modal> <i class="fas fa-edit"></i>
<ak-forms-delete </button>
.obj=${item} </ak-forms-modal>`,
objectLabel=${t`Notifications Transport`}
.usedBy=${() => {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsUsedByList({
uuid: item.pk,
});
}}
.delete=${() => {
return new EventsApi(DEFAULT_CONFIG).eventsTransportsDestroy({
uuid: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -20,6 +20,7 @@ import { ifDefined } from "lit-html/directives/if-defined";
@customElement("ak-bound-stages-list") @customElement("ak-bound-stages-list")
export class BoundStagesList extends Table<FlowStageBinding> { export class BoundStagesList extends Table<FlowStageBinding> {
expandable = true; expandable = true;
checkbox = true;
@property() @property()
target?: string; target?: string;
@ -38,10 +39,33 @@ export class BoundStagesList extends Table<FlowStageBinding> {
new TableColumn(t`Order`), new TableColumn(t`Order`),
new TableColumn(t`Name`), new TableColumn(t`Name`),
new TableColumn(t`Type`), new TableColumn(t`Type`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Stage binding`}
.usedBy=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsUsedByList({
fsbUuid: item.pk,
});
}}
.delete=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsDestroy({
fsbUuid: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete Binding`}
</button>
</ak-forms-delete>`;
}
row(item: FlowStageBinding): TemplateResult[] { row(item: FlowStageBinding): TemplateResult[] {
return [ return [
html`${item.order}`, html`${item.order}`,
@ -70,25 +94,7 @@ export class BoundStagesList extends Table<FlowStageBinding> {
<button slot="trigger" class="pf-c-button pf-m-secondary"> <button slot="trigger" class="pf-c-button pf-m-secondary">
${t`Edit Binding`} ${t`Edit Binding`}
</button> </button>
</ak-forms-modal> </ak-forms-modal>`,
<ak-forms-delete
.obj=${item}
objectLabel=${t`Stage binding`}
.usedBy=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsUsedByList({
fsbUuid: item.pk,
});
}}
.delete=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsBindingsDestroy({
fsbUuid: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete Binding`}
</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -29,6 +29,8 @@ export class FlowListPage extends TablePage<Flow> {
return "pf-icon pf-icon-process-automation"; return "pf-icon pf-icon-process-automation";
} }
checkbox = true;
@property() @property()
order = "slug"; order = "slug";
@ -48,10 +50,33 @@ export class FlowListPage extends TablePage<Flow> {
new TableColumn(t`Designation`, "designation"), new TableColumn(t`Designation`, "designation"),
new TableColumn(t`Stages`), new TableColumn(t`Stages`),
new TableColumn(t`Policies`), new TableColumn(t`Policies`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Flow`}
.usedBy=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesUsedByList({
slug: item.slug,
});
}}
.delete=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesDestroy({
slug: item.slug,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Flow): TemplateResult[] { row(item: Flow): TemplateResult[] {
return [ return [
html`<a href="#/flow/flows/${item.slug}"> html`<a href="#/flow/flows/${item.slug}">
@ -65,26 +90,12 @@ export class FlowListPage extends TablePage<Flow> {
<span slot="submit"> ${t`Update`} </span> <span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Flow`} </span> <span slot="header"> ${t`Update Flow`} </span>
<ak-flow-form slot="form" .instancePk=${item.slug}> </ak-flow-form> <ak-flow-form slot="form" .instancePk=${item.slug}> </ak-flow-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal> </ak-forms-modal>
<ak-forms-delete
.obj=${item}
objectLabel=${t`Flow`}
.usedBy=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesUsedByList({
slug: item.slug,
});
}}
.delete=${() => {
return new FlowsApi(DEFAULT_CONFIG).flowsInstancesDestroy({
slug: item.slug,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>
<button <button
class="pf-c-button pf-m-secondary" class="pf-c-button pf-m-plain"
@click=${() => { @click=${() => {
new FlowsApi(DEFAULT_CONFIG) new FlowsApi(DEFAULT_CONFIG)
.flowsInstancesExecuteRetrieve({ .flowsInstancesExecuteRetrieve({
@ -97,9 +108,11 @@ export class FlowListPage extends TablePage<Flow> {
}); });
}} }}
> >
${t`Execute`} <i class="fas fa-play"></i>
</button> </button>
<a class="pf-c-button pf-m-secondary" href=${item.exportUrl}> ${t`Export`} </a>`, <a class="pf-c-button pf-m-plain" href=${item.exportUrl}>
<i class="fas fa-download"></i>
</a>`,
]; ];
} }

View File

@ -14,6 +14,7 @@ import "./GroupForm";
@customElement("ak-group-list") @customElement("ak-group-list")
export class GroupListPage extends TablePage<Group> { export class GroupListPage extends TablePage<Group> {
checkbox = true;
searchEnabled(): boolean { searchEnabled(): boolean {
return true; return true;
} }
@ -45,23 +46,14 @@ export class GroupListPage extends TablePage<Group> {
new TableColumn(t`Parent`, "parent"), new TableColumn(t`Parent`, "parent"),
new TableColumn(t`Members`), new TableColumn(t`Members`),
new TableColumn(t`Superuser privileges?`), new TableColumn(t`Superuser privileges?`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
row(item: Group): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.name}`, const item = this.selectedElements[0];
html`${item.parent || "-"}`, return html`<ak-forms-delete
html`${Array.from(item.users || []).length}`,
html`${item.isSuperuser ? t`Yes` : t`No`}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Group`} </span>
<ak-group-form slot="form" .instancePk=${item.pk}> </ak-group-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button>
</ak-forms-modal>
<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Group`} objectLabel=${t`Group`}
.usedBy=${() => { .usedBy=${() => {
@ -75,8 +67,26 @@ export class GroupListPage extends TablePage<Group> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Group): TemplateResult[] {
return [
html`${item.name}`,
html`${item.parent || "-"}`,
html`${Array.from(item.users || []).length}`,
html`${item.isSuperuser ? t`Yes` : t`No`}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Group`} </span>
<ak-group-form slot="form" .instancePk=${item.pk}> </ak-group-form>
<button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal>`,
]; ];
} }

View File

@ -45,10 +45,12 @@ export class OutpostListPage extends TablePage<Outpost> {
new TableColumn(t`Providers`), new TableColumn(t`Providers`),
new TableColumn(t`Integration`, "service_connection__name"), new TableColumn(t`Integration`, "service_connection__name"),
new TableColumn(t`Health and Version`), new TableColumn(t`Health and Version`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -71,9 +73,22 @@ export class OutpostListPage extends TablePage<Outpost> {
<span slot="submit"> ${t`Update`} </span> <span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Outpost`} </span> <span slot="header"> ${t`Update Outpost`} </span>
<ak-outpost-form slot="form" .instancePk=${item.pk}> </ak-outpost-form> <ak-outpost-form slot="form" .instancePk=${item.pk}> </ak-outpost-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal> </ak-forms-modal>
<ak-forms-delete <ak-outpost-deployment-modal .outpost=${item} size=${PFSize.Medium}>
<button slot="trigger" class="pf-c-button pf-m-tertiary">
${t`View Deployment Info`}
</button>
</ak-outpost-deployment-modal>`,
];
}
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Outpost`} objectLabel=${t`Outpost`}
.usedBy=${() => { .usedBy=${() => {
@ -87,14 +102,10 @@ export class OutpostListPage extends TablePage<Outpost> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete> ${t`Delete`}
<ak-outpost-deployment-modal .outpost=${item} size=${PFSize.Medium}>
<button slot="trigger" class="pf-c-button pf-m-tertiary">
${t`View Deployment Info`}
</button> </button>
</ak-outpost-deployment-modal>`, </ak-forms-delete>`;
];
} }
rowInbuilt(item: Outpost): TemplateResult[] { rowInbuilt(item: Outpost): TemplateResult[] {
@ -116,7 +127,9 @@ export class OutpostListPage extends TablePage<Outpost> {
<span slot="submit"> ${t`Update`} </span> <span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Outpost`} </span> <span slot="header"> ${t`Update Outpost`} </span>
<ak-outpost-form slot="form" .instancePk=${item.pk}> </ak-outpost-form> <ak-outpost-form slot="form" .instancePk=${item.pk}> </ak-outpost-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal>`, </ak-forms-modal>`,
]; ];
} }

View File

@ -35,6 +35,8 @@ export class OutpostServiceConnectionListPage extends TablePage<ServiceConnectio
return true; return true;
} }
checkbox = true;
apiEndpoint(page: number): Promise<AKResponse<ServiceConnection>> { apiEndpoint(page: number): Promise<AKResponse<ServiceConnection>> {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsAllList({ return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsAllList({
ordering: this.order, ordering: this.order,
@ -50,7 +52,7 @@ export class OutpostServiceConnectionListPage extends TablePage<ServiceConnectio
new TableColumn(t`Type`), new TableColumn(t`Type`),
new TableColumn(t`Local`, "local"), new TableColumn(t`Local`, "local"),
new TableColumn(t`State`), new TableColumn(t`State`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
@ -92,29 +94,34 @@ export class OutpostServiceConnectionListPage extends TablePage<ServiceConnectio
type=${ifDefined(item.component)} type=${ifDefined(item.component)}
> >
</ak-proxy-form> </ak-proxy-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
</ak-forms-modal> <i class="fas fa-edit"></i>
<ak-forms-delete </button>
</ak-forms-modal>`,
];
}
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Outpost integration`} objectLabel=${t`Outpost integration`}
.usedBy=${() => { .usedBy=${() => {
return new OutpostsApi( return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsAllUsedByList({
DEFAULT_CONFIG,
).outpostsServiceConnectionsAllUsedByList({
uuid: item.pk, uuid: item.pk,
}); });
}} }}
.delete=${() => { .delete=${() => {
return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsAllDestroy( return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsAllDestroy({
{
uuid: item.pk, uuid: item.pk,
}, });
);
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
]; </button>
</ak-forms-delete>`;
} }
renderToolbar(): TemplateResult { renderToolbar(): TemplateResult {

View File

@ -28,6 +28,8 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
@property({ type: Boolean }) @property({ type: Boolean })
policyOnly = false; policyOnly = false;
checkbox = true;
apiEndpoint(page: number): Promise<AKResponse<PolicyBinding>> { apiEndpoint(page: number): Promise<AKResponse<PolicyBinding>> {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsList({ return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsList({
target: this.target || "", target: this.target || "",
@ -43,7 +45,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
new TableColumn(t`Enabled`, "enabled"), new TableColumn(t`Enabled`, "enabled"),
new TableColumn(t`Order`, "order"), new TableColumn(t`Order`, "order"),
new TableColumn(t`Timeout`, "timeout"), new TableColumn(t`Timeout`, "timeout"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
@ -93,6 +95,29 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
} }
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Policy binding`}
.usedBy=${() => {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUsedByList({
policyBindingUuid: item.pk,
});
}}
.delete=${() => {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsDestroy({
policyBindingUuid: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete Binding`}
</button>
</ak-forms-delete>`;
}
row(item: PolicyBinding): TemplateResult[] { row(item: PolicyBinding): TemplateResult[] {
return [ return [
html`${this.getPolicyUserGroupRow(item)}`, html`${this.getPolicyUserGroupRow(item)}`,
@ -113,25 +138,7 @@ export class BoundPoliciesList extends Table<PolicyBinding> {
<button slot="trigger" class="pf-c-button pf-m-secondary"> <button slot="trigger" class="pf-c-button pf-m-secondary">
${t`Edit Binding`} ${t`Edit Binding`}
</button> </button>
</ak-forms-modal> </ak-forms-modal>`,
<ak-forms-delete
.obj=${item}
objectLabel=${t`Policy binding`}
.usedBy=${() => {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsUsedByList({
policyBindingUuid: item.pk,
});
}}
.delete=${() => {
return new PoliciesApi(DEFAULT_CONFIG).policiesBindingsDestroy({
policyBindingUuid: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete Binding`}
</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -39,6 +39,8 @@ export class PolicyListPage extends TablePage<Policy> {
return "pf-icon pf-icon-infrastructure"; return "pf-icon pf-icon-infrastructure";
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -97,7 +99,6 @@ export class PolicyListPage extends TablePage<Policy> {
} }
renderToolbarSelected(): TemplateResult { renderToolbarSelected(): TemplateResult {
// TODO: bulk delete
const disabled = this.selectedElements.length !== 1; const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0]; const item = this.selectedElements[0];
return html`<ak-forms-delete return html`<ak-forms-delete

View File

@ -30,6 +30,8 @@ export class IPReputationListPage extends TablePage<IPReputation> {
@property() @property()
order = "ip"; order = "ip";
checkbox = true;
apiEndpoint(page: number): Promise<AKResponse<IPReputation>> { apiEndpoint(page: number): Promise<AKResponse<IPReputation>> {
return new PoliciesApi(DEFAULT_CONFIG).policiesReputationIpsList({ return new PoliciesApi(DEFAULT_CONFIG).policiesReputationIpsList({
ordering: this.order, ordering: this.order,
@ -43,15 +45,14 @@ export class IPReputationListPage extends TablePage<IPReputation> {
return [ return [
new TableColumn(t`IP`, "ip"), new TableColumn(t`IP`, "ip"),
new TableColumn(t`Score`, "score"), new TableColumn(t`Score`, "score"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
row(item: IPReputation): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.ip}`, const item = this.selectedElements[0];
html`${item.score}`, return html`<ak-forms-delete
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`IP Reputation`} objectLabel=${t`IP Reputation`}
.usedBy=${() => { .usedBy=${() => {
@ -65,8 +66,13 @@ export class IPReputationListPage extends TablePage<IPReputation> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
]; </button>
</ak-forms-delete>`;
}
row(item: IPReputation): TemplateResult[] {
return [html`${item.ip}`, html`${item.score}`];
} }
} }

View File

@ -27,6 +27,8 @@ export class UserReputationListPage extends TablePage<UserReputation> {
return "fa fa-ban"; return "fa fa-ban";
} }
checkbox = true;
@property() @property()
order = "username"; order = "username";
@ -40,18 +42,13 @@ export class UserReputationListPage extends TablePage<UserReputation> {
} }
columns(): TableColumn[] { columns(): TableColumn[] {
return [ return [new TableColumn(t`Username`, "username"), new TableColumn(t`Score`, "score")];
new TableColumn(t`Username`, "username"),
new TableColumn(t`Score`, "score"),
new TableColumn("Actions"),
];
} }
row(item: UserReputation): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.username}`, const item = this.selectedElements[0];
html`${item.score}`, return html`<ak-forms-delete
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`User Reputation`} objectLabel=${t`User Reputation`}
.usedBy=${() => { .usedBy=${() => {
@ -65,8 +62,13 @@ export class UserReputationListPage extends TablePage<UserReputation> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
]; </button>
</ak-forms-delete>`;
}
row(item: UserReputation): TemplateResult[] {
return [html`${item.username}`, html`${item.score}`];
} }
} }

View File

@ -34,6 +34,8 @@ export class PropertyMappingListPage extends TablePage<PropertyMapping> {
return "pf-icon pf-icon-blueprint"; return "pf-icon pf-icon-blueprint";
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -54,10 +56,33 @@ export class PropertyMappingListPage extends TablePage<PropertyMapping> {
return [ return [
new TableColumn(t`Name`, "name"), new TableColumn(t`Name`, "name"),
new TableColumn(t`Type`, "type"), new TableColumn(t`Type`, "type"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html` <ak-forms-delete
.obj=${item}
objectLabel=${t`Property Mapping`}
.usedBy=${() => {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllUsedByList({
pmUuid: item.pk,
});
}}
.delete=${() => {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllDestroy({
pmUuid: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: PropertyMapping): TemplateResult[] { row(item: PropertyMapping): TemplateResult[] {
return [ return [
html`${item.name}`, html`${item.name}`,
@ -73,7 +98,9 @@ export class PropertyMappingListPage extends TablePage<PropertyMapping> {
type=${ifDefined(item.component)} type=${ifDefined(item.component)}
> >
</ak-proxy-form> </ak-proxy-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal> </ak-forms-modal>
<ak-forms-modal .closeAfterSuccessfulSubmit=${false}> <ak-forms-modal .closeAfterSuccessfulSubmit=${false}>
<span slot="submit"> ${t`Test`} </span> <span slot="submit"> ${t`Test`} </span>
@ -81,25 +108,7 @@ export class PropertyMappingListPage extends TablePage<PropertyMapping> {
<ak-property-mapping-test-form slot="form" .mapping=${item}> <ak-property-mapping-test-form slot="form" .mapping=${item}>
</ak-property-mapping-test-form> </ak-property-mapping-test-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Test`}</button> <button slot="trigger" class="pf-c-button pf-m-secondary">${t`Test`}</button>
</ak-forms-modal> </ak-forms-modal>`,
<ak-forms-delete
.obj=${item}
objectLabel=${t`Property Mapping`}
.usedBy=${() => {
return new PropertymappingsApi(
DEFAULT_CONFIG,
).propertymappingsAllUsedByList({
pmUuid: item.pk,
});
}}
.delete=${() => {
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllDestroy({
pmUuid: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -35,6 +35,8 @@ export class ProviderListPage extends TablePage<Provider> {
return "pf-icon pf-icon-integration"; return "pf-icon pf-icon-integration";
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -52,10 +54,33 @@ export class ProviderListPage extends TablePage<Provider> {
new TableColumn(t`Name`, "name"), new TableColumn(t`Name`, "name"),
new TableColumn(t`Application`), new TableColumn(t`Application`),
new TableColumn(t`Type`), new TableColumn(t`Type`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Provider`}
.usedBy=${() => {
return new ProvidersApi(DEFAULT_CONFIG).providersAllUsedByList({
id: item.pk,
});
}}
.delete=${() => {
return new ProvidersApi(DEFAULT_CONFIG).providersAllDestroy({
id: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Provider): TemplateResult[] { row(item: Provider): TemplateResult[] {
return [ return [
html`<a href="#/core/providers/${item.pk}"> ${item.name} </a>`, html`<a href="#/core/providers/${item.pk}"> ${item.name} </a>`,
@ -79,24 +104,10 @@ export class ProviderListPage extends TablePage<Provider> {
type=${ifDefined(item.component)} type=${ifDefined(item.component)}
> >
</ak-proxy-form> </ak-proxy-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
</ak-forms-modal> <i class="fas fa-edit"></i>
<ak-forms-delete </button>
.obj=${item} </ak-forms-modal>`,
objectLabel=${t`Provider`}
.usedBy=${() => {
return new ProvidersApi(DEFAULT_CONFIG).providersAllUsedByList({
id: item.pk,
});
}}
.delete=${() => {
return new ProvidersApi(DEFAULT_CONFIG).providersAllDestroy({
id: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -34,6 +34,8 @@ export class SourceListPage extends TablePage<Source> {
return true; return true;
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -50,6 +52,29 @@ export class SourceListPage extends TablePage<Source> {
return [new TableColumn(t`Name`, "name"), new TableColumn(t`Type`), new TableColumn("")]; return [new TableColumn(t`Name`, "name"), new TableColumn(t`Type`), new TableColumn("")];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Source`}
.usedBy=${() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesAllUsedByList({
slug: item.slug,
});
}}
.delete=${() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesAllDestroy({
slug: item.slug,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Source): TemplateResult[] { row(item: Source): TemplateResult[] {
if (item.component === "") { if (item.component === "") {
return this.rowInbuilt(item); return this.rowInbuilt(item);
@ -71,24 +96,10 @@ export class SourceListPage extends TablePage<Source> {
type=${ifDefined(item.component)} type=${ifDefined(item.component)}
> >
</ak-proxy-form> </ak-proxy-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
</ak-forms-modal> <i class="fas fa-edit"></i>
<ak-forms-delete </button>
.obj=${item} </ak-forms-modal>`,
objectLabel=${t`Source`}
.usedBy=${() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesAllUsedByList({
slug: item.slug,
});
}}
.delete=${() => {
return new SourcesApi(DEFAULT_CONFIG).sourcesAllDestroy({
slug: item.slug,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -49,6 +49,8 @@ export class StageListPage extends TablePage<Stage> {
return true; return true;
} }
checkbox = true;
@property() @property()
order = "name"; order = "name";
@ -62,7 +64,34 @@ export class StageListPage extends TablePage<Stage> {
} }
columns(): TableColumn[] { columns(): TableColumn[] {
return [new TableColumn(t`Name`, "name"), new TableColumn(t`Flows`), new TableColumn("")]; return [
new TableColumn(t`Name`, "name"),
new TableColumn(t`Flows`),
new TableColumn(t`Actions`),
];
}
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${item?.verboseName}
.usedBy=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesAllUsedByList({
stageUuid: item.pk,
});
}}
.delete=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesAllDestroy({
stageUuid: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
} }
row(item: Stage): TemplateResult[] { row(item: Stage): TemplateResult[] {
@ -87,24 +116,10 @@ export class StageListPage extends TablePage<Stage> {
type=${ifDefined(item.component)} type=${ifDefined(item.component)}
> >
</ak-proxy-form> </ak-proxy-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
</ak-forms-modal> <i class="fas fa-edit"></i>
<ak-forms-delete </button>
.obj=${item} </ak-forms-modal>`,
objectLabel=${item.verboseName || ""}
.usedBy=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesAllUsedByList({
stageUuid: item.pk,
});
}}
.delete=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesAllDestroy({
stageUuid: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -31,6 +31,8 @@ export class InvitationListPage extends TablePage<Invitation> {
return "pf-icon pf-icon-migration"; return "pf-icon pf-icon-migration";
} }
checkbox = true;
@property() @property()
order = "expires"; order = "expires";
@ -48,16 +50,13 @@ export class InvitationListPage extends TablePage<Invitation> {
new TableColumn(t`ID`, "pk"), new TableColumn(t`ID`, "pk"),
new TableColumn(t`Created by`, "created_by"), new TableColumn(t`Created by`, "created_by"),
new TableColumn(t`Expiry`), new TableColumn(t`Expiry`),
new TableColumn("Actions"),
]; ];
} }
row(item: Invitation): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.pk}`, const item = this.selectedElements[0];
html`${item.createdBy?.username}`, return html`<ak-forms-delete
html`${item.expires?.toLocaleString() || "-"}`,
html` <ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Invitation`} objectLabel=${t`Invitation`}
.usedBy=${() => { .usedBy=${() => {
@ -71,8 +70,17 @@ export class InvitationListPage extends TablePage<Invitation> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Invitation): TemplateResult[] {
return [
html`${item.pk}`,
html`${item.createdBy?.username}`,
html`${item.expires?.toLocaleString() || "-"}`,
]; ];
} }

View File

@ -28,6 +28,8 @@ export class PromptListPage extends TablePage<Prompt> {
return "pf-icon pf-icon-plugged"; return "pf-icon pf-icon-plugged";
} }
checkbox = true;
@property() @property()
order = "order"; order = "order";
@ -47,10 +49,33 @@ export class PromptListPage extends TablePage<Prompt> {
new TableColumn(t`Type`, "type"), new TableColumn(t`Type`, "type"),
new TableColumn(t`Order`, "order"), new TableColumn(t`Order`, "order"),
new TableColumn(t`Stages`), new TableColumn(t`Stages`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Prompt`}
.usedBy=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsUsedByList({
promptUuid: item.pk,
});
}}
.delete=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsDestroy({
promptUuid: item.pk,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Prompt): TemplateResult[] { row(item: Prompt): TemplateResult[] {
return [ return [
html`${item.fieldKey}`, html`${item.fieldKey}`,
@ -64,24 +89,10 @@ export class PromptListPage extends TablePage<Prompt> {
<span slot="submit"> ${t`Update`} </span> <span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Prompt`} </span> <span slot="header"> ${t`Update Prompt`} </span>
<ak-prompt-form slot="form" .instancePk=${item.pk}> </ak-prompt-form> <ak-prompt-form slot="form" .instancePk=${item.pk}> </ak-prompt-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
</ak-forms-modal> <i class="fas fa-edit"></i>
<ak-forms-delete </button>
.obj=${item} </ak-forms-modal>`,
objectLabel=${t`Prompt`}
.usedBy=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsUsedByList({
promptUuid: item.pk,
});
}}
.delete=${() => {
return new StagesApi(DEFAULT_CONFIG).stagesPromptPromptsDestroy({
promptUuid: item.pk,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>`,
]; ];
} }

View File

@ -56,7 +56,7 @@ export class SystemTaskListPage extends TablePage<Task> {
new TableColumn(t`Description`), new TableColumn(t`Description`),
new TableColumn(t`Last run`), new TableColumn(t`Last run`),
new TableColumn(t`Status`), new TableColumn(t`Status`),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }

View File

@ -27,6 +27,8 @@ export class TenantListPage extends TablePage<Tenant> {
return "pf-icon pf-icon-tenant"; return "pf-icon pf-icon-tenant";
} }
checkbox = true;
@property() @property()
order = "domain"; order = "domain";
@ -43,21 +45,14 @@ export class TenantListPage extends TablePage<Tenant> {
return [ return [
new TableColumn(t`Domain`, "domain"), new TableColumn(t`Domain`, "domain"),
new TableColumn(t`Default?`, "default"), new TableColumn(t`Default?`, "default"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
row(item: Tenant): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.domain}`, const item = this.selectedElements[0];
html`${item._default ? t`Yes` : t`No`}`, return html`<ak-forms-delete
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Tenant`} </span>
<ak-tenant-form slot="form" .instancePk=${item.tenantUuid}> </ak-tenant-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button>
</ak-forms-modal>
<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Tenant`} objectLabel=${t`Tenant`}
.usedBy=${() => { .usedBy=${() => {
@ -71,8 +66,24 @@ export class TenantListPage extends TablePage<Tenant> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete>`, ${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Tenant): TemplateResult[] {
return [
html`${item.domain}`,
html`${item._default ? t`Yes` : t`No`}`,
html` <ak-forms-modal>
<span slot="submit"> ${t`Update`} </span>
<span slot="header"> ${t`Update Tenant`} </span>
<ak-tenant-form slot="form" .instancePk=${item.tenantUuid}> </ak-tenant-form>
<button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal>`,
]; ];
} }

View File

@ -26,6 +26,8 @@ export class TokenListPage extends TablePage<Token> {
return "pf-icon pf-icon-security"; return "pf-icon pf-icon-security";
} }
checkbox = true;
@property() @property()
order = "expires"; order = "expires";
@ -44,18 +46,14 @@ export class TokenListPage extends TablePage<Token> {
new TableColumn(t`User`, "user"), new TableColumn(t`User`, "user"),
new TableColumn(t`Expires?`, "expiring"), new TableColumn(t`Expires?`, "expiring"),
new TableColumn(t`Expiry date`, "expires"), new TableColumn(t`Expiry date`, "expires"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }
row(item: Token): TemplateResult[] { renderToolbarSelected(): TemplateResult {
return [ const disabled = this.selectedElements.length !== 1;
html`${item.identifier}`, const item = this.selectedElements[0];
html`${item.user?.username}`, return html`<ak-forms-delete
html`${item.expiring ? t`Yes` : t`No`}`,
html`${item.expiring ? item.expires?.toLocaleString() : "-"}`,
html`
<ak-forms-delete
.obj=${item} .obj=${item}
objectLabel=${t`Token`} objectLabel=${t`Token`}
.usedBy=${() => { .usedBy=${() => {
@ -69,8 +67,19 @@ export class TokenListPage extends TablePage<Token> {
}); });
}} }}
> >
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button> <button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
</ak-forms-delete> ${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Token): TemplateResult[] {
return [
html`${item.identifier}`,
html`${item.user?.username}`,
html`${item.expiring ? t`Yes` : t`No`}`,
html`${item.expiring ? item.expires?.toLocaleString() : "-"}`,
html`
<ak-token-copy-button identifier="${item.identifier}"> <ak-token-copy-button identifier="${item.identifier}">
${t`Copy Key`} ${t`Copy Key`}
</ak-token-copy-button> </ak-token-copy-button>

View File

@ -21,6 +21,7 @@ export class UserTokenList extends Table<Token> {
} }
expandable = true; expandable = true;
checkbox = true;
@property() @property()
order = "expires"; order = "expires";
@ -94,6 +95,24 @@ export class UserTokenList extends Table<Token> {
<td></td>`; <td></td>`;
} }
renderToolbarSelected(): TemplateResult {
const disabled = this.selectedElements.length !== 1;
const item = this.selectedElements[0];
return html`<ak-forms-delete
.obj=${item}
objectLabel=${t`Token`}
.delete=${() => {
return new CoreApi(DEFAULT_CONFIG).coreTokensDestroy({
identifier: item.identifier,
});
}}
>
<button ?disabled=${disabled} slot="trigger" class="pf-c-button pf-m-danger">
${t`Delete`}
</button>
</ak-forms-delete>`;
}
row(item: Token): TemplateResult[] { row(item: Token): TemplateResult[] {
return [ return [
html`${item.identifier}`, html`${item.identifier}`,
@ -103,19 +122,10 @@ export class UserTokenList extends Table<Token> {
<span slot="header"> ${t`Update Token`} </span> <span slot="header"> ${t`Update Token`} </span>
<ak-user-token-form slot="form" .instancePk=${item.identifier}> <ak-user-token-form slot="form" .instancePk=${item.identifier}>
</ak-user-token-form> </ak-user-token-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">${t`Edit`}</button> <button slot="trigger" class="pf-c-button pf-m-plain">
<i class="fas fa-edit"></i>
</button>
</ak-forms-modal> </ak-forms-modal>
<ak-forms-delete
.obj=${item}
objectLabel=${t`Token`}
.delete=${() => {
return new CoreApi(DEFAULT_CONFIG).coreTokensDestroy({
identifier: item.identifier,
});
}}
>
<button slot="trigger" class="pf-c-button pf-m-danger">${t`Delete`}</button>
</ak-forms-delete>
<ak-token-copy-button identifier="${item.identifier}"> <ak-token-copy-button identifier="${item.identifier}">
${t`Copy Key`} ${t`Copy Key`}
</ak-token-copy-button> </ak-token-copy-button>

View File

@ -58,7 +58,7 @@ export class UserListPage extends TablePage<User> {
new TableColumn(t`Name`, "username"), new TableColumn(t`Name`, "username"),
new TableColumn(t`Active`, "active"), new TableColumn(t`Active`, "active"),
new TableColumn(t`Last login`, "last_login"), new TableColumn(t`Last login`, "last_login"),
new TableColumn("Actions"), new TableColumn(t`Actions`),
]; ];
} }