-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into migrate-promo-banner-fromCAEMtoC4IBM
- Loading branch information
Showing
35 changed files
with
1,463 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,22 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [2.15.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-services | ||
|
||
|
||
|
||
|
||
|
||
# [2.15.0-rc.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-services | ||
|
||
|
||
|
||
|
||
|
||
# [2.14.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-10-25) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-services | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* @license | ||
* | ||
* Copyright IBM Corp. 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import Cookies from 'js-cookie'; | ||
|
||
const _cookieName = 'activeCartId'; | ||
|
||
class SAPCommerceAPI { | ||
/** | ||
* Check if the user has an active cart by looking for the non-empty cookie. | ||
* | ||
* @returns {boolean} | ||
*/ | ||
static hasActiveCart() { | ||
const activeCartId = SAPCommerceAPI.getActiveCartId(); | ||
// Return true if the activeCartId cookie is non-empty. | ||
return activeCartId !== ''; | ||
} | ||
|
||
/** | ||
* Returns the active cart id. | ||
* | ||
* @returns {string} | ||
* The active cart id if there is one, otherwise empty string. | ||
*/ | ||
static getActiveCartId() { | ||
const activeCartId = Cookies.get(_cookieName); | ||
return activeCartId && typeof activeCartId === 'string' | ||
? activeCartId.trim() | ||
: ''; | ||
} | ||
|
||
/** | ||
* Set the active cart id. | ||
* | ||
* @param {string} activeCartId | ||
* The active cart id. | ||
*/ | ||
static setActiveCartId(activeCartId) { | ||
Cookies.set(_cookieName, activeCartId.trim()); | ||
} | ||
|
||
/** | ||
* Remove the active cart id. | ||
*/ | ||
static removeActiveCartId() { | ||
Cookies.remove(_cookieName); | ||
} | ||
} | ||
|
||
export default SAPCommerceAPI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @license | ||
* | ||
* Copyright IBM Corp. 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
export { default as SAPCommerceAPI } from './SAPCommerce.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,26 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [2.15.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-styles | ||
|
||
|
||
|
||
|
||
|
||
# [2.15.0-rc.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* **deps:** update dependency @carbon/icons-react to v11.51.0 ([#12072](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/12072)) ([5f11b87](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/commit/5f11b87366a75b203874991438e31f7c902f48ed)) | ||
* **deps:** update dependency @carbon/layout to v11.27.0 ([#12073](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/12073)) ([321a1e2](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/commit/321a1e25b6be654cd096fc8c2b9b0980effff669)) | ||
|
||
|
||
|
||
|
||
|
||
# [2.14.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-10-25) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,22 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [2.15.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-utilities | ||
|
||
|
||
|
||
|
||
|
||
# [2.15.0-rc.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-utilities | ||
|
||
|
||
|
||
|
||
|
||
# [2.14.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-10-25) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-utilities | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,26 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [2.15.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
**Note:** Version bump only for package @carbon/ibmdotcom-web-components | ||
|
||
|
||
|
||
|
||
|
||
# [2.15.0-rc.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-11-05) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* **cta:** prevent an infinate loop of fetching video details ([#12084](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/12084)) ([9964cf1](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/commit/9964cf1130ea56d4ef1fcb9cc57526b953860a60)) | ||
* **deps:** update dependency @carbon/layout to v11.27.0 ([#12073](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/12073)) ([321a1e2](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/commit/321a1e25b6be654cd096fc8c2b9b0980effff669)) | ||
|
||
|
||
|
||
|
||
|
||
# [2.14.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/[email protected]...@carbon/[email protected]) (2024-10-25) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.