Skip to content

Commit

Permalink
feat: feature flags edit button on datatable
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 committed Jun 28, 2023
1 parent bf212f8 commit 35e0136
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
20 changes: 10 additions & 10 deletions src/Configuration/Provisioning/DashboardDatatable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ const TableActions = (args) => {
const rowUuid = args.row.values.uuid;
const { DJANGO_ADMIN_SUBSIDY_BASE_URL } = getConfig();
const history = useHistory();

return [

Check warning on line 20 in src/Configuration/Provisioning/DashboardDatatable.jsx

View check run for this annotation

Codecov / codecov/patch

src/Configuration/Provisioning/DashboardDatatable.jsx#L17-L20

Added lines #L17 - L20 were not covered by tests
<IconButton
key="edit-icon"
size="sm"
src={EditOutline}
iconAs={Icon}
onClick={() => history.push(`/enterprise-configuration/learner-credit/${rowUuid}/edit`)}
alt="Edit Subsidy Icon Button"

/>,
getConfig().FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION && (
<IconButton

Check warning on line 22 in src/Configuration/Provisioning/DashboardDatatable.jsx

View check run for this annotation

Codecov / codecov/patch

src/Configuration/Provisioning/DashboardDatatable.jsx#L22

Added line #L22 was not covered by tests
key="edit-icon"
size="sm"
src={EditOutline}
iconAs={Icon}
onClick={() => history.push(`/enterprise-configuration/learner-credit/${rowUuid}/edit`)}

Check warning on line 27 in src/Configuration/Provisioning/DashboardDatatable.jsx

View check run for this annotation

Codecov / codecov/patch

src/Configuration/Provisioning/DashboardDatatable.jsx#L27

Added line #L27 was not covered by tests
alt="Edit Subsidy Icon Button"
/>
),
<Hyperlink
key="django-icon"
destination={`${DJANGO_ADMIN_SUBSIDY_BASE_URL}/admin/subsidy/subsidy/?uuid=${rowUuid}`}
Expand Down
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ initialize({
ENTERPRISE_ACCESS_BASE_URL: process.env.ENTERPRISE_ACCESS_BASE_URL || null,
FEATURE_CONFIGURATION_MANAGEMENT: process.env.FEATURE_CONFIGURATION_MANAGEMENT || hasFeatureFlagEnabled('FEATURE_CONFIGURATION_MANAGEMENT') || null,
FEATURE_CONFIGURATION_ENTERPRISE_PROVISION: process.env.FEATURE_CONFIGURATION_ENTERPRISE_PROVISION || hasFeatureFlagEnabled('FEATURE_CONFIGURATION_ENTERPRISE_PROVISION') || null,
FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION: process.env.FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION || hasFeatureFlagEnabled('FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION') || null,
SUBSIDY_BASE_URL: process.env.SUBSIDY_BASE_URL || null,
});
},
Expand Down

0 comments on commit 35e0136

Please sign in to comment.