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

Update AEM libraries to latest release. #162

Merged
merged 3 commits into from
Oct 25, 2023
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests and Linting
name: Linting

on: [pull_request]

Expand All @@ -10,7 +10,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16' #required for npm 8 or later.
- run: npm install
- run: npm run lint
env:
Expand Down
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta property="og:title" content="Page not found">
<script src="/scripts/scripts.js" type="module" crossorigin="use-credentials"></script>
<script type="module">
import { sampleRUM } from '/scripts/lib-franklin.js';
import { sampleRUM } from '/scripts/aem.js';

window.addEventListener('load', () => {
if (document.referrer) {
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Your project's description...
npm i
```

## Tests
## Linting

```sh
npm test
npm run lint
```

## Local development

1. Create a new repository based on the `helix-project-boilerplate` template and add a mountpoint in the `fstab.yaml`
1. Add the [helix-bot](https://github.com/apps/helix-bot) to the repository
1. Install the [Helix CLI](https://github.com/adobe/helix-cli): `npm install -g @adobe/helix-cli`
1. Start Franklin Proxy: `hlx up` (opens your browser at `http://localhost:3000`)
1. Create a new repository based on the `aem-boilerplate` template and add a mountpoint in the `fstab.yaml`
1. Add the [AEM Code Sync GitHub App](https://github.com/apps/aem-code-sync) to the repository
1. Install the [AEM CLI](https://github.com/adobe/aem-cli): `npm install -g @adobe/aem-cli`
1. Start AEM Proxy: `aem up` (opens your browser at `http://localhost:3000`)
1. Open the `{repo}` directory in your favorite IDE and start coding :)
2 changes: 1 addition & 1 deletion blocks/agent-search/agent-search.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMetadata } from '../../scripts/lib-franklin.js';
import { getMetadata } from '../../scripts/aem.js';
import { getSpinner } from '../../scripts/util.js';
import {
fromParam as filterFromParam,
Expand Down
2 changes: 1 addition & 1 deletion blocks/agent-search/builders/form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMetadata } from '../../../scripts/lib-franklin.js';
import { getMetadata } from '../../../scripts/aem.js';
import { BREAKPOINTS } from '../../../scripts/scripts.js';

import { abortSuggestions, getSuggestions } from '../../../scripts/apis/agent/suggestion.js';
Expand Down
2 changes: 1 addition & 1 deletion blocks/agent-search/builders/sort.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchPlaceholders } from '../../../scripts/lib-franklin.js';
import { fetchPlaceholders } from '../../../scripts/aem.js';
import Sort, { sortFor } from '../../../scripts/apis/agent/sort.js';
import { PAGE_PARAM } from './pagination.js';

Expand Down
2 changes: 1 addition & 1 deletion blocks/avm-report/avm-report-delayed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchPlaceholders } from '../../scripts/lib-franklin.js';
import { fetchPlaceholders } from '../../scripts/aem.js';

async function initGooglePlacesAPI() {
const placeholders = await fetchPlaceholders();
Expand Down
2 changes: 1 addition & 1 deletion blocks/blog-listing/blog-listing.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
readBlockConfig,
} from '../../scripts/lib-franklin.js';
} from '../../scripts/aem.js';

const urlParams = new URLSearchParams(window.location.search);
export const API_HOST = urlParams.get('env') === 'stage' ? 'https://ignite-staging.bhhs.com' : 'https://www.bhhs.com';
Expand Down
2 changes: 1 addition & 1 deletion blocks/footer/footer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readBlockConfig, decorateIcons } from '../../scripts/lib-franklin.js';
import { readBlockConfig, decorateIcons } from '../../scripts/aem.js';

/**
* loads and decorates the footer
Expand Down
2 changes: 1 addition & 1 deletion blocks/header/header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BREAKPOINTS } from '../../scripts/scripts.js';
import { getMetadata, decorateIcons, decorateSections } from '../../scripts/lib-franklin.js';
import { getMetadata, decorateIcons, decorateSections } from '../../scripts/aem.js';

// media query match that indicates mobile/tablet width
const isDesktop = BREAKPOINTS.medium;
Expand Down
2 changes: 1 addition & 1 deletion blocks/hero/search/home-delayed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMetadata } from '../../../scripts/lib-franklin.js';
import { getMetadata } from '../../../scripts/aem.js';
import { BREAKPOINTS } from '../../../scripts/scripts.js';
import {
close as closeCountrySelect,
Expand Down
2 changes: 1 addition & 1 deletion blocks/hero/search/home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decorateIcons } from '../../../scripts/lib-franklin.js';
import { decorateIcons } from '../../../scripts/aem.js';
import {
build as buildCountrySelect,
} from '../../shared/search-countries/search-countries.js';
Expand Down
2 changes: 1 addition & 1 deletion blocks/info-mouseover/info-mouseover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decorateIcons } from '../../scripts/lib-franklin.js';
import { decorateIcons } from '../../scripts/aem.js';
import { BREAKPOINTS } from '../../scripts/scripts.js';

function positionIcon(heading, icon) {
Expand Down
2 changes: 1 addition & 1 deletion blocks/juicer/juicer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readBlockConfig } from '../../scripts/lib-franklin.js';
import { readBlockConfig } from '../../scripts/aem.js';

function loadEmbeds() {
const style = document.createElement('link');
Expand Down
2 changes: 1 addition & 1 deletion blocks/liveby-demographics/liveby-demographics.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LIVEBY_API } from '../../scripts/scripts.js';
import { decorateIcons } from '../../scripts/lib-franklin.js';
import { decorateIcons } from '../../scripts/aem.js';

const dollarFormatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0 });
const percFormatter = new Intl.NumberFormat('en-US', { style: 'percent' });
Expand Down
2 changes: 1 addition & 1 deletion blocks/liveby-map/liveby-map-delayed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global google */

