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

Uibranch #21

Open
wants to merge 166 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
54de36a
Update fstab.yaml
ravverma Apr 4, 2023
9d558ba
Update fstab.yaml
ravverma Apr 4, 2023
2b26840
incorporating we.cafe demo
ravverma Apr 4, 2023
465aaf8
updating to run demo
ravverma Apr 4, 2023
23d2729
revert
ravverma Apr 4, 2023
abc59e9
block added
ravverma Apr 4, 2023
8f44600
for demo purpose
ravverma Apr 7, 2023
6ce4394
test
ravverma Apr 11, 2023
dd84482
test
ravverma Apr 11, 2023
f45dea5
twet
ravverma Apr 11, 2023
b92fdec
kiosk
ravverma Apr 15, 2023
e638ba0
kiosk-demo-v1
ravverma Apr 16, 2023
4023ae7
updating QR code text
ravverma Apr 17, 2023
9c62d0b
changes for more video
ravverma Apr 18, 2023
db46793
moredetail data
ravverma Apr 18, 2023
840649a
fix
ravverma Apr 18, 2023
3204251
fix
ravverma Apr 18, 2023
73c1445
manually created channels.json
ravverma Apr 20, 2023
15c380e
refeactor
ravverma Apr 20, 2023
e5fda95
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma Apr 20, 2023
10b7b7e
Update helix-query.yaml
ravverma Apr 21, 2023
d3e2542
Update helix-query.yaml
ravverma Apr 21, 2023
758aca2
Update helix-query.yaml
ravverma Apr 21, 2023
e86e251
Update helix-query.yaml
ravverma Apr 21, 2023
ec7b1a4
Update README.md
ravverma Apr 21, 2023
5ed2ed9
Create generate-offlineresources.yaml
ravverma Apr 21, 2023
aa93fef
Delete generate-offlineresources.yaml
ravverma Apr 21, 2023
92e24c9
config offline generator
ravverma Apr 21, 2023
753d7b9
adding package-lock
ravverma Apr 21, 2023
3770ae6
Merge pull request #1 from ravverma/offlineconfig
ravverma Apr 24, 2023
09e10b6
Generating Screens offline resources
Apr 24, 2023
27b3970
Generating Screens offline resources
Apr 24, 2023
17f329c
Generating Screens offline resources
Apr 24, 2023
707dd68
Generating Screens offline resources
Apr 24, 2023
bdef135
making it online
ravverma Apr 24, 2023
ee6ada0
Update channels.json
ravverma Apr 24, 2023
d49d7b4
Generating Screens offline resources
Apr 24, 2023
04c7eff
offline video
ravverma Apr 24, 2023
d4767fc
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma Apr 24, 2023
01f5025
Generating Screens offline resources
Apr 24, 2023
5b7e705
video url added to document
ravverma Apr 24, 2023
8f5d058
Generating Screens offline resources
Apr 24, 2023
e44a2bd
fixing for offline
ravverma Apr 24, 2023
6454b10
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma Apr 24, 2023
8b7b42a
Update generate-offlineresources.yaml
ravverma Apr 26, 2023
807fd70
adding QR image
ravverma Apr 26, 2023
656b426
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma Apr 26, 2023
12b52c9
Generating Screens offline resources
Apr 26, 2023
7f84e19
Update delayed.js
ravverma Apr 26, 2023
9aa286f
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma Apr 26, 2023
c5fcf23
Generating Screens offline resources
Apr 26, 2023
5f8976f
Removing unused code
ravverma May 2, 2023
cfd8483
fixing eslint errors
ravverma May 2, 2023
486755e
removing not in use items
ravverma May 2, 2023
de04704
Revert "removing not in use items"
ravverma May 2, 2023
01229ba
fixing for PR
ravverma May 2, 2023
ef82131
Generating Screens offline resources
May 4, 2023
1206cc2
Generating Screens offline resources
May 4, 2023
53eb1fd
Generating Screens offline resources
May 4, 2023
04436a0
Generating Screens offline resources
May 5, 2023
573541f
Generating Screens offline resources
May 8, 2023
e894f92
looping content demo
ravverma May 8, 2023
b726073
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma May 8, 2023
939dc50
Generating Screens offline resources
May 8, 2023
baf64d0
Generating Screens offline resources
May 8, 2023
de54619
Generating Screens offline resources
May 8, 2023
a7b4f20
Generating Screens offline resources
May 8, 2023
7684cee
reverting not required changes
ravverma May 9, 2023
659475d
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma May 9, 2023
014084a
Generating Screens offline resources
May 9, 2023
7059487
Generating Screens offline resources
May 9, 2023
1538e33
Update README.md
ravverma May 9, 2023
fab4a07
Update fstab.yaml
ravverma May 9, 2023
29a879c
Generating Screens offline resources
May 9, 2023
a0f05fa
Generating Screens offline resources
May 9, 2023
2abb3ec
Generating Screens offline resources
May 9, 2023
165962b
Update fstab.yaml
ravverma May 9, 2023
1f0a460
Merge branch 'main' of https://github.com/ravverma/wknd
ravverma May 9, 2023
a133037
Update generate-offlineresources.yaml
ravverma May 9, 2023
a198de0
Generating Screens offline resources
May 9, 2023
0d332cf
Generating Screens offline resources
May 9, 2023
9231fdb
Generating Screens offline resources
May 9, 2023
5fa2962
Update delayed.js
ravverma May 9, 2023
3f1b892
Update delayed.js
ravverma May 9, 2023
be9ecd0
Merge pull request #1 from ravverma/main
ravverma May 9, 2023
ec9425e
Generating Screens offline resources
May 9, 2023
b80fd16
Generating Screens offline resources
May 9, 2023
e5cc634
Generating Screens offline resources
May 9, 2023
a1692ff
Generating Screens offline resources
May 9, 2023
672af50
Generating Screens offline resources
May 9, 2023
b6d3a48
Generating Screens offline resources
May 9, 2023
33cedee
Update delayed.js
ravverma May 9, 2023
a4e49f4
Generating Screens offline resources
May 10, 2023
48c29da
Fixing overlapping buttons
ravverma May 10, 2023
755d2a5
Merge branch 'main' of https://github.com/hlxscreens/wknd
ravverma May 10, 2023
c9c1df0
Generating Screens offline resources
May 10, 2023
df45780
Generating Screens offline resources
May 10, 2023
a4e5674
Generating Screens offline resources
May 10, 2023
a7e0e3a
Add AEM Assets Support (#2)
sdmcraft May 11, 2023
f56a758
Fixed typo in AEM Assets integration
May 14, 2023
f30f0bc
Revert "Fixed typo in AEM Assets integration"
May 14, 2023
bd9ed42
Generating Screens offline resources
May 15, 2023
3615d87
Generating Screens offline resources
Jun 5, 2023
78e4f51
Generating Screens offline resources
Jun 5, 2023
ddb1885
[Digital menu board] three zone and wknd theme
ravverma Jun 6, 2023
821af6f
Generating Screens offline resources
Jun 6, 2023
5547832
Generating Screens offline resources
Jun 6, 2023
13e341b
Generating Screens offline resources
Jun 6, 2023
b5feb94
Generating Screens offline resources
Jun 6, 2023
ad8515f
Generating Screens offline resources
Jun 6, 2023
e6ed0f9
Merge branch 'main' of https://github.com/hlxscreens/wknd
ravverma Jun 6, 2023
ead0231
Generating Screens offline resources
Jun 6, 2023
a5a141c
Generating Screens offline resources
Jun 14, 2023
523c9df
Generating Screens offline resources
Jun 14, 2023
2a35283
Generating Screens offline resources
Jul 24, 2023
ba57236
Generating Screens offline resources
Jul 24, 2023
dbf039f
Generating Screens offline resources
Jul 24, 2023
808caf8
Update aem-asset-selector-util.js
ravverma Jul 24, 2023
0dc1d25
Update aem-asset-selector-util.js
ravverma Jul 24, 2023
759fbfc
feat: adds idle screens and spa navigation
sandsinh Jul 24, 2023
092dc6d
Merge pull request #7 from hlxscreens/idlescreen
ravverma Jul 25, 2023
821ff9a
fix: adds skeleton reload
sandsinh Jul 25, 2023
9528b64
chore: adds some data
sandsinh Jul 25, 2023
28c66d4
Merge pull request #8 from hlxscreens/skeletonReload
sandesh-sinha Jul 25, 2023
f707ae7
Generating Screens offline resources
Jul 25, 2023
3b303eb
Update aem-asset-selector-util.js
ravverma Jul 25, 2023
671d7a4
Merge branch 'main' of https://github.com/hlxscreens/wknd
ravverma Jul 25, 2023
6650be8
Update aem-asset-selector-util.js
ravverma Jul 25, 2023
0c86435
Generating Screens offline resources
Jul 25, 2023
1babb9a
Generating Screens offline resources
Jul 25, 2023
7740d90
Update package.json
ravverma Jul 25, 2023
75e360b
Generating Screens offline resources
Jul 25, 2023
3634a70
fix: category css
sandsinh Jul 25, 2023
d1d4849
Generating Screens offline resources
Jul 25, 2023
00947c8
Generating Screens offline resources
Jul 25, 2023
2e9b964
fix: adds after element in div for linear gradient over image
sandsinh Jul 25, 2023
048d022
Update wknd-kiosk-commerce.manifest.json
ravverma Jul 25, 2023
4b8b97f
Generating Screens offline resources
Jul 25, 2023
443d813
Update wknd-kiosk-commerce.manifest.json
ravverma Jul 25, 2023
283cde6
Update package.json
absarasw Jul 25, 2023
df7fcbf
Generating Screens offline resources
Jul 25, 2023
4d4a7f4
Generating Screens offline resources
Jul 25, 2023
20eb71e
Generating Screens offline resources
Jul 25, 2023
24d45bf
Merge branch 'main' of github.com:hlxscreens/wknd
sandsinh Jul 25, 2023
66e6edc
fix: adds product-list render from json
sandsinh Jul 25, 2023
4a45aef
Generating Screens offline resources
Jul 25, 2023
0b0cf6a
fix: adds product-list render from json
sandsinh Jul 25, 2023
92873c4
Generating Screens offline resources
Jul 25, 2023
6fd8bdb
Generating Screens offline resources
Jul 25, 2023
1eb227c
fix: improves product list and add adnimation in category
sandsinh Jul 25, 2023
9430f14
Generating Screens offline resources
Jul 25, 2023
3999845
feat: initialize product detail page
sandsinh Jul 25, 2023
72b785a
Generating Screens offline resources
Jul 26, 2023
265a6f6
Generating Screens offline resources
Jul 26, 2023
1f851af
Generating Screens offline resources
Jul 26, 2023
c890590
commerce
ravverma Jul 26, 2023
8c43143
fix: complete initial skeleton
sandsinh Jul 26, 2023
a968024
commerce integration
ravverma Jul 26, 2023
163dae3
commerce
ravverma Jul 26, 2023
ce50332
commerce integration
ravverma Jul 26, 2023
3bf83d4
picker
ravverma Jul 26, 2023
25abc84
trying to import picker
ravverma Jul 26, 2023
bcc3470
fix: css changes
sandsinh Jul 27, 2023
3831351
Merge branch 'main' into uibranch
sandsinh Jul 27, 2023
4fc6bcd
fix: switch to main
sandsinh Jul 27, 2023
6eb4256
fix: update query response schema
sandsinh Jul 27, 2023
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
File renamed without changes.
44 changes: 44 additions & 0 deletions .github/workflows/generate-offlineresources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Generate Screens offline resources for franklin channels

on:
repository_dispatch:
types:
- resource-published
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- run: |
echo "Status: ${{ github.event.client_payload.status }}"
echo "Path: ${{ github.event.client_payload.path }}"
- name: Sleep for 90 seconds assuming helix index will be updated before
run: sleep 90s
shell: bash
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- run: npm install
- name: Generate Screens Offline Resources
run: npm run generate-offlineresources helixManifest="/screens/internal/manifests" helixChannelsList="/screens/internal/channels"
- name: Commit files # transfer the generated manifest files back into the repository
run: |
git config --local user.name ${{ github.actor }}
git config --local user.email "<>"
git add .
git commit -m "Generating Screens offline resources"
- name: Push changes # push the generated Screens offline resources to your repo
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.hlx/*
coverage/*
logs/*
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Your Project's Title...
Your project's description...
# WKND Helix Screens
This repo is dedicated for screens usecase for wknd and delivered by franklin

## Environments
- Preview: https://main--wknd--hlxsites.hlx.page/
- Live: https://main--wknd--hlxsites.hlx.live/
- Preview: https://main--wknd--hlxscreens.hlx.page/
- Live: https://main--wknd--hlxscreens.hlx.live/

## Installation

Expand Down
143 changes: 143 additions & 0 deletions blocks/aem-asset-selector/aem-asset-selector-util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
const AS_MFE = 'https://experience.adobe.com/solutions/CQ-assets-selectors/assets/resources/assets-selectors.js';
const IMS_ENV_STAGE = 'stg1';
const IMS_ENV_PROD = 'prod';

let imsInstance = null;
let imsEnvironment;

function loadScript(url, callback, type) {
const $head = document.querySelector('head');
const $script = document.createElement('script');
$script.src = url;
if (type) {
$script.setAttribute('type', type);
}
$head.append($script);
$script.onload = callback;
return $script;
}

function load(cfg) {
const imsProps = {
imsClientId: cfg['ims-client-id'],
imsScope: 'additional_info.projectedProductContext,openid,read_organizations,AdobeID,ab.manage',
redirectUrl: window.location.href,
modalMode: true,
imsEnvironment,
env: imsEnvironment.toUpperCase(),
};
// eslint-disable-next-line no-undef
const registeredTokenService = PureJSSelectors.registerAssetsSelectorsAuthService(imsProps);
imsInstance = registeredTokenService;
}

export function init(cfg, callback) {
if (cfg.environment.toUpperCase() === 'STAGE') {
imsEnvironment = IMS_ENV_STAGE;
} else if (cfg.environment.toUpperCase() === 'PROD') {
imsEnvironment = IMS_ENV_PROD;
} else {
throw new Error('Invalid environment setting!');
}

loadScript(AS_MFE, () => {
load(cfg);
if (callback) {
callback();
}
});
}

function onClose() {
const selectorDialog = document.getElementById('asset-selector-dialog');
selectorDialog.close();
}

async function setToClipboard(rennditionURL, mimetype) {
const response = await fetch(rennditionURL);
if (response.ok) {
let data;
if (mimetype.startsWith('image')) {
const blob = await response.blob();

// eslint-disable-next-line no-undef
data = [new ClipboardItem({ [blob.type]: blob })];
} else if (mimetype.startsWith('video')) {
const block = `
<table border='1'>
<tr>
<td>embed</td>
</tr>
<tr>
<td><a href=${rennditionURL}>${rennditionURL}</a></td>
</tr>
</table>
`;

data = [
// eslint-disable-next-line no-undef
new ClipboardItem({ 'text/html': new Blob([block], { type: 'text/html' }) }),
];
} else {
throw new Error('Unsupported mimetype!');
}
await navigator.clipboard.write(data);
} else {
// eslint-disable-next-line no-alert
alert('Selected asset is not available for usage!!');
}
}

function handleSelection(selection) {
const selectedAsset = selection[0];
if (selectedAsset.reviewStatus !== 'approved') {
// eslint-disable-next-line no-alert
alert('Please select an approved asset only!!');
} else {
const { mimetype } = selectedAsset;
let deliveryUrl;
if (mimetype && mimetype.startsWith('image')) {
deliveryUrl = `https://${selection[0]['repo:repositoryId'].replace('author', 'delivery')}`
+ `/adobe/dynamicmedia/deliver/${selection[0]['repo:assetId']}/asset.png`;
setToClipboard(deliveryUrl, mimetype);
} else if (mimetype && mimetype.startsWith('video')) {
// TODO: Determine DASH or HLS
deliveryUrl = `https://${selection[0]['repo:repositoryId'].replace('author', 'delivery')}`
+ `/adobe/dynamicmedia/deliver/${selection[0]['repo:assetId']}/video.mpd`;
setToClipboard(deliveryUrl, mimetype);
} else {
// eslint-disable-next-line no-alert
alert('Please select an image or video asset only!!');
}
}
// onClose();
}

// eslint-disable-next-line no-unused-vars
function handleNavigateToAsset(asset) {
// onClose();
}

export async function renderAssetSelectorWithImsFlow(cfg) {
const assetSelectorProps = {
repositoryId: cfg['repository-id'],
imsOrg: cfg['ims-org-id'],
onClose,
handleSelection,
handleNavigateToAsset,
env: cfg.environment.toUpperCase(),
apiKey: 'franklin',
};
const container = document.getElementById('asset-selector');
// eslint-disable-next-line no-undef
PureJSSelectors.registerAssetsSelectorsAuthService(container, assetSelectorProps, () => {
const assetSelectorDialog = document.getElementById('asset-selector-dialog');
assetSelectorDialog.showModal();
});
}

export async function logoutImsFlow() {
// eslint-disable-next-line no-console
console.log('Signing out...', imsInstance);
await imsInstance.signOut();
}
23 changes: 23 additions & 0 deletions blocks/aem-asset-selector/aem-asset-selector.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#asset-selector {
height: calc(100vh - 80px);
width: calc(100vw - 60px);
margin: -20px;
}

footer,
header {
display: none;
}

.aem-asset-selector-container {
display: flex;
}

.action-container {
display: flex;
justify-content: space-around;
}

.action-container > button {
padding: 10px;
}
29 changes: 29 additions & 0 deletions blocks/aem-asset-selector/aem-asset-selector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { readBlockConfig } from '../../scripts/lib-franklin.js';
import {
init, renderAssetSelectorWithImsFlow, logoutImsFlow,
} from './aem-asset-selector-util.js';

export default function decorate(block) {
const cfg = readBlockConfig(block);
block.textContent = '';
block.innerHTML = `
<h1>AEM Assets Selector</h1>
<div class="action-container">
<button id="as-cancel">Sign Out</button>
<button id="as-submit">Sign In</button>
</div>
<dialog id="asset-selector-dialog">
<div id="asset-selector" style="height: calc(100vh - 80px); width: calc(100vw - 60px); margin: -20px;">
</div>
</dialog>
`;
block.querySelector('#as-submit').addEventListener('click', () => {
renderAssetSelectorWithImsFlow(cfg);
});

block.querySelector('#as-cancel').addEventListener('click', () => {
logoutImsFlow();
});

init(cfg);
}
26 changes: 26 additions & 0 deletions blocks/cart-button/cart-button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.cart-button {
position: fixed;
right: 20px;
top: 0;
z-index: 9999;
background-color: #ffea00;
color: black;
cursor: pointer;
text-transform: uppercase;
font-size: 14px;
padding: 1em 2.5em;
font-weight: 600;
font-family: 'Source Sans Pro', 'helvetica neue', helvetica, ubuntu, roboto, noto, sans-serif;
display: inline-block;
box-sizing: border-box;
text-decoration: none;
border: 2px solid transparent;
text-align: center;
font-style: normal;
margin: 16px 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border-radius: 0;
line-height: 1.5;
}
7 changes: 7 additions & 0 deletions blocks/cart-button/cart-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { loadScript } from '../../scripts/lib-franklin.js';

export default function decorate(block) {
[...block.firstElementChild.children][0].textContent = 'Cart';
[...block.firstElementChild.children][0].setAttribute('onclick', 'showCart()');
}
loadScript('/blocks/cart-button/delayed.js', { type: 'text/javascript', charset: 'UTF-8' });
17 changes: 17 additions & 0 deletions blocks/cart-button/delayed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable no-unused-vars, no-undef */
function showCart() {
document.getElementById('qrCode').src = '/media_137228a68130147dd12ccbeea36029a54cf65c787.png#width=434&height=444';
// Show overlay
document.getElementById('qrOverlay').style.display = 'flex';
hideMoreDetailOverlay();
}
function hideCartOverlay() {
document.getElementById('qrOverlay').style.display = 'none';
}
function createCartOverLay() {
const QrDiv = document.createElement('div');
QrDiv.innerHTML = '<div class="overlay" id="qrOverlay"> <div class="overlay-content"> <span class="overlay-close" onclick="hideCartOverlay()">&#10006;</span> <h2>Order Here</h2> <img src="" alt="QR Code" id="qrCode" class="qr-code"></div></div>';
document.querySelector('main').append(QrDiv);
hideCartOverlay();
}
createCartOverLay();
Loading