Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Procurement (Pending Partner Test) #684

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion _redirects
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/cortex/* https://reference.epdemos.com/cortex/:splat 200
/cortex/* https://dev1-cortex-gw.ep-dev.aws.punchout2go-test.com/cortex/:splat 200
/* /index.html 200
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"jest-resolve": "24.8.0",
"jest-watch-typeahead": "0.3.1",
"jquery": "^3.4.1",
"js-cookie": "^2.2.1",
"js-file-download": "^0.4.8",
"less-loader": "^5.0.0",
"less-vars-to-js": "^1.3.0",
Expand Down
22 changes: 19 additions & 3 deletions src/components/src/AppHeaderLogin/appheaderlogin.main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class AppHeaderLoginMain extends Component<AppHeaderLoginMainProps, AppHeaderLog

this.handleModalClose = this.handleModalClose.bind(this);
this.fetchProfileData = this.fetchProfileData.bind(this);
this.getB2cUserName = this.getB2cUserName.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -336,19 +337,32 @@ class AppHeaderLoginMain extends Component<AppHeaderLoginMainProps, AppHeaderLog
});
}

getB2cUserName() {
const { profileData } = this.state;
let b2cUserName = null;

if (profileData && profileData['given-name'] && profileData['family-name']) {
b2cUserName = profileData ? `${profileData['given-name']} ${profileData['family-name']}` : '';
}

return b2cUserName;
}

render() {
const {
isMobileView, permission, onLogin, onResetPassword, onContinueCart, locationSearchData, appHeaderLoginLinks, appModalLoginLinks, isLoggedIn, disableLogin, locationPathName,
} = this.props;
const {
openModal, openCartModal, showForgotPasswordLink, accountData, loginUrlAddress, oidcParameters, showRequisitionListsLink, profileData,
openModal, openCartModal, showForgotPasswordLink, accountData, loginUrlAddress, oidcParameters, showRequisitionListsLink,
} = this.state;
let keycloakLoginRedirectUrl = '';
if (Config.b2b.enable && Config.b2b.openId && !Config.b2b.openId.enable) {
keycloakLoginRedirectUrl = `${Config.b2b.keycloak.loginRedirectUrl}?client_id=${Config.b2b.keycloak.client_id}&response_type=code&scope=openid&redirect_uri=${encodeURIComponent(Config.b2b.keycloak.callbackUrl)}`;
}
const userName = localStorage.getItem(`${Config.cortexApi.scope}_oAuthUserName`) || localStorage.getItem(`${Config.cortexApi.scope}_oAuthUserId`);
const b2cUserName = profileData ? `${profileData['given-name']} ${profileData['family-name']}` : '';

const b2cUserName = this.getB2cUserName();

const b2bUserName = accountData ? accountData._myprofile && accountData._myprofile[0].name : '';
const email = accountData && accountData._myprofile && accountData._myprofile[0]._primaryemail[0].email;

Expand Down Expand Up @@ -398,7 +412,9 @@ class AppHeaderLoginMain extends Component<AppHeaderLoginMainProps, AppHeaderLog
</li>
) : (
<li className="dropdown-item shop-for b2c">
<span className="user-name">{b2cUserName}</span>
{b2cUserName !== 'undefined' ? (
<span className="user-name">{b2cUserName}</span>
) : ('')}
{userName !== 'undefined' ? (
<span className="email-title">{userName}</span>
) : ('')}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"self": {
"type": "carts.cart",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
},
"messages": [],
"links": [{
"rel": "lineitems",
"rev": "cart",
"type": "carts.line-items",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/lineitems",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/lineitems"
}, {
"rel": "additemstocartform",
"type": "carts.add-items-to-cart-form",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/form",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/form"
}, {
"rel": "descriptor",
"type": "carts.cart-descriptor",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor"
}, {
"rel": "discount",
"rev": "cart",
"type": "discounts.discount-for-cart",
"uri": "/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}, {
"rel": "order",
"rev": "cart",
"type": "orders.order",
"uri": "/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=",
"href": "https://reference.epdemos.com/cortex/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi="
}, {
"rel": "appliedpromotions",
"rev": "cart",
"type": "promotions.applied-promotions-for-cart",
"uri": "/promotions/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/applied",
"href": "https://reference.epdemos.com/cortex/promotions/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/applied"
}, {
"rel": "total",
"rev": "cart",
"type": "totals.cart-total",
"uri": "/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}],
"_descriptor": [{
"self": {
"type": "carts.cart-descriptor",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor"
},
"cart-transfer-url": "https://connect.procurement.com/gateway/link/return/id/AH5e39b48e23f3d",
"messages": [],
"links": [],
"default": "true"
}],
"_discount": [{
"self": {
"type": "discounts.discount-for-cart",
"uri": "/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
},
"messages": [],
"links": [{
"rel": "cart",
"rev": "discount",
"type": "carts.cart",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}],
"discount": [{
"amount": 0,
"currency": "USD",
"display": "$0.00"
}]
}],
"_order": [{
"_couponinfo": [{
"_couponform": [{
"self": {
"type": "coupons.apply-coupon-to-order-form",
"uri": "/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form",
"href": "https://reference.epdemos.com/cortex/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form"
},
"messages": [],
"links": [{
"rel": "applycouponaction",
"type": "coupons.apply-coupon-to-order-form",
"uri": "/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form",
"href": "https://reference.epdemos.com/cortex/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form"
}],
"code": ""
}]
}]
}],
"_total": [{
"self": {
"type": "totals.cart-total",
"uri": "/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
},
"messages": [],
"links": [{
"rel": "cart",
"rev": "total",
"type": "carts.cart",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}],
"cost": [{
"amount": 0,
"currency": "USD",
"display": "$0.00"
}]
}],
"total-quantity": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"self": {
"type": "carts.cart",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
},
"messages": [],
"links": [{
"rel": "lineitems",
"rev": "cart",
"type": "carts.line-items",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/lineitems",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/lineitems"
}, {
"rel": "additemstocartform",
"type": "carts.add-items-to-cart-form",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/form",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/form"
}, {
"rel": "descriptor",
"type": "carts.cart-descriptor",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor"
}, {
"rel": "discount",
"rev": "cart",
"type": "discounts.discount-for-cart",
"uri": "/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}, {
"rel": "order",
"rev": "cart",
"type": "orders.order",
"uri": "/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=",
"href": "https://reference.epdemos.com/cortex/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi="
}, {
"rel": "appliedpromotions",
"rev": "cart",
"type": "promotions.applied-promotions-for-cart",
"uri": "/promotions/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/applied",
"href": "https://reference.epdemos.com/cortex/promotions/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/applied"
}, {
"rel": "total",
"rev": "cart",
"type": "totals.cart-total",
"uri": "/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}],
"_descriptor": [{
"self": {
"type": "carts.cart-descriptor",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=/descriptor"
},
"messages": [],
"links": [],
"default": "true"
}],
"_discount": [{
"self": {
"type": "discounts.discount-for-cart",
"uri": "/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/discounts/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
},
"messages": [],
"links": [{
"rel": "cart",
"rev": "discount",
"type": "carts.cart",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}],
"discount": [{
"amount": 0,
"currency": "USD",
"display": "$0.00"
}]
}],
"_order": [{
"_couponinfo": [{
"_couponform": [{
"self": {
"type": "coupons.apply-coupon-to-order-form",
"uri": "/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form",
"href": "https://reference.epdemos.com/cortex/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form"
},
"messages": [],
"links": [{
"rel": "applycouponaction",
"type": "coupons.apply-coupon-to-order-form",
"uri": "/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form",
"href": "https://reference.epdemos.com/cortex/coupons/orders/vestri/gm4tenjzmvrtmljuga4tkljuguytollbmvqwcljqgiydsnjwmvrdeojrmi=/form"
}],
"code": ""
}]
}]
}],
"_total": [{
"self": {
"type": "totals.cart-total",
"uri": "/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/totals/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
},
"messages": [],
"links": [{
"rel": "cart",
"rev": "total",
"type": "carts.cart",
"uri": "/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu=",
"href": "https://reference.epdemos.com/cortex/carts/vestri/mrstazjqgbrwcllcg5staljuha3doljzgzqtkllfha2gmnjwgu4genjsmu="
}],
"cost": [{
"amount": 0,
"currency": "USD",
"display": "$0.00"
}]
}],
"total-quantity": 1
}
Loading