Skip to content

Commit

Permalink
spec debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Mar 2, 2024
1 parent e10e2cd commit 5a9fe72
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 0 deletions.
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 @@ -127,6 +127,7 @@ After setting up a custom domain, designate any note as the home page with the `
| `KVCWriteDetailToolbarUnarchiveButtonText` | Launcher |
| `KVCWriteDetailLauncherItemCloneText` | Launcher |
| `KVCWriteDetailLauncherItemShowLocalVersionsText` | Launcher |
| `KVCWriteDetailLauncherItemDebugText` | Launcher |
| KVCWriteDetailToolbarJumpButtonText | `AccessKey+j` |
| Select previous or next note, if filter field is focused | `Up` or `Down` |
| Clear filter text and selected note, focus filter field | `Escape` |
Expand Down
12 changes: 12 additions & 0 deletions os-app/open-write/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,17 @@ const mod = {
mod.ControlNoteClone(mod._OLSKCatalog.modPublic.OLSKCatalogDataItemSelected());
},
KVCWriteDetailDispatchDebug () {
const url = `https://inspektor.5apps.com/inspect?path=wikiavec%2F${ encodeURIComponent(KVCNote.KVCNoteObjectPath(mod._OLSKCatalog.modPublic.OLSKCatalogDataItemSelected())) }`;
if (OLSK_SPEC_UI()) {
window.FakeWindowOpen = url;
return;
}
window.open(url)
},
KVCWriteDetailDispatchDiscard () {
mod.ControlNoteDiscard(mod._OLSKCatalog.modPublic.OLSKCatalogDataItemSelected());
},
Expand Down Expand Up @@ -1134,6 +1145,7 @@ import OLSKUIAssets from 'OLSKUIAssets';
KVCWriteDetailDispatchRetract={ mod.KVCWriteDetailDispatchRetract }
KVCWriteDetailDispatchVersions={ mod.KVCWriteDetailDispatchVersions }
KVCWriteDetailDispatchClone={ mod.KVCWriteDetailDispatchClone }
KVCWriteDetailDispatchDebug={ mod.KVCWriteDetailDispatchDebug }
KVCWriteDetailDispatchDiscard={ mod.KVCWriteDetailDispatchDiscard }
KVCWriteDetailDispatchUpdate={ mod.KVCWriteDetailDispatchUpdate }
KVCWriteDetailDispatchSetAsRootPage={ mod.KVCWriteDetailDispatchSetAsRootPage }
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 @@ -9,5 +9,6 @@ KVCWriteDetailToolbarRetractButtonText: Retract
KVCWriteDetailToolbarDiscardButtonText: Discard
KVCWriteDetailLauncherItemShowLocalVersionsText: Show local versions
KVCWriteDetailLauncherItemCloneText: Clone
KVCWriteDetailLauncherItemDebugText: Debug note
KVCWriteDetailLauncherItemOpenPublicLinkText: Open public link
KVCWriteDetailLauncherItemSetAsRootPageText: Set as homepage
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 @@ -9,5 +9,6 @@ KVCWriteDetailToolbarRetractButtonText: Retractarse
KVCWriteDetailToolbarDiscardButtonText: Eliminar
KVCWriteDetailLauncherItemShowLocalVersionsText: Mostrar versiones locales
KVCWriteDetailLauncherItemCloneText: Clonar
KVCWriteDetailLauncherItemDebugText: Debug nota
KVCWriteDetailLauncherItemOpenPublicLinkText: Abrir enlace público
KVCWriteDetailLauncherItemSetAsRootPageText: Fijar como página de raíz
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 @@ -9,5 +9,6 @@ KVCWriteDetailToolbarRetractButtonText: Rétracter
KVCWriteDetailToolbarDiscardButtonText: Supprimer
KVCWriteDetailLauncherItemShowLocalVersionsText: Montrer des versions locales
KVCWriteDetailLauncherItemCloneText: Cloner
KVCWriteDetailLauncherItemDebugText: Déboguer note
KVCWriteDetailLauncherItemOpenPublicLinkText: Ouvrir le lien publique
KVCWriteDetailLauncherItemSetAsRootPageText: Fixer comme page de racine
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 @@ -9,5 +9,6 @@ KVCWriteDetailToolbarRetractButtonText: Retirar
KVCWriteDetailToolbarDiscardButtonText: Descartar
KVCWriteDetailLauncherItemShowLocalVersionsText: Mostrar versões locais
KVCWriteDetailLauncherItemCloneText: Clonar
KVCWriteDetailLauncherItemDebugText: Debug nota
KVCWriteDetailLauncherItemOpenPublicLinkText: Abrir link público
KVCWriteDetailLauncherItemSetAsRootPageText: Definir como página inicial
7 changes: 7 additions & 0 deletions os-app/sub-detail/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export let KVCWriteDetailDispatchPublish;
export let KVCWriteDetailDispatchRetract;
export let KVCWriteDetailDispatchVersions;
export let KVCWriteDetailDispatchClone;
export let KVCWriteDetailDispatchDebug;
export let KVCWriteDetailDispatchDiscard;
export let KVCWriteDetailDispatchUpdate;
export let KVCWriteDetailDispatchSetAsRootPage;
Expand Down Expand Up @@ -144,6 +145,12 @@ const mod = {
LCHRecipeIsExcluded () {
return !KVCNote.KVCNoteIsMarkedPublic(KVCWriteDetailItem);
},
}, {
LCHRecipeSignature: 'KVCWriteDetailLauncherItemDebug',
LCHRecipeName: OLSKLocalized('KVCWriteDetailLauncherItemDebugText'),
LCHRecipeCallback: function KVCWriteDetailLauncherItemDebug () {
KVCWriteDetailDispatchDebug();
},
}]);
}
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 @@ -81,6 +81,9 @@ const KVCWriteDetail = new RollupStart({
KVCWriteDetailDispatchClone: (function () {
window.TestKVCWriteDetailDispatchClone.innerHTML = parseInt(window.TestKVCWriteDetailDispatchClone.innerHTML) + 1;
}),
KVCWriteDetailDispatchDebug: (function () {
window.TestKVCWriteDetailDispatchDebug.innerHTML = parseInt(window.TestKVCWriteDetailDispatchDebug.innerHTML) + 1;
}),
KVCWriteDetailDispatchDiscard: (function () {
window.TestKVCWriteDetailDispatchDiscard.innerHTML = parseInt(window.TestKVCWriteDetailDispatchDiscard.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 @@ -83,6 +83,11 @@ locals.OLSKPagePublicConstants = {
<span id="TestKVCWriteDetailDispatchClone">0</span>
</p>

<p>
<strong>KVCWriteDetailDispatchDebug</strong>
<span id="TestKVCWriteDetailDispatchDebug">0</span>
</p>

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

it('hides KVCWriteDetailLauncherItemDebug', function () {
return browser.assert.OLSKLauncherItems('KVCWriteDetailLauncherItemDebug', 0);
});

context('KVCWriteInputDispatchHeaderTokens', function() {

before(function() {
Expand Down Expand Up @@ -217,6 +221,10 @@ describe('KVCWriteDetail_Access', function () {
return browser.assert.OLSKLauncherItems('KVCWriteDetailLauncherItemPublish', 1);
});

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

it('hides KVCWriteDetailLauncherItemOpenPublicLink', function () {
return browser.assert.OLSKLauncherItems('KVCWriteDetailLauncherItemOpenPublicLink', 0);
});
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 @@ -117,6 +117,10 @@ kDefaultRoute.OLSKRouteLanguageCodes.forEach(function (OLSKRoutingLanguage) {
return browser.assert.OLSKLauncherItemText('KVCWriteDetailLauncherItemPublish', uLocalized('KVCWriteDetailToolbarPublishButtonText'));
});

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

context('KVCNoteIsMarkedPublic', function() {

before(function() {
Expand Down
16 changes: 16 additions & 0 deletions os-app/sub-detail/ui-test-_misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,22 @@ describe('KVCWriteDetail_Misc', function () {

});

describe('KVCWriteDetailLauncherItemDebug', function test_KVCWriteDetailLauncherItemDebug() {

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

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

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

});

describe('KVCWriteDetailToolbarRetractButton', function test_KVCWriteDetailToolbarRetractButton () {

it('classes OLSKDecorButtonNoStyle', function () {
Expand Down

0 comments on commit 5a9fe72

Please sign in to comment.