Skip to content

Commit

Permalink
Merge branch 'stage' into MWPW-158446-domains-map
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-bogos committed Sep 17, 2024
2 parents 29882ad + 968cb7a commit d20d06c
Show file tree
Hide file tree
Showing 25 changed files with 213 additions and 136 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/fg-sync-repos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Floodgate Repo Sync

on:
push:
branches:
- stage
- main
workflow_dispatch:
inputs:
syncBranch:
Expand Down Expand Up @@ -28,7 +32,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ inputs.syncBranch }}
ref: ${{ inputs.syncBranch || github.ref_name }}

- name: Clone Floodgate Repository and Checkout Selected Branch
run: |
Expand All @@ -41,7 +45,7 @@ jobs:
echo "bacom branch"
git branch
env:
FG_SYNC_BRANCH: ${{ inputs.syncBranch }}
FG_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}

- name: Overwrite floodgate repo files with latest from source repo
run: |
Expand All @@ -54,14 +58,19 @@ jobs:
git branch
git config user.email "$FG_SYNC_BOT_EMAIL"
git config user.name "$FG_SYNC_BOT_NAME"
git status
git remote set-url origin https://oauth2:[email protected]/adobecom/bacom-pink.git
git remote -v
git add .
git commit -m "Syncing bacom to bacom-pink"
git push origin $FG_SYNC_BRANCH --force
git status
if [[ -n $(git status -s) ]]; then
git remote set-url origin https://oauth2:[email protected]/adobecom/bacom-pink.git
git remote -v
git add .
git commit -m "Syncing bacom to bacom-pink"
git push origin $FG_SYNC_BRANCH --force
echo ":heavy_check_mark: Syncing branch $FG_SYNC_BRANCH on bacom to bacom-pink completed successfully." >> $GITHUB_STEP_SUMMARY
else
echo ":heavy_minus_sign: No changes detected on branch $FG_SYNC_BRANCH, nothing to sync." >> $GITHUB_STEP_SUMMARY
fi
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
FG_SYNC_BOT_EMAIL: ${{ secrets.FG_SYNC_BOT_EMAIL }}
FG_SYNC_BOT_NAME: ${{ secrets.FG_SYNC_BOT_NAME }}
FG_SYNC_BRANCH: ${{ inputs.syncBranch }}
FG_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}
28 changes: 19 additions & 9 deletions .github/workflows/graybox-sync-repos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Graybox Repo Sync

on:
push:
branches:
- stage
- main
workflow_dispatch:
inputs:
syncBranch:
Expand All @@ -10,6 +14,7 @@ on:
type: choice
options:
- 'stage'
- 'main'

jobs:
build:
Expand All @@ -28,7 +33,7 @@ jobs:
uses: actions/checkout@v2
with:
persist-credentials: false
ref: ${{ inputs.syncBranch }}
ref: ${{ inputs.syncBranch || github.ref_name }}

- name: Clone Graybox Repository and Checkout Stage Branch
run: |
Expand All @@ -41,7 +46,7 @@ jobs:
echo "bacom branch"
git branch
env:
GB_SYNC_BRANCH: ${{ inputs.syncBranch }}
GB_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}

- name: Overwrite graybox repo files with latest from source repo
run: |
Expand All @@ -54,13 +59,18 @@ jobs:
git branch
git config user.email "$FG_SYNC_BOT_EMAIL"
git config user.name "milo-repo-sync[bot]"
git status
git remote set-url origin https://oauth2:[email protected]/adobecom/bacom-graybox.git
git remote -v
git add .
git commit -m "Syncing bacom to bacom-graybox"
git push origin $GB_SYNC_BRANCH --force
git status
if [[ -n $(git status -s) ]]; then
git remote set-url origin https://oauth2:[email protected]/adobecom/bacom-graybox.git
git remote -v
git add .
git commit -m "Syncing bacom to bacom-graybox"
git push origin $GB_SYNC_BRANCH --force
echo ":heavy_check_mark: Syncing branch $GB_SYNC_BRANCH on bacom to bacom-graybox completed successfully." >> $GITHUB_STEP_SUMMARY
else
echo ":heavy_minus_sign: No changes detected on branch $GB_SYNC_BRANCH, nothing to sync." >> $GITHUB_STEP_SUMMARY
fi
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
FG_SYNC_BOT_EMAIL: ${{ secrets.FG_SYNC_BOT_EMAIL }}
GB_SYNC_BRANCH: ${{ inputs.syncBranch }}
GB_SYNC_BRANCH: ${{ inputs.syncBranch || github.ref_name }}
36 changes: 36 additions & 0 deletions .github/workflows/run-e2e-daily.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bacom E2E Daily Run

