Skip to content

Commit

Permalink
feat: update order number href
Browse files Browse the repository at this point in the history
  • Loading branch information
NawfalAhmed committed Apr 2, 2024
1 parent da37a62 commit 2a5d16c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BASE_URL=null
FEATURE_CONFIGURATION_MANAGEMENT=''
FEATURE_CONFIGURATION_ENTERPRISE_PROVISION=''
FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION=''
COMMERCE_COORDINATOR_ORDER_DETAILS_URL=''
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 @@ -5,6 +5,7 @@ BASE_URL='http://localhost:18450'
FEATURE_CONFIGURATION_MANAGEMENT='true'
FEATURE_CONFIGURATION_ENTERPRISE_PROVISION='true'
FEATURE_CONFIGURATION_EDIT_ENTERPRISE_PROVISION='true'
COMMERCE_COORDINATOR_ORDER_DETAILS_URL='http://localhost:8140/lms/order_details_page_redirect'
CREDENTIALS_BASE_URL='http://localhost:18150'
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
ECOMMERCE_BASE_URL='http://localhost:18130'
Expand Down
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ initialize({
handlers: {
config: () => {
mergeConfig({
COMMERCE_COORDINATOR_ORDER_DETAILS_URL: process.env.COMMERCE_COORDINATOR_ORDER_DETAILS_URL || null,
LICENSE_MANAGER_URL: process.env.LICENSE_MANAGER_URL || null,
ENTERPRISE_ACCESS_BASE_URL: process.env.ENTERPRISE_ACCESS_BASE_URL || null,
FEATURE_CONFIGURATION_MANAGEMENT: process.env.FEATURE_CONFIGURATION_MANAGEMENT || hasFeatureFlagEnabled('FEATURE_CONFIGURATION_MANAGEMENT') || null,
Expand Down
18 changes: 16 additions & 2 deletions src/users/enrollments/Enrollments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,22 @@ export default function Enrollments({
Header: 'Reason', accessor: 'reason',
},
{
// eslint-disable-next-line react/prop-types
Header: 'Order Number', accessor: 'orderNumber', Cell: ({ value }) => <a href={`${getConfig().ECOMMERCE_BASE_URL}/dashboard/orders/${value}`} rel="noopener noreferrer" target="_blank" className="word_break">{value}</a>,
Header: 'Order Number',
accessor: 'orderNumber',
Cell: ({ value }) => (
<a
href={
getConfig().COMMERCE_COORDINATOR_ORDER_DETAILS_URL
? `${getConfig().COMMERCE_COORDINATOR_ORDER_DETAILS_URL}/?order_number=${value}`
: `${getConfig().ECOMMERCE_BASE_URL}/dashboard/orders/${value}`
}
rel="noopener noreferrer"
target="_blank"
className="word_break"
>
{value}
</a>
),
},
],
[],
Expand Down

0 comments on commit 2a5d16c

Please sign in to comment.