Skip to content

Commit

Permalink
changes in milo
Browse files Browse the repository at this point in the history
  • Loading branch information
Suhani Jain authored and Suhani Jain committed Oct 16, 2023
2 parents dda5586 + dac965c commit 62a6809
Show file tree
Hide file tree
Showing 569 changed files with 50,034 additions and 5,370 deletions.
2 changes: 1 addition & 1 deletion .eslintrc-code-compatibility.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['plugin:compat/recommended', 'plugin:ecmalist/recommended'],
extends: ['plugin:compat/recommended', 'plugin:ecmalist/recommended', 'plugin:react-hooks/recommended'],
settings: { es: { aggressive: true } },
env: { browser: true, mocha: true },
parser: '@babel/eslint-parser',
Expand Down
30 changes: 23 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,40 @@ module.exports = {
requireConfigFile: false,
},
rules: {
// allow reassigning param
'no-param-reassign': [2, { props: false }],
'linebreak-style': ['error', 'unix'],
'chai-friendly/no-unused-expressions': 2,
'import/extensions': ['error', { js: 'always' }],
'import/no-cycle': 0,
'linebreak-style': ['error', 'unix'],
'no-await-in-loop': 0,
'no-param-reassign': [2, { props: false }],
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
'no-return-assign': ['error', 'except-parens'],
'no-unused-expressions': 0,
'object-curly-newline': ['error', {
ObjectExpression: { multiline: true, minProperties: 6 },
ObjectPattern: { multiline: true, minProperties: 6 },
ImportDeclaration: { multiline: true, minProperties: 6 },
ExportDeclaration: { multiline: true, minProperties: 6 },
}],
'no-unused-expressions': 0,
'chai-friendly/no-unused-expressions': 2,

},
overrides: [
{
files: ['test/**/*.js'],
rules: { 'no-console': 'off' },
rules: { 'no-console': 0 },
},
],
ignorePatterns: [
Expand Down
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/gnav.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Description

## Related Issue
Resolves: [MWPW-111111](https://jira.corp.adobe.com/browse/MWPW-111111)

## Testing instructions

## Screenshots (if appropriate):


## Test URLs
**Acrobat:**
- Before: https://www.stage.adobe.com/acrobat/online/sign-pdf.html?martech=off
- After: https://www.stage.adobe.com/acrobat/online/sign-pdf.html?martech=off&milolibs=<branch>--milo--<owner>

**BACOM:**
- Before: https://business.stage.adobe.com/fr/customer-success-stories.html?martech=off
- After: https://business.stage.adobe.com/fr/customer-success-stories.html?martech=off&milolibs=<branch>--milo--<owner>

**CC:**
- Before: https://main--cc--adobecom.hlx.live/?martech=off
- After: https://main--cc--adobecom.hlx.live/?martech=off&milolibs=<branch>--milo--<owner>

**Milo:**
- Before: https://main--milo--adobecom.hlx.page/ch_de/drafts/ramuntea/gnav-refactor?martech=off
- After: https://<branch>--milo--<owner>.hlx.page/ch_de/drafts/ramuntea/gnav-refactor?martech=off
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Before submitting, please review all open PRs. -->

* Add your
* Specicic
* Specific
* Features or fixes

Resolves: [MWPW-NUMBER](https://jira.corp.adobe.com/browse/MWPW-NUMBER)
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/code-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
check:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '18 6 * * 5'

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Dispatch workflows

on:
push:
branches:
- main

jobs:
dispatch-dc:
name: Dispatch DC workflow
if: github.repository == 'adobecom/milo'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'libs/**'
- if: steps.changes.outputs.src == 'true'
name: Trigger DC Workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.DC_PAT }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'adobecom',
repo: 'dc',
workflow_id: 'test-milo.yml',
ref: 'main',
})
9 changes: 6 additions & 3 deletions .github/workflows/email-release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Milo Bot Release Email

on:
pull_request:
types: [closed]
pull_request_target:
types:
- closed
branches:
- main

