From 35e01363543c1b42a757a723beacf3a9cbab8595 Mon Sep 17 00:00:00 2001 From: Hamzah Ullah Date: Wed, 28 Jun 2023 09:13:43 -0400 Subject: [PATCH] feat: feature flags edit button on datatable --- .env | 1 + .env.development | 1 + .../Provisioning/DashboardDatatable.jsx | 20 +++++++++---------- src/index.jsx | 1 + 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 2731a3bd5..eb03380d0 100644 --- a/.env +++ b/.env @@ -3,6 +3,7 @@ ACCESS_TOKEN_COOKIE_NAME=null BASE_URL=null FEATURE_CONFIGURATION_MANAGEMENT='' FEATURE_CONFIGURATION_ENTERPRISE_PROVISION='' +FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION='' CREDENTIALS_BASE_URL=null CSRF_TOKEN_API_PATH=null ECOMMERCE_BASE_URL=null diff --git a/.env.development b/.env.development index 864ea576f..d362f9738 100644 --- a/.env.development +++ b/.env.development @@ -4,6 +4,7 @@ ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload' BASE_URL='http://localhost:18450' FEATURE_CONFIGURATION_MANAGEMENT='true' FEATURE_CONFIGURATION_ENTERPRISE_PROVISION='true' +FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION='true' CREDENTIALS_BASE_URL='http://localhost:18150' CSRF_TOKEN_API_PATH='/csrf/api/v1/token' ECOMMERCE_BASE_URL='http://localhost:18130' diff --git a/src/Configuration/Provisioning/DashboardDatatable.jsx b/src/Configuration/Provisioning/DashboardDatatable.jsx index 49388edf0..8deee40be 100644 --- a/src/Configuration/Provisioning/DashboardDatatable.jsx +++ b/src/Configuration/Provisioning/DashboardDatatable.jsx @@ -17,17 +17,17 @@ const TableActions = (args) => { const rowUuid = args.row.values.uuid; const { DJANGO_ADMIN_SUBSIDY_BASE_URL } = getConfig(); const history = useHistory(); - return [ - history.push(`/enterprise-configuration/learner-credit/${rowUuid}/edit`)} - alt="Edit Subsidy Icon Button" - - />, + getConfig().FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION && ( + history.push(`/enterprise-configuration/learner-credit/${rowUuid}/edit`)} + alt="Edit Subsidy Icon Button" + /> + ),