import { fetchPlaceholders } from '../../scripts/lib-franklin.js';
import { fetchPlaceholders } from '../../scripts/aem.js';

function getCenter(coords) {
// Find bounding box
Expand Down
2 changes: 1 addition & 1 deletion blocks/liveby-metadata/liveby-metadata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMetadata } from '../../scripts/lib-franklin.js';
import { getMetadata } from '../../scripts/aem.js';

async function getCommunityId(id, ref, name) {
const resp = await fetch(`https://api.liveby.com/v1/pages?id=${id}&ref=/${ref}/communities/${name}`);
Expand Down
2 changes: 1 addition & 1 deletion blocks/liveby-schools/liveby-schools.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decorateIcons } from '../../scripts/lib-franklin.js';
import { decorateIcons } from '../../scripts/aem.js';
import { LIVEBY_API } from '../../scripts/scripts.js';

const ES_GRADES = ['PK', 'KG', '01', '02', '03', '04', '05', '06'];
Expand Down
2 changes: 1 addition & 1 deletion blocks/property-listing/cards/cards.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { propertySearch } from '../../../scripts/apis/creg/creg.js';
import { decorateIcons } from '../../../scripts/lib-franklin.js';
import { decorateIcons } from '../../../scripts/aem.js';

function createImage(listing) {
if (listing.SmallMedia?.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion blocks/property-listing/property-listing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMetadata, readBlockConfig } from '../../scripts/lib-franklin.js';
import { getMetadata, readBlockConfig } from '../../scripts/aem.js';
import ApplicationType from '../../scripts/apis/creg/ApplicationType.js';
import SearchType, { searchTypeFor } from '../../scripts/apis/creg/SearchType.js';
import PropertyType from '../../scripts/apis/creg/PropertyType.js';
Expand Down
2 changes: 1 addition & 1 deletion blocks/property-result-map/map-delayed.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global google */
/* eslint-disable no-param-reassign, no-shadow, prefer-rest-params */

import { fetchPlaceholders } from '../../scripts/lib-franklin.js';
import { fetchPlaceholders } from '../../scripts/aem.js';
import { removeFilterValue, searchProperty, setFilterValue } from '../property-search-bar/filter-processor.js';
import Template from './Template.js';
import SearchParameters from '../../scripts/apis/creg/SearchParameters.js';
Expand Down
2 changes: 1 addition & 1 deletion blocks/quote/quote.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readBlockConfig } from '../../scripts/lib-franklin.js';
import { readBlockConfig } from '../../scripts/aem.js';

export default async function decorate(block) {
const config = readBlockConfig(block);
Expand Down
6 changes: 2 additions & 4 deletions blocks/shared/search-countries/search-countries.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
loadCSS,
} from '../../../scripts/lib-franklin.js';
} from '../../../scripts/aem.js';

const imgHTML = (country) => `<img src="/icons/flags/${country}.png" alt="${country}" class="label-image" role="presentation" aria-hidden="true" tabIndex="-1" height="25" width="25"/>${country}`;

Expand Down Expand Up @@ -64,9 +64,7 @@ export async function build(...callbacks) {
return undefined;
}

await new Promise((resolve) => {
loadCSS(`${window.hlx.codeBasePath}/blocks/shared/search-countries/search-countries.css`, resolve);
});
await loadCSS(`${window.hlx.codeBasePath}/blocks/shared/search-countries/search-countries.css`);

const tmp = document.createElement('div');
tmp.innerHTML = await resp.text();
Expand Down
3 changes: 1 addition & 2 deletions head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="/scripts/lib-franklin.js" type="module"></script>
<script src="/scripts/aem.js" type="module"></script>
<script src="/scripts/scripts.js" type="module"></script>
<link rel="stylesheet" href="/styles/styles.css"/>
<link rel="icon" href="data:,">
Loading
Loading