storebound/tests/fixtures/console/asc-teams.html

58 lines
3.5 KiB
HTML

<!doctype html>
<!-- MODELED, not recorded: App Store Connect > Apps for an Apple Account in three teams. The account menu at the top
right lists the teams (Apple's help "Switch between teams"); picking one reloads the console in that team (here: a
cookie). The New App dialog's Bundle ID list holds only the current team's bundle ids: com.example.game is in the
2nd team. Sign Out, Edit Profile, Create and Submit for Review must never be clicked. Placeholder data only. -->
<html lang="en"><head><meta charset="utf-8"><title>Apps - App Store Connect</title><script src="/_common.js"></script></head>
<body>
<header>
<button type="button" id="acct" aria-label="Account" aria-haspopup="menu">Example Owner</button>
<div role="menu" id="acctmenu" aria-label="Account" hidden></div>
</header>
<h1>Apps</h1>
<button type="button" id="plus" aria-label="Add Apps" aria-haspopup="menu">+</button>
<div role="menu" id="menu" hidden>
<div role="menuitem" tabindex="0" id="newapp">New App</div>
<div role="menuitem" tabindex="0">New App Bundle</div>
</div>
<button type="button">Submit for Review</button>
<div role="dialog" aria-labelledby="t" id="dlg" hidden>
<h2 id="t">New App</h2>
<fieldset><legend>Platforms</legend>
<label><input type="checkbox"> iOS</label> <label><input type="checkbox"> macOS</label>
</fieldset>
<p><label>Name <input type="text" maxlength="30"></label></p>
<p><label>Primary Language <select><option value="">Choose</option><option>English (U.K.)</option><option>English (U.S.)</option></select></label></p>
<p><label>Bundle ID <select id="bundle"><option value="">Choose</option></select></label></p>
<p><label>SKU <input type="text"></label></p>
<fieldset><legend>User Access</legend>
<label><input type="radio" name="access"> Limited Access</label> <label><input type="radio" name="access"> Full Access</label>
</fieldset>
<button type="button" id="cancel">Cancel</button> <button type="button">Create</button>
</div>
<script>
const TEAMS = { 'Alpha Studio': 'com.example.other', 'Example Games Ltd': 'com.example.game', 'Gamma Apps': 'com.example.gamma' };
const team = (document.cookie.match(/(?:^|; )team=([^;]+)/) || [])[1];
const current = team ? decodeURIComponent(team) : 'Alpha Studio';
const menu = document.getElementById('acctmenu');
for (const name of [...Object.keys(TEAMS), 'Edit Profile', 'Sign Out']) {
const it = document.createElement('div');
it.tabIndex = 0;
it.textContent = name;
if (TEAMS[name]) {
it.setAttribute('role', 'menuitemradio');
it.setAttribute('aria-checked', String(name === current));
it.addEventListener('click', () => { document.cookie = 'team=' + encodeURIComponent(name) + '; path=/'; location.reload(); });
} else it.setAttribute('role', 'menuitem');
menu.appendChild(it);
}
document.getElementById('acct').addEventListener('click', () => { menu.hidden = !menu.hidden; });
document.addEventListener('keydown', e => { if (e.key === 'Escape') menu.hidden = true; });
const opt = document.createElement('option');
opt.textContent = 'App - ' + TEAMS[current];
document.getElementById('bundle').appendChild(opt);
document.getElementById('plus').addEventListener('click', () => { document.getElementById('menu').hidden = false; });
document.getElementById('newapp').addEventListener('click', () => { document.getElementById('menu').hidden = true; document.getElementById('dlg').hidden = false; });
document.getElementById('cancel').addEventListener('click', () => { document.getElementById('dlg').hidden = true; });
</script>
</body></html>