Skip to content

Commit

Permalink
spec debug item
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Mar 2, 2024
1 parent 0ac7df7 commit 1d8e09d
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions os-app/open-guide/text-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Note: this only works with a trailing slash before `#`.
| Submit capture box | `Control+Enter` or `Command+Enter` |
| `JBXPlayDetailToolbarArchiveButtonText` | Launcher |
| `JBXPlayDetailToolbarUnarchiveButtonText` | Launcher |
| `JBXPlayDetailToolbarDebugButtonText` | Launcher |
| Select previous or next item, if filter field is focused | `Up` or `Down` |
| Clear filter text and selected item, focus filter field | `Escape` |
| Close, if filter field is focused | `Escape` |
Expand Down
12 changes: 12 additions & 0 deletions os-app/open-play/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,17 @@ const mod = {
mod.ControlDocumentDiscard(mod._OLSKCatalog.modPublic.OLSKCatalogDataItemSelected());
},
JBXPlayDetailDispatchDebug () {
const url = `https://inspektor.5apps.com/inspect?path=joybox%2F${ encodeURIComponent(JBXDocument.JBXDocumentObjectPath(mod._OLSKCatalog.modPublic.OLSKCatalogDataItemSelected())) }`;
if (OLSK_SPEC_UI()) {
window.FakeWindowOpen = url;
return;
}
window.open(url)
},
JBXPlayDetailDispatchQueue () {
mod.ControlDocumentQueue(mod._OLSKCatalog.modPublic.OLSKCatalogDataItemSelected());
},
Expand Down Expand Up @@ -847,6 +858,7 @@ import OLSKUIAssets from 'OLSKUIAssets';
JBXPlayDetailDispatchFetch={ mod.JBXPlayDetailDispatchFetch }
JBXPlayDetailDispatchUpdate={ mod.JBXPlayDetailDispatchUpdate }
JBXPlayDetailDispatchDiscard={ mod.JBXPlayDetailDispatchDiscard }
JBXPlayDetailDispatchDebug={ mod.JBXPlayDetailDispatchDebug }
JBXPlayDetailDispatchQueue={ mod.JBXPlayDetailDispatchQueue }
bind:this={ mod._JBXPlayDetail }
/>
Expand Down
1 change: 1 addition & 0 deletions os-app/sub-detail/i18n-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ JBXPlayDetailToolbarQueueButtonText: Add to collection
JBXPlayDetailToolbarArchiveButtonText: Archive
JBXPlayDetailToolbarUnarchiveButtonText: Unarchive
JBXPlayDetailToolbarDiscardButtonText: Discard
JBXPlayDetailToolbarDebugButtonText: Debug
JBXPlayDetailMediaURLFieldText: URL
JBXPlayDetailMediaOpenButtonText: Open
JBXPlayDetailMediaFetchButtonText: Fetch
Expand Down
1 change: 1 addition & 0 deletions os-app/sub-detail/i18n-es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ JBXPlayDetailToolbarQueueButtonText: Añadir a la colección
JBXPlayDetailToolbarArchiveButtonText: Archivar
JBXPlayDetailToolbarUnarchiveButtonText: Desarchivar
JBXPlayDetailToolbarDiscardButtonText: Descartar
JBXPlayDetailToolbarDebugButtonText: Debug
JBXPlayDetailMediaURLFieldText: URL
JBXPlayDetailMediaOpenButtonText: Abrir
JBXPlayDetailMediaFetchButtonText: Recuperar
Expand Down
1 change: 1 addition & 0 deletions os-app/sub-detail/i18n-fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ JBXPlayDetailToolbarQueueButtonText: Ajouter à la collection
JBXPlayDetailToolbarArchiveButtonText: Archiver
JBXPlayDetailToolbarUnarchiveButtonText: Désarchiver
JBXPlayDetailToolbarDiscardButtonText: Jeter
JBXPlayDetailToolbarDebugButtonText: Debug
JBXPlayDetailMediaURLFieldText: URL
JBXPlayDetailMediaOpenButtonText: Ouvrir
JBXPlayDetailMediaFetchButtonText: Chercher
Expand Down
1 change: 1 addition & 0 deletions os-app/sub-detail/i18n-pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ JBXPlayDetailToolbarQueueButtonText: Adicionar à coleção
JBXPlayDetailToolbarArchiveButtonText: Arquivar
JBXPlayDetailToolbarUnarchiveButtonText: Desarquivar
JBXPlayDetailToolbarDiscardButtonText: Descartar
JBXPlayDetailToolbarDebugButtonText: Debug
JBXPlayDetailMediaURLFieldText: URL
JBXPlayDetailMediaOpenButtonText: Abrir
JBXPlayDetailMediaFetchButtonText: Buscar
Expand Down
9 changes: 8 additions & 1 deletion os-app/sub-detail/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export let JBXPlayDetailItem;
export let JBXPlayDetailDispatchBack;
export let JBXPlayDetailDispatchArchive;
export let JBXPlayDetailDispatchDebug;
export let JBXPlayDetailDispatchUnarchive;
export let JBXPlayDetailDispatchFetch;
export let JBXPlayDetailDispatchUpdate;
Expand All @@ -28,7 +29,13 @@ const mod = {
// DATA
DataPlayDetailRecipes () {
const outputData = [];
const outputData = [{
LCHRecipeSignature: 'JBXPlayDetailLauncherItemDebug',
LCHRecipeName: OLSKLocalized('JBXPlayDetailToolbarDebugButtonText'),
LCHRecipeCallback: function JBXPlayDetailLauncherItemDebug () {
JBXPlayDetailDispatchDebug()
},
}];
if (!JBXPlayDetailItem.$JBXDocumentIsInbox && !JBXPlayDetailItem.JBXDocumentArchiveDate) {
outputData.push({
Expand Down
3 changes: 3 additions & 0 deletions os-app/sub-detail/rollup-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const JBXPlayDetail = new RollupStart({
JBXPlayDetailDispatchDiscard: (function () {
window.TestJBXPlayDetailDispatchDiscard.innerHTML = parseInt(window.TestJBXPlayDetailDispatchDiscard.innerHTML) + 1;
}),
JBXPlayDetailDispatchDebug: (function () {
window.TestJBXPlayDetailDispatchDebug.innerHTML = parseInt(window.TestJBXPlayDetailDispatchDebug.innerHTML) + 1;
}),
JBXPlayDetailDispatchQueue: (function () {
window.TestJBXPlayDetailDispatchQueue.innerHTML = parseInt(window.TestJBXPlayDetailDispatchQueue.innerHTML) + 1;
}),
Expand Down
5 changes: 5 additions & 0 deletions os-app/sub-detail/stub-view.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ locals.OLSKPagePublicConstants = {
<span id="TestJBXPlayDetailDispatchDiscard">0</span>
</p>

<p>
<strong>JBXPlayDetailDispatchDebug</strong>
<span id="TestJBXPlayDetailDispatchDebug">0</span>
</p>

<p>
<strong>JBXPlayDetailDispatchQueue</strong>
<span id="TestJBXPlayDetailDispatchQueue">0</span>
Expand Down
4 changes: 4 additions & 0 deletions os-app/sub-detail/ui-test-_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ describe('JBXPlayDetail_Access', function () {
return browser.assert.OLSKLauncherItems('JBXPlayDetailLauncherItemUnarchive', 0);
});

it('shows JBXPlayDetailLauncherItemDebug', function () {
return browser.assert.OLSKLauncherItems('JBXPlayDetailLauncherItemDebug', 1);
});

context('JBXDocumentURL', function() {

before(function() {
Expand Down
4 changes: 4 additions & 0 deletions os-app/sub-detail/ui-test-_localize.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) {
return browser.assert.OLSKLauncherItemText('JBXPlayDetailLauncherItemArchive', uLocalized('JBXPlayDetailToolbarArchiveButtonText'));
});

it('localizes JBXPlayDetailLauncherItemDebug', function () {
return browser.assert.OLSKLauncherItemText('JBXPlayDetailLauncherItemDebug', uLocalized('JBXPlayDetailToolbarDebugButtonText'));
});

context('discard', function () {

it('localizes JBXPlayDetailDiscardConfirm', function() {
Expand Down
22 changes: 22 additions & 0 deletions os-app/sub-detail/ui-test-_misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,28 @@ describe('JBXPlayDetail_Misc', function () {

});

describe('JBXPlayDetailLauncherItemDebug', function test_JBXPlayDetailLauncherItemDebug() {

before(function() {
return browser.OLSKVisit(kDefaultRoute, {
JBXPlayDetailItem: JSON.stringify(StubDocumentObjectValid()),
});
});

before(function () {
browser.assert.text('#TestJBXPlayDetailDispatchDebug', '0');
});

before(function () {
return browser.OLSKLauncherRun('JBXPlayDetailLauncherItemDebug');
});

it('sends JBXPlayDetailDispatchDebug', function () {
browser.assert.text('#TestJBXPlayDetailDispatchDebug', '1');
});

});

context('$JBXDocumentIsInbox', function() {

before(function() {
Expand Down

0 comments on commit 1d8e09d

Please sign in to comment.