diff --git a/web/src/AdapterEditPage.js b/web/src/AdapterEditPage.js index 29b3680d..dbdd734f 100644 --- a/web/src/AdapterEditPage.js +++ b/web/src/AdapterEditPage.js @@ -272,7 +272,7 @@ class AdapterEditPage extends React.Component { ); } - submitAdapterEdit(willExist) { + submitAdapterEdit(exitAfterSave) { const adapter = Setting.deepCopy(this.state.adapter); AdapterBackend.updateAdapter(this.state.organizationName, this.state.adapterName, adapter) .then((res) => { @@ -282,7 +282,7 @@ class AdapterEditPage extends React.Component { adapterName: this.state.adapter.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/adapters"); } else { this.props.history.push(`/adapters/${this.state.organizationName}/${this.state.adapter.name}`); diff --git a/web/src/ApplicationEditPage.js b/web/src/ApplicationEditPage.js index 9ab282e7..85a09865 100644 --- a/web/src/ApplicationEditPage.js +++ b/web/src/ApplicationEditPage.js @@ -1001,7 +1001,7 @@ class ApplicationEditPage extends React.Component { ); } - submitApplicationEdit(willExist) { + submitApplicationEdit(exitAfterSave) { const application = Setting.deepCopy(this.state.application); application.providers = application.providers?.filter(provider => this.state.providers.map(provider => provider.name).includes(provider.name)); @@ -1013,7 +1013,7 @@ class ApplicationEditPage extends React.Component { applicationName: this.state.application.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/applications"); } else { this.props.history.push(`/applications/${this.state.application.organization}/${this.state.application.name}`); diff --git a/web/src/CertEditPage.js b/web/src/CertEditPage.js index 08be9d95..ecc6eb69 100644 --- a/web/src/CertEditPage.js +++ b/web/src/CertEditPage.js @@ -251,7 +251,7 @@ class CertEditPage extends React.Component { ); } - submitCertEdit(willExist) { + submitCertEdit(exitAfterSave) { const cert = Setting.deepCopy(this.state.cert); CertBackend.updateCert(this.state.owner, this.state.certName, cert) .then((res) => { @@ -261,7 +261,7 @@ class CertEditPage extends React.Component { certName: this.state.cert.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/certs"); } else { this.props.history.push(`/certs/${this.state.cert.owner}/${this.state.cert.name}`); diff --git a/web/src/EnforcerEditPage.js b/web/src/EnforcerEditPage.js index 35e634e5..7ca30c74 100644 --- a/web/src/EnforcerEditPage.js +++ b/web/src/EnforcerEditPage.js @@ -198,7 +198,7 @@ class EnforcerEditPage extends React.Component { ); } - submitEnforcerEdit(willExist) { + submitEnforcerEdit(exitAfterSave) { const enforcer = Setting.deepCopy(this.state.enforcer); EnforcerBackend.updateEnforcer(this.state.organizationName, this.state.enforcerName, enforcer) .then((res) => { @@ -208,7 +208,7 @@ class EnforcerEditPage extends React.Component { enforcerName: this.state.enforcer.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/enforcers"); } else { this.props.history.push(`/enforcers/${this.state.enforcer.owner}/${this.state.enforcer.name}`); diff --git a/web/src/GroupEdit.js b/web/src/GroupEdit.js index da2e182e..27dfd870 100644 --- a/web/src/GroupEdit.js +++ b/web/src/GroupEdit.js @@ -191,7 +191,7 @@ class GroupEditPage extends React.Component { ); } - submitGroupEdit(willExist) { + submitGroupEdit(exitAfterSave) { const group = Setting.deepCopy(this.state.group); group["isTopGroup"] = this.state.organizations.some((organization) => organization.name === group.parentId); @@ -203,7 +203,7 @@ class GroupEditPage extends React.Component { groupName: this.state.group.name, }); - if (willExist) { + if (exitAfterSave) { const groupTreeUrl = sessionStorage.getItem("groupTreeUrl"); if (groupTreeUrl !== null) { sessionStorage.removeItem("groupTreeUrl"); diff --git a/web/src/LdapEditPage.js b/web/src/LdapEditPage.js index 23ed9494..88b6d4c0 100644 --- a/web/src/LdapEditPage.js +++ b/web/src/LdapEditPage.js @@ -230,7 +230,7 @@ class LdapEditPage extends React.Component { ); } - submitLdapEdit(willExist) { + submitLdapEdit(exitAfterSave) { LddpBackend.updateLdap(this.state.ldap) .then((res) => { if (res.status === "ok") { @@ -239,7 +239,7 @@ class LdapEditPage extends React.Component { organizationName: this.state.ldap.owner, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push(`/organizations/${this.state.organizationName}`); } } else { diff --git a/web/src/ModelEditPage.js b/web/src/ModelEditPage.js index d9f57918..211df394 100644 --- a/web/src/ModelEditPage.js +++ b/web/src/ModelEditPage.js @@ -165,7 +165,7 @@ class ModelEditPage extends React.Component { ); } - submitModelEdit(willExist) { + submitModelEdit(exitAfterSave) { const model = Setting.deepCopy(this.state.model); ModelBackend.updateModel(this.state.organizationName, this.state.modelName, model) .then((res) => { @@ -175,7 +175,7 @@ class ModelEditPage extends React.Component { modelName: this.state.model.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/models"); } else { this.props.history.push(`/models/${this.state.model.owner}/${this.state.model.name}`); diff --git a/web/src/OrganizationEditPage.js b/web/src/OrganizationEditPage.js index 116d43f1..89613e1a 100644 --- a/web/src/OrganizationEditPage.js +++ b/web/src/OrganizationEditPage.js @@ -411,7 +411,7 @@ class OrganizationEditPage extends React.Component { ); } - submitOrganizationEdit(willExist) { + submitOrganizationEdit(exitAfterSave) { const organization = Setting.deepCopy(this.state.organization); organization.accountItems = organization.accountItems?.filter(accountItem => accountItem.name !== "Please select an account item"); @@ -429,7 +429,7 @@ class OrganizationEditPage extends React.Component { }); window.dispatchEvent(new Event("storageOrganizationsChanged")); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/organizations"); } else { this.props.history.push(`/organizations/${this.state.organization.name}`); diff --git a/web/src/PaymentEditPage.js b/web/src/PaymentEditPage.js index cee277f5..e6bf0d92 100644 --- a/web/src/PaymentEditPage.js +++ b/web/src/PaymentEditPage.js @@ -438,7 +438,7 @@ class PaymentEditPage extends React.Component { return ""; } - submitPaymentEdit(willExist) { + submitPaymentEdit(exitAfterSave) { const errorText = this.checkError(); if (errorText !== "") { Setting.showMessage("error", errorText); @@ -454,7 +454,7 @@ class PaymentEditPage extends React.Component { paymentName: this.state.payment.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/payments"); } else { this.props.history.push(`/payments/${this.state.payment.name}`); diff --git a/web/src/PermissionEditPage.js b/web/src/PermissionEditPage.js index 5aa259c8..6a774eb6 100644 --- a/web/src/PermissionEditPage.js +++ b/web/src/PermissionEditPage.js @@ -444,7 +444,7 @@ class PermissionEditPage extends React.Component { ); } - submitPermissionEdit(willExist) { + submitPermissionEdit(exitAfterSave) { if (this.state.permission.users.length === 0 && this.state.permission.roles.length === 0) { Setting.showMessage("error", "The users and roles cannot be empty at the same time"); return; @@ -475,7 +475,7 @@ class PermissionEditPage extends React.Component { permissionName: this.state.permission.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/permissions"); } else { this.props.history.push(`/permissions/${this.state.permission.owner}/${encodeURIComponent(this.state.permission.name)}`); diff --git a/web/src/PlanEditPage.js b/web/src/PlanEditPage.js index e96abad3..2378f192 100644 --- a/web/src/PlanEditPage.js +++ b/web/src/PlanEditPage.js @@ -263,7 +263,7 @@ class PlanEditPage extends React.Component { ); } - submitPlanEdit(willExist) { + submitPlanEdit(exitAfterSave) { const plan = Setting.deepCopy(this.state.plan); PlanBackend.updatePlan(this.state.organizationName, this.state.planName, plan) .then((res) => { @@ -273,7 +273,7 @@ class PlanEditPage extends React.Component { planName: this.state.plan.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/plans"); } else { this.props.history.push(`/plans/${this.state.plan.owner}/${this.state.plan.name}`); diff --git a/web/src/PricingEditPage.js b/web/src/PricingEditPage.js index 54a11938..8b3375c0 100644 --- a/web/src/PricingEditPage.js +++ b/web/src/PricingEditPage.js @@ -226,7 +226,7 @@ class PricingEditPage extends React.Component { ); } - submitPricingEdit(willExist) { + submitPricingEdit(exitAfterSave) { const pricing = Setting.deepCopy(this.state.pricing); PricingBackend.updatePricing(this.state.organizationName, this.state.pricingName, pricing) .then((res) => { @@ -236,7 +236,7 @@ class PricingEditPage extends React.Component { pricingName: this.state.pricing.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/pricings"); } else { this.props.history.push(`/pricings/${this.state.pricing.owner}/${this.state.pricing.name}`); diff --git a/web/src/ProductEditPage.js b/web/src/ProductEditPage.js index ec7efdbd..fe56b610 100644 --- a/web/src/ProductEditPage.js +++ b/web/src/ProductEditPage.js @@ -311,7 +311,7 @@ class ProductEditPage extends React.Component { ); } - submitProductEdit(willExist) { + submitProductEdit(exitAfterSave) { const product = Setting.deepCopy(this.state.product); ProductBackend.updateProduct(this.state.organizationName, this.state.productName, product) .then((res) => { @@ -321,7 +321,7 @@ class ProductEditPage extends React.Component { productName: this.state.product.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/products"); } else { this.props.history.push(`/products/${this.state.product.owner}/${this.state.product.name}`); diff --git a/web/src/ProviderEditPage.js b/web/src/ProviderEditPage.js index f6ec64c6..9f03ad93 100644 --- a/web/src/ProviderEditPage.js +++ b/web/src/ProviderEditPage.js @@ -1198,7 +1198,7 @@ class ProviderEditPage extends React.Component { ); } - submitProviderEdit(willExist) { + submitProviderEdit(exitAfterSave) { const provider = Setting.deepCopy(this.state.provider); ProviderBackend.updateProvider(this.state.owner, this.state.providerName, provider) .then((res) => { @@ -1209,7 +1209,7 @@ class ProviderEditPage extends React.Component { providerName: this.state.provider.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/providers"); } else { this.props.history.push(`/providers/${this.state.provider.owner}/${this.state.provider.name}`); diff --git a/web/src/RoleEditPage.js b/web/src/RoleEditPage.js index 3b292adf..f82a6b98 100644 --- a/web/src/RoleEditPage.js +++ b/web/src/RoleEditPage.js @@ -240,7 +240,7 @@ class RoleEditPage extends React.Component { ); } - submitRoleEdit(willExist) { + submitRoleEdit(exitAfterSave) { const role = Setting.deepCopy(this.state.role); RoleBackend.updateRole(this.state.organizationName, this.state.roleName, role) .then((res) => { @@ -250,7 +250,7 @@ class RoleEditPage extends React.Component { roleName: this.state.role.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/roles"); } else { this.props.history.push(`/roles/${this.state.role.owner}/${encodeURIComponent(this.state.role.name)}`); diff --git a/web/src/SubscriptionEditPage.js b/web/src/SubscriptionEditPage.js index a582299d..0e9dbdec 100644 --- a/web/src/SubscriptionEditPage.js +++ b/web/src/SubscriptionEditPage.js @@ -294,7 +294,7 @@ class SubscriptionEditPage extends React.Component { ); } - submitSubscriptionEdit(willExist) { + submitSubscriptionEdit(exitAfterSave) { const subscription = Setting.deepCopy(this.state.subscription); SubscriptionBackend.updateSubscription(this.state.organizationName, this.state.subscriptionName, subscription) .then((res) => { @@ -304,7 +304,7 @@ class SubscriptionEditPage extends React.Component { subscriptionName: this.state.subscription.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/subscriptions"); } else { this.props.history.push(`/subscriptions/${this.state.subscription.owner}/${this.state.subscription.name}`); diff --git a/web/src/SyncerEditPage.js b/web/src/SyncerEditPage.js index b354e7aa..eefcac96 100644 --- a/web/src/SyncerEditPage.js +++ b/web/src/SyncerEditPage.js @@ -425,7 +425,7 @@ class SyncerEditPage extends React.Component { ); } - submitSyncerEdit(willExist) { + submitSyncerEdit(exitAfterSave) { const syncer = Setting.deepCopy(this.state.syncer); SyncerBackend.updateSyncer(this.state.syncer.owner, this.state.syncerName, syncer) .then((res) => { @@ -435,7 +435,7 @@ class SyncerEditPage extends React.Component { syncerName: this.state.syncer.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/syncers"); } else { this.props.history.push(`/syncers/${this.state.syncer.name}`); diff --git a/web/src/TokenEditPage.js b/web/src/TokenEditPage.js index 712ba22d..fe03bbc3 100644 --- a/web/src/TokenEditPage.js +++ b/web/src/TokenEditPage.js @@ -173,7 +173,7 @@ class TokenEditPage extends React.Component { ); } - submitTokenEdit(willExist) { + submitTokenEdit(exitAfterSave) { const token = Setting.deepCopy(this.state.token); TokenBackend.updateToken(this.state.token.owner, this.state.tokenName, token) .then((res) => { @@ -183,7 +183,7 @@ class TokenEditPage extends React.Component { tokenName: this.state.token.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/tokens"); } else { this.props.history.push(`/tokens/${this.state.token.name}`); diff --git a/web/src/UserEditPage.js b/web/src/UserEditPage.js index f0e90cba..e8e0a9df 100644 --- a/web/src/UserEditPage.js +++ b/web/src/UserEditPage.js @@ -1043,7 +1043,7 @@ class UserEditPage extends React.Component { } } - submitUserEdit(needExit) { + submitUserEdit(exitAfterSave) { const user = Setting.deepCopy(this.state.user); UserBackend.updateUser(this.state.organizationName, this.state.userName, user) .then((res) => { @@ -1055,7 +1055,7 @@ class UserEditPage extends React.Component { }); if (this.props.history !== undefined) { - if (needExit) { + if (exitAfterSave) { const userListUrl = sessionStorage.getItem("userListUrl"); if (userListUrl !== null) { this.props.history.push(userListUrl); @@ -1066,7 +1066,7 @@ class UserEditPage extends React.Component { this.props.history.push(`/users/${this.state.user.owner}/${this.state.user.name}`); } } else { - if (needExit) { + if (exitAfterSave) { if (this.state.returnUrl) { window.location.href = this.state.returnUrl; } diff --git a/web/src/WebhookEditPage.js b/web/src/WebhookEditPage.js index 45ae855b..90d03917 100644 --- a/web/src/WebhookEditPage.js +++ b/web/src/WebhookEditPage.js @@ -322,7 +322,7 @@ class WebhookEditPage extends React.Component { ); } - submitWebhookEdit(willExist) { + submitWebhookEdit(exitAfterSave) { const webhook = Setting.deepCopy(this.state.webhook); WebhookBackend.updateWebhook(this.state.webhook.owner, this.state.webhookName, webhook) .then((res) => { @@ -332,7 +332,7 @@ class WebhookEditPage extends React.Component { webhookName: this.state.webhook.name, }); - if (willExist) { + if (exitAfterSave) { this.props.history.push("/webhooks"); } else { this.props.history.push(`/webhooks/${this.state.webhook.name}`);