Skip to content

[AdobeDocs Approval] Dev doc update after upgrading eslint version to 9 #366

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .remarkrc.mjs

This file was deleted.

8 changes: 8 additions & 0 deletions .remarkrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins:
- remark-heading-id
- remark-validate-links
- remark-frontmatter
- - remark-lint-frontmatter-schema
- schemas:
./.github/linters/metadata.schema.yml:
- ./src/pages/**/*.md
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ To build the site locally:
yarn dev
```

## Components

To achieve specific user experience goals for Commerce documentation, this repo overrides the original [`Edition`](https://github.com/adobe/aio-theme/blob/main/packages/gatsby-theme-aio/src/components/Edition/index.js) component from the upstream [`aio-theme`](https://github.com/adobe/aio-theme/) repo that we use as a dependency.

### Edition

The custom `Edition` component in this repo displays a badge indicating whether a feature or functionality is available in specific Adobe Commerce environments. It has been customized to align with the badges that we use in Experience League docs.

#### Usage

```yaml
# Page-level (metadata)
edition: saas # For SaaS-only features
edition: paas # For PaaS-only features
```

```md
<!-- Section-level (inline) -->
<Edition name="paas" /> <!-- For PaaS-only features -->
<Edition name="saas" /> <!-- For SaaS-only features -->
```

## Resources

See the following resources to learn more about using the theme:
Expand Down
26 changes: 26 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

import React from 'react';
import { MDXProvider } from '@mdx-js/react';
import { Edition } from './src/@adobe/gatsby-theme-aio/components/Edition';

// Define the components that will be available in MDX files
const components = {
// Register the Edition component for inline use
Edition
};

// Wrap the root element with the MDXProvider
export const wrapRootElement = ({ element }) => {
return <MDXProvider components={components}>{element}</MDXProvider>;
};
20 changes: 13 additions & 7 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Adobe. All rights reserved.
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -11,10 +11,16 @@
*/

import React from 'react';
import {withPrefix} from 'gatsby';
import { MDXProvider } from '@mdx-js/react';
import { Edition } from './src/@adobe/gatsby-theme-aio/components/Edition';

export const onRenderBody = ({setHeadComponents}) => {
setHeadComponents([
<script src={withPrefix('/redirections.js')}></script>
]);
};
// Define the components that will be available in MDX files
const components = {
// Register the Edition component for inline use
Edition
};

// Wrap the root element with the MDXProvider
export const wrapRootElement = ({ element }) => {
return <MDXProvider components={components}>{element}</MDXProvider>;
};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"remark-frontmatter": "^5.0.0",
"remark-heading-id": "^1.0.1",
"remark-lint-frontmatter-schema": "^3.15.4",
"remark-lint-no-dead-urls": "^1.1.0",
"remark-validate-links": "^13.0.1"
"remark-validate-links": "13.0.1"
},
"scripts": {
"start": "NODE_OPTIONS='--max-old-space-size=8192' gatsby build && gatsby serve",
Expand Down
71 changes: 71 additions & 0 deletions src/@adobe/gatsby-theme-aio/components/Edition/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

import React from 'react';
import PropTypes from 'prop-types';
import '@spectrum-css/badge';
import '@spectrum-css/link';
import '@spectrum-css/tooltip';

let editionText = '';
let editionColor = '';
let editionTooltip = '';
const EDITIONS_LINK = 'https://experienceleague.adobe.com/en/docs/commerce/user-guides/product-solutions';

const Edition = ({ ...props }) => {
switch (props.name) {
case 'paas':
editionText = 'PaaS only';
editionColor = 'spectrum-Badge--informative';
editionTooltip = 'Applies to Adobe Commerce on Cloud (Adobe-managed PaaS infrastructure) and on-premises projects only.';
break;
case 'saas':
editionText = 'SaaS only';
editionColor = 'spectrum-Badge--positive';
editionTooltip = 'Applies to Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer projects only (Adobe-managed SaaS infrastructure).';
break;
default:
editionText = 'Create an Edition tag';
editionColor = 'spectrum-Badge--yellow';
editionTooltip = '';
}

return (
<a
href={EDITIONS_LINK}
className="spectrum-Link"
target="_blank"
rel="noreferrer"
style={{
textDecoration: 'none',
display: 'inline-block',
marginTop: '1rem',
marginRight: '0.5rem',
position: 'relative'
}}
title={editionTooltip}
>
<span
className={`spectrum-Badge spectrum-Badge--sizeS ${editionColor}`}
style={{ paddingBottom: '4px', cursor: 'pointer' }}
>
{editionText}
</span>
</a>
);
};

Edition.propTypes = {
name: PropTypes.string
};

export { Edition };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### Class changes {#ee-240-241-class}
### Class changes {#ee-240-241-class}

| What changed | How it changed |
| -------------------------------------------------------------------- | ------------------------------------ |
Expand All @@ -11,7 +11,7 @@
| Magento\ReCaptchaValidationApi\Model\ValidationErrorMessagesProvider | Class was added. |
| Magento\User\Model\User::$\_cacheTag | [protected] Property has been added. |

#### Interface changes {#ee-240-241-interface}
### Interface changes {#ee-240-241-interface}

| What changed | How it changed |
| -------------------------------------------------------------------------------- | --------------------------------- |
Expand All @@ -22,22 +22,22 @@
| Magento\Eav\Api\AttributeOptionUpdateInterface | Interface was added. |
| Magento\ReCaptchaUi\Model\ErrorMessageConfigInterface | Interface was added. |

#### Database changes {#ee-240-241-database}
### Database changes {#ee-240-241-database}

| What changed | How it changed |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| login_as_customer_assistance_allowed | Table was added |
| media_gallery_asset/MEDIA_GALLERY_ID_PATH_TITLE_CONTENT_TYPE_WIDTH_HEIGHT | Unique key was removed |
| media_gallery_asset/constraint | Module db schema whitelist reduced (media_gallery_asset/constraint). |

#### Di changes {#ee-240-241-di}
### Di changes {#ee-240-241-di}

| What changed | How it changed |
| ---------------------- | ------------------------ |
| mediaGalleryFilterPool | Virtual Type was removed |
| mediaGalleryReporting | Virtual Type was removed |

#### System changes {#ee-240-241-system}
### System changes {#ee-240-241-system}

| What changed | How it changed |
| --------------------------------------------------------------- | ----------------------------------- |
Expand All @@ -60,14 +60,14 @@
| recaptcha_frontend/type_recaptcha_v3/validation_failure_message | A field-node was removed |
| system.xml | System configuration file was added |

#### XSD changes {#ee-240-241-xsd}
### Xsd changes {#ee-240-241-xsd}

| What changed | How it changed |
| ------------------ | ------------------------------ |
| /etc/overrides.xsd | A schema declaration was added |
| global | An optional node was added |

#### Class API membership changes {#ee-240-241-class-api-membership}
### Class API membership changes {#ee-240-241-class-api-membership}

| What changed | How it changed |
| -------------------------------------------------------- | ---------------- |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### Class changes {#ee-241-242-class}
### Class changes {#ee-241-242-class}

| What changed | How it changed |
| ---------------------------------------------------------------------------------------------------- | ----------------------------------------- |
Expand All @@ -18,13 +18,13 @@
| Magento\Sales\Block\Order\Recent::\_\_construct | [public] Method parameter typing changed. |
| Magento\Wishlist\Block\AddToWishlist::\_toHtml | [protected] Method has been removed. |

#### Interface changes {#ee-241-242-interface}
### Interface changes {#ee-241-242-interface}

| What changed | How it changed |
| -------------------------------------------------------------------------- | -------------------------------------- |
| Magento\AdobeStockAssetApi\Api\Data\AssetInterface::getExtensionAttributes | [public] Method return typing changed. |

#### Database changes {#ee-241-242-database}
### Database changes {#ee-241-242-database}

| What changed | How it changed |
| ------------------------------------------------------------------------------ | ------------------------------------------------ |
Expand All @@ -38,13 +38,13 @@
| test_table_one | Table was added |
| test_table_two | Table was added |

#### Di changes {#ee-241-242-di}
### Di changes {#ee-241-242-di}

| What changed | How it changed |
| ------------------------------ | ------------------------ |
| EmptyOmsTableNameArrayIterator | Virtual Type was removed |

#### System changes {#ee-241-242-system}
### System changes {#ee-241-242-system}

| What changed | How it changed |
| ------------------------------------------------ | ---------------------- |
Expand All @@ -57,7 +57,7 @@
| web/url | A group-node was added |
| web/url/catalog_media_url_format | A field-node was added |

#### XSD changes {#ee-241-242-xsd}
### Xsd changes {#ee-241-242-xsd}

| What changed | How it changed |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
Expand All @@ -68,7 +68,7 @@
| module-page-builder/etc/content_type.xsd | A schema declaration was removed |
| module-page-builder/etc/content_type_merged.xsd | A schema declaration was removed |

#### Class API membership changes {#ee-241-242-class-api-membership}
### Class API membership changes {#ee-241-242-class-api-membership}

| What changed | How it changed |
| ------------------------------------------------------------------ | ------------------ |
Expand All @@ -81,7 +81,7 @@
| Magento\ImportExport\Model\AbstractModel | Class was added. |
| Magento\Review\Block\Adminhtml\Grid | Class was added. |

#### Interface API membership changes {#ee-241-242-interface-api-membership}
### Interface API membership changes {#ee-241-242-interface-api-membership}

| What changed | How it changed |
| ------------------------------------------------ | -------------------- |
Expand Down
Loading