on:
workflow_dispatch:
schedule:
- cron: '0 16 * * *'

jobs:
platform_matrix:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
name: Running tests on Browserstack
runs-on: ${{ matrix.os }}
env:
WORKFLOW_NAME: 'Bacom E2E Nala Daily Run'
DAILY_RUN: 'true'

steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: adobecom/nala
ref: main

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Run Nala ${{ matrix.os }}
run: bash runOnBrowserstack.sh bacom @e2e
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
4 changes: 2 additions & 2 deletions blocks/comparison/comparison.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getLibs } from '../../scripts/utils.js';
import { LIBS } from '../../scripts/scripts.js';

/**
* @param {Element} el
*/
const init = async (el) => {
const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const { createTag } = await import(`${LIBS}/utils/utils.js`);
const rows = Array.from(el.querySelectorAll(':scope > div'));
const headers = Array.from(rows.shift().children);
const headersRow = createTag('tr');
Expand Down
4 changes: 2 additions & 2 deletions blocks/faas-decode/faas-decode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getLibs } from '../../scripts/utils.js';
import { LIBS } from '../../scripts/scripts.js';

export default async function init(el) {
const { createTag, parseEncodedConfig } = await import(`${getLibs()}/utils/utils.js`);
const { createTag, parseEncodedConfig } = await import(`${LIBS}/utils/utils.js`);
const url = el.querySelector('a')?.href;
const resp = await fetch(url);

Expand Down
6 changes: 3 additions & 3 deletions blocks/redirects-formatter/redirects-formatter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getLibs } from '../../scripts/utils.js';
import { LIBS } from '../../scripts/scripts.js';

export const SELECT_ALL_REGIONS = 'Select All Regions';
export const DESELECT_ALL_REGIONS = 'De-select All Regions';
Expand All @@ -12,7 +12,7 @@ const INSTRUCTIONS_TEXT = 'Select the locales you require by checking the checkb
+ ' press "Copy to clipboard" or select them with the cursor manually.';