jobs:
action:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
Expand All @@ -16,7 +18,8 @@ jobs:
- name: Use email bot
uses: adobecom/milo-email-bot@main
env:
TO_EMAIL: ${{ secrets.TO_EMAIL }}
TO_EMAIL_NEW_FEATURE: ${{ secrets.TO_EMAIL_NEW_FEATURE }}
TO_EMAIL_HIGH_IMPACT: ${{ secrets.TO_EMAIL_HIGH_IMPACT }}
FROM_EMAIL: '[email protected]'
FROM_NAME: 'Milo Bot'
SG_KEY: ${{ secrets.SG_KEY }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Enforce PR labels

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
types: [labeled, unlabeled, opened, synchronize]
jobs:
enforce-label:
runs-on: ubuntu-latest
steps:
- uses: yogevbd/[email protected]
with:
REQUIRED_LABELS_ANY: "verified,trivial"
REQUIRED_LABELS_ANY_DESCRIPTION: "PR must be labeled with 'verified-fixed' or 'trivial'"
REQUIRED_LABELS_ANY: "verified,trivial,needs-verification"
REQUIRED_LABELS_ANY_DESCRIPTION: "PR must be labeled with 'trivial', 'needs-verification', or 'verified'"
BANNED_LABELS: "do-not-merge,duplicate,invalid,wontfix"
27 changes: 27 additions & 0 deletions .github/workflows/run-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.js'

jobs:
run-lint:
name: Running eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v20
with:
config_path: ".eslintrc.js"
# ignore_path: "/path/to/.eslintignore"
# extra_args: "--max-warnings=0"
5 changes: 5 additions & 0 deletions .github/workflows/run-nala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ jobs:
labels: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
branch: ${{ github.event.pull_request.head.ref }}
repoName: ${{ github.repository }}
prUrl: ${{ github.event.pull_request.head.repo.html_url }}
prOrg: ${{ github.event.pull_request.head.repo.owner.login }}
prRepo: ${{ github.event.pull_request.head.repo.name }}
prBranch: ${{ github.event.pull_request.head.ref }}
prBaseBranch: ${{ github.event.pull_request.base.ref }}
IMS_EMAIL: ${{ secrets.IMS_EMAIL }}
IMS_PASS: ${{ secrets.IMS_PASS }}
4 changes: 1 addition & 3 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ on:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- main
types: [opened, synchronize, reopened]
jobs:
run-tests:
name: Running tests
Expand Down
17 changes: 15 additions & 2 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"]
}
"extends": [
"stylelint-config-standard",
"stylelint-config-prettier"
],
"rules": {
"unit-no-unknown": [
true,
{
"ignoreUnits": [
"dvh"
]
}
]
}
}
1 change: 1 addition & 0 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title>404</title>
<meta name="template" content="404"/>
<meta name="404" content="feds"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="/libs/scripts/scripts.js" type="module"></script>
<link rel="stylesheet" href="/libs/styles/styles.css"/>
Expand Down
25 changes: 20 additions & 5 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,48 @@
# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# Milo Core (alphabetical order)
/fstab.yaml @adobecom/admins
/libs/features/ @adobecom/admins
/libs/features/seotech/ @hparra
/libs/features/title-append/ @hparra
/libs/martech/ @adobecom/admins
/libs/scripts/ @adobecom/admins
/libs/utils/ @adobecom/admins

# Milo Tools (alphabetical order)

# Milo Blocks (alphabetical order)
/libs/blocks/accordion/ @fullcolorcoder @ryanmparrish
/libs/blocks/aside/ @Sartxi
/libs/blocks/caas/ @chrischrischris
/libs/blocks/caas-config/ @chrischrischris
/libs/blocks/carousel/ @rgclayton
/libs/blocks/chart/ @meganthecoder @Brandon32 @JasonHowellSlavin @sanjayms01
/libs/blocks/commerce/ @Axelcureno @VKniaz
/libs/blocks/faas/ @seanchoi-dev
/libs/blocks/faas-config/ @seanchoi-dev
/libs/blocks/fragment-personalization/ @chrischrischris
/libs/blocks/global-footer/ @overmyheadandbody @mokimo @narcis-radu
/libs/blocks/global-navigation/ @overmyheadandbody @mokimo @narcis-radu
/libs/blocks/how-to/ @fullcolorcoder @ryanmparrish
/libs/blocks/icon-block/ @elan-tbx
/libs/blocks/local-nav/ @seanchoi-dev
/libs/blocks/marketo/ @Brandon32
/libs/blocks/marketo/ @Brandon32
/libs/blocks/marketo-config/ @Brandon32
/libs/blocks/marquee/ @ryanmparrish @Sartxi @auniverseaway
/libs/blocks/media/ @ryanmparrish
/libs/blocks/merch/ @3ch023 @honstar @VKniaz @npeltier
/libs/blocks/merch/ @3ch023 @honstar @VKniaz @npeltier @Axelcureno
/libs/blocks/merch-card/ @VKniaz @Axelcureno @ryanmparrish
/libs/blocks/ost/ @Axelcureno @3ch023 @honstar @VKniaz @vladen @yesil @npeltier
/libs/blocks/pdf-vewer/ @sanjayms01
/libs/blocks/quiz/ @colloyd @sabyamon @fullcolorcoder @JackySun9 @elaineskpt @echampio-at-adobe
/libs/blocks/quiz-results/ @colloyd @sabyamon @fullcolorcoder @JackySun9 @elaineskpt @echampio-at-adobe
/libs/blocks/quote/ @ryanmparrish
/libs/blocks/table-of-contents/ @Brandon32
/libs/blocks/tabs/ @ryanmparrish
/libs/blocks/tag-selector/ @meganthecoder
/libs/blocks/text/ @ryanmparrish
/libs/blocks/video-metadata/ @hparra
/libs/blocks/z-pattern/ @ryanmparrish


# Milo Tools (alphabetical order)
/tools/caas-import/ @chrischrischris
/tools/send-to-caas/ @chrischrischris
Loading

0 comments on commit 62a6809

Please sign in to comment.