async function createLocaleCheckboxes(prefixGroup) {
const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const { createTag } = await import(`${LIBS}/utils/utils.js`);

return Object.keys(prefixGroup).map((key) => {
const { prefix } = prefixGroup[key];
Expand Down Expand Up @@ -87,7 +87,7 @@ export function stringifyListForExcel(urls) {
}

export default async function init(el) {
const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const { createTag } = await import(`${LIBS}/utils/utils.js`);
const xlPath = './locale-config.json';
const resp = await fetch(xlPath);
if (!resp.ok) return;
Expand Down
6 changes: 3 additions & 3 deletions blocks/stats/stats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getLibs } from '../../scripts/utils.js';
import { LIBS } from '../../scripts/scripts.js';

async function decorateRow(row, module) {
const { decorateLinkAnalytics } = module;
Expand All @@ -14,8 +14,8 @@ async function decorateRow(row, module) {
}

export default async function init(el) {
const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const module = await import(`${getLibs()}/martech/attributes.js`);
const { createTag } = await import(`${LIBS}/utils/utils.js`);
const module = await import(`${LIBS}/martech/attributes.js`);

module.decorateBlockAnalytics(el);
const firstRow = el.querySelector(':scope > div');
Expand Down
4 changes: 2 additions & 2 deletions blocks/tree-view/tree-view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getLibs } from '../../scripts/utils.js';
import { LIBS } from '../../scripts/scripts.js';

const BACOM_HOSTS = ['localhost', '--bacom--adobecom.hlx.page', '--bacom--adobecom.hlx.live', 'business.adobe.com'];

Expand Down Expand Up @@ -110,7 +110,7 @@ const init = async (el) => {

if (!topList) return;

const { createTag } = await import(`${getLibs()}/utils/utils.js`);
const { createTag } = await import(`${LIBS}/utils/utils.js`);
const subLists = topList.querySelectorAll('ul');
const isAccordion = subLists.length > 0;
const links = el.querySelectorAll('a');
Expand Down
6 changes: 3 additions & 3 deletions blocks/workfront-login/workfront-login.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getLibs } from '../../scripts/utils.js';
import { LIBS } from '../../scripts/scripts.js';

export async function createProofForm(createTag, replaceKey, config) {
const form = createTag('form', { action: 'https://app.proofhq.com/login', method: 'post' });
Expand Down Expand Up @@ -105,8 +105,8 @@ export async function createSubdomainForm(createTag, replaceKey, config) {

/* c8 ignore next 14 */
export default async function init(el) {
const { createTag, getConfig } = await import(`${getLibs()}/utils/utils.js`);
const { replaceKey } = await import(`${getLibs()}/features/placeholders.js`);
const { createTag, getConfig } = await import(`${LIBS}/utils/utils.js`);
const { replaceKey } = await import(`${LIBS}/features/placeholders.js`);
const config = getConfig();
const isProof = el.classList.contains('proof');

Expand Down
28 changes: 28 additions & 0 deletions head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="preload" href="/styles/styles.css" as="style"/>
<script>
const libs = (() => {
const { hostname, search } = window.location;
if (!['.hlx.', '.stage.', 'local'].some((i) => hostname.includes(i))) return '/libs';
const branch = new URLSearchParams(search).get('milolibs') || 'main';
if (branch === 'local') return 'http://localhost:6456/libs';
return branch.includes('--') ? `https://${branch}.hlx.live/libs` : `https://${branch}--milo--adobecom.hlx.live/libs`;
})();

const miloStyles = document.createElement('link');
const miloUtils = document.createElement('link');
const miloDecorate = document.createElement('link');

miloStyles.setAttribute('as', 'style');
miloStyles.setAttribute('href', `${libs}/styles/styles.css`);

[miloUtils, miloDecorate].forEach((tag) => {
tag.setAttribute('crossorigin', 'true');
tag.setAttribute('as', 'script');
})

miloUtils.setAttribute('href', `${libs}/utils/utils.js`);
miloDecorate.setAttribute('href', `${libs}/utils/decorate.js`);

[miloStyles, miloUtils, miloDecorate].forEach((tag) => tag.setAttribute('rel', 'preload'));
document.head.append(miloStyles, miloUtils, miloDecorate);
</script>
<script src="/scripts/scripts.js" type="module"></script>
<style>body { display: none; }</style>
<link rel="icon" href="data:,">
10 changes: 9 additions & 1 deletion helix-query.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ indices:
select: head > meta[name="publishdate"]
value: |
attribute(el, 'content')
caas-url:
select: .columns div div a[href*="/tools/caas"], .text div div a[href*="/tools/caas"]
value: |
attribute(el, 'href')
marketo-url:
select: .marketo div div a[href*="/tools/marketo"]
value: |
attribute(el, 'href')
sitemap-ae_ar:
include:
- '/ae_ar/'
Expand Down Expand Up @@ -1742,6 +1750,6 @@ indices:
properties:
<<: *defaultProps
faas-url:
select: .columns div div a, .text div div a
select: .columns div div a[href*="/tools/faas"], .text div div a[href*="/tools/faas"]
value: |
attribute(el, 'href')
2 changes: 1 addition & 1 deletion helix-sitemap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sitemaps:
source: /in/query-index.json
alternate: /in/{path}.html
destination: /in/sitemap.xml
hreflang: en-GB
hreflang: en-IN
in_hi:
source: /in_hi/query-index.json
alternate: /in_hi/{path}.html
Expand Down
21 changes: 14 additions & 7 deletions scripts/aa-university.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ export default function registerAAUniversity() {
const lastName = document.querySelector('input[name="LastName"]');
const email = document.querySelector('input[name="Email"]');
const country = document.querySelector('select[name="Country"]');
const group = document.querySelector('meta[name="sandboxgroup"]');

const postBody = {
first_name: firstName?.value,
last_name: lastName?.value,
email: email?.value,
university: 'none',
country: country?.value,
};

if (group) postBody.group = group.content;

fetch('https://us-central1-adobe---aa-university.cloudfunctions.net/register', {
method: 'POST',
body: JSON.stringify({
first_name: firstName?.value,
last_name: lastName?.value,
email: email?.value,
university: 'none',
country: country?.value,
}),
body: JSON.stringify(postBody),
})
.catch((error) => window.lana.log(`Marketo AA University Error: ${error}`));

return postBody;
}
Loading

0 comments on commit d20d06c

Please sign in to comment.