From 03dd4e3793c4645df4fcf726c40f47f889701947 Mon Sep 17 00:00:00 2001 From: Rosano Coutinho Date: Fri, 1 Sep 2023 12:14:44 -0400 Subject: [PATCH] Purge fund --- .env-sample | 5 - os-app/open-guide/text-en.md | 2 - os-app/open-track/main.svelte | 140 ++------------------------- os-app/open-track/ui-test-_access.js | 4 - os-app/open-track/ui-test-fund.js | 35 ------- os-app/sub-browse/main.svelte | 5 - os-app/sub-browse/rollup-start.js | 3 - rollup-config.js | 5 - 8 files changed, 7 insertions(+), 192 deletions(-) delete mode 100644 os-app/open-track/ui-test-fund.js diff --git a/.env-sample b/.env-sample index a8b5b5d..57af233 100644 --- a/.env-sample +++ b/.env-sample @@ -12,11 +12,6 @@ OLSK_REPO_URL=https://github.com/rosano/emojilog OLSK_APROPOS_FEEDBACK_EMAIL="XXXXX" -OLSK_FUND_FORM_URL=https://fund.rosano.ca -OLSK_FUND_API_URL=https://fund.rosano.ca/api/grant -OLSK_FUND_PRICING_STRING="0:10 10,100 50,500 250" -OLSK_FUND_DOCUMENT_LIMIT=100 - OLSK_LAYOUT_TOUCH_ICON_URL=https://static.rosano.ca/emojilog/touch.png ROCO_SHARED_PROJECT_ID=RP_007 diff --git a/os-app/open-guide/text-en.md b/os-app/open-guide/text-en.md index 55adcb4..7aef3ed 100644 --- a/os-app/open-guide/text-en.md +++ b/os-app/open-guide/text-en.md @@ -69,8 +69,6 @@ Time is visually represented in a circle with divisions based on the duration: | Global (when cloud is connected) || :--- | --- | `OLSKRemoteStorageLauncherItemCopyLoginLinkText` | Launcher | -| `OLSKFundLauncherItemEnterClueText` | Launcher | -| `OLSKFundLauncherItemClearClueText` | Launcher | | `OLSKRemoteStorageLauncherItemDebugFlushDataText` | Launcher | # Add to Home screen on mobile and tablet devices diff --git a/os-app/open-track/main.svelte b/os-app/open-track/main.svelte index dc1b0fe..3a3e2ec 100644 --- a/os-app/open-track/main.svelte +++ b/os-app/open-track/main.svelte @@ -13,7 +13,6 @@ import EMLTransport from '../_shared/EMLTransport/main.js'; import RemoteStorage from 'remotestoragejs'; import OLSKString from 'OLSKString'; import OLSKLanguageSwitcher from 'OLSKLanguageSwitcher'; -import OLSKFund from 'OLSKFund'; import OLSKPact from 'OLSKPact'; import OLSKTransport from 'OLSKTransport'; import EMLTrackLogic from './ui-logic.js'; @@ -75,29 +74,9 @@ const mod = { }).pop() || {}).EMLSettingValue; }, - DataIsEligible (inputData = {}) { - return OLSKFund.OLSKFundIsEligible(Object.assign({ - ParamMinimumTier: 1, - ParamCurrentProject: 'ROCO_SHARED_PROJECT_ID_SWAP_TOKEN', - ParamBundleProjects: ['FakeBundleProject'], - ParamGrantTier: OLSKFund.OLSKFundTier('OLSK_FUND_PRICING_STRING_SWAP_TOKEN', mod._ValueOLSKFundGrant), - ParamGrantProject: mod._ValueOLSKFundGrant ? mod._ValueOLSKFundGrant.OLSKPactGrantProject : '', - }, inputData)); - }, - DataTrackRecipes () { const items = []; - items.push(...OLSKFund.OLSKFundRecipes({ - OLSKLocalized, - ParamConnected: !!mod._ValueCloudIdentity, - ParamAuthorized: !!mod._ValueFundClue, - OLSKFundDispatchGrant: mod.OLSKFundDispatchGrant, - OLSKFundDispatchPersist: mod.OLSKFundDispatchPersist, - ParamMod: mod, - ParamSpecUI: OLSK_SPEC_UI(), - })); - items.push(...zerodatawrap.ZDRRecipes({ ParamMod: mod, ParamSpecUI: OLSK_SPEC_UI(), @@ -189,17 +168,6 @@ const mod = { return this.api.OLSKTransportLauncherFakeItemExportSerialized(await mod._OLSKTransportDispatchExportInput([mod._ValueJournalSelected])); }, }, - { - LCHRecipeName: 'FakeFundDocumentLimit', - LCHRecipeCallback: async function FakeFundDocumentLimit () { - await mod._ValueZDRWrap.App.EMLJournal.EMLJournalCreate({ - EMLJournalName: Math.random().toString(), - EMLJournalChildCount: mod._ValueDocumentRemainder, - }); - - return mod.SetupValueJournalsAll(); - }, - }, ]); } @@ -312,14 +280,6 @@ const mod = { mod.ControlJournalSelect(inputData); }, - EMLBrowseDispatchEligible () { - if (mod._ValueDocumentRemainder < 1 && !mod.DataIsEligible()) { - return mod.OLSKFundDocumentGate(); - } - - return true; - }, - EMLBrowseListDispatchClose () { mod.ControlJournalSelect(null); @@ -338,8 +298,6 @@ const mod = { mod.ControlJournalSave(Object.assign(mod._ValueJournalSelected, { EMLJournalChildCount, })); - - mod.ReactDocumentRemainder(); }, EMLTemplateDispatchUpdate () { @@ -483,42 +441,6 @@ const mod = { mod._ValueZDRWrap.ZDRStorageClient().stopSync(); }, - OLSKFundSetupDispatchClue () { - return mod.DataSetting('EMLSettingFundClue') || null; - }, - - _OLSKFundSetupDispatchUpdate (inputData) { - mod[inputData] = mod[inputData]; // #purge-svelte-force-update - }, - - OLSKFundDispatchPersist (inputData) { - mod._ValueFundClue = inputData; // #hotfix-missing-persist - - if (!inputData) { - return mod._ValueZDRWrap.App.EMLSetting.ZDRModelDeleteObject({ - EMLSettingKey: 'EMLSettingFundClue', - }); - } - - return mod._ValueZDRWrap.App.EMLSetting.ZDRModelWriteObject({ - EMLSettingKey: 'EMLSettingFundClue', - EMLSettingValue: inputData, - }).then(function () { - if (OLSK_SPEC_UI()) { - return; - } - setTimeout(function () { - window.location.reload(); - }, mod._ValueZDRWrap.ZDRStorageProtocol === zerodatawrap.ZDRProtocolFission() ? 1000 : 0); // #hotfix-fission-delay - }); - }, - - // REACT - - ReactDocumentRemainder () { - mod.OLSKFundDocumentRemainder && mod.OLSKFundDocumentRemainder(EMLTrackLogic.EMLTrackDocumentCount(mod._ValueJournalsAll)); - }, - // SETUP async SetupEverything () { @@ -530,7 +452,7 @@ const mod = { mod.SetupCollectionAPI(); - mod.SetupFund(); + await mod.SetupCleanup(); mod._ValueIsLoading = false; }, @@ -598,8 +520,6 @@ const mod = { }); mod._EMLTrackJournals.modPublic.OLSKCollectionSort(); - - mod.ReactDocumentRemainder(); }, async SetupSettingsAll () { @@ -619,50 +539,12 @@ const mod = { }); }, - async SetupFund () { - OLSKFund.OLSKFundSetup({ - ParamMod: mod, - OLSKLocalized, - ParamFormURL: 'OLSK_FUND_FORM_URL_SWAP_TOKEN', - ParamProject: 'ROCO_SHARED_PROJECT_ID_SWAP_TOKEN', - ParamSpecUI: OLSK_SPEC_UI(), - ParamDocumentLimit: parseInt('OLSK_FUND_DOCUMENT_LIMIT_SWAP_TOKEN'), - }); - - mod.ReactDocumentRemainder(); - - await OLSKFund.OLSKFundSetupPostPay(mod); - - if (!mod._ValueCloudIdentity) { - return; - } + SetupCleanup() { + window.localStorage.removeItem('OLSK_FUND_GRANT_DATA'); - if (!mod._ValueFundClue) { - return; - } - - const item = { - OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE: `OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE_SWAP_TOKEN${ '' }`, // #purge - OLSK_CRYPTO_PAIR_SENDER_PUBLIC: 'OLSK_CRYPTO_PAIR_SENDER_PUBLIC_SWAP_TOKEN', - OLSK_FUND_API_URL: 'OLSK_FUND_API_URL_SWAP_TOKEN', - ParamBody: { - OLSKPactAuthType: mod._ValueZDRWrap.ZDRStorageProtocol === zerodatawrap.ZDRProtocolRemoteStorage() ? OLSKPact.OLSKPactAuthTypeRemoteStorage() : OLSKPact.OLSKPactAuthTypeFission(), - OLSKPactAuthIdentity: mod._ValueCloudIdentity, - OLSKPactAuthProof: mod._ValueCloudToken, - OLSKPactAuthMetadata: { - OLSKPactAuthMetadataModuleName: 'emojilog', - OLSKPactAuthMetadataFolderPath: EMLJournal.EMLJournalDirectory() + '/', - }, - OLSKPactPayIdentity: mod._ValueCloudIdentity, - OLSKPactPayClue: mod._ValueFundClue, - }, - OLSKLocalized, - OLSKFundDispatchProgress: mod.OLSKFundDispatchProgress, - OLSKFundDispatchFail: mod.OLSKFundDispatchFail, - OLSKFundDispatchGrant: mod.OLSKFundDispatchGrant, - }; - - return OLSKFund.OLSKFundSetupGrant(item); + return mod._ValueSettingsAll.EMLSettingFundClue && mod._ValueZDRWrap.App.EMLSetting.ZDRModelDeleteObject({ + EMLSettingKey: 'EMLSettingFundClue', + }); }, // LIFECYCLE @@ -705,7 +587,6 @@ import OLSKApropos from 'OLSKApropos'; EMLBrowseShowTemplateForm={ mod._ValueShowTemplateForm } EMLBrowseListDispatchClose={ mod.EMLBrowseListDispatchClose } EMLBrowseListDispatchTouch={ mod.EMLBrowseListDispatchTouch } - EMLBrowseDispatchEligible={ mod.EMLBrowseDispatchEligible } OLSKCatalogDispatchQuantity={ mod.OLSKCatalogDispatchQuantity } EMLTemplateDispatchDiscard={ mod.EMLTemplateDispatchDiscard } EMLTemplateDispatchUpdate={ mod.EMLTemplateDispatchUpdate } @@ -739,13 +620,10 @@ import OLSKApropos from 'OLSKApropos'; OLSKAppToolbarDispatchApropos={ mod.OLSKAppToolbarDispatchApropos } OLSKAppToolbarDispatchTongue={ mod.OLSKAppToolbarDispatchTongue } OLSKAppToolbarGuideURL={ window.OLSKCanonical('EMLGuideRoute') } - OLSKAppToolbarFundShowProgress={ mod._ValueOLSKFundProgress } - OLSKAppToolbarFundLimitText={ mod._ValueDocumentRemainder } OLSKAppToolbarErrorText={ mod._OLSKAppToolbarErrorText } OLSKAppToolbarCloudConnected={ !!mod._ValueCloudIdentity } OLSKAppToolbarCloudOffline={ mod._ValueCloudIsOffline } OLSKAppToolbarCloudError={ !!mod._ValueCloudErrorText } - OLSKAppToolbarDispatchFund={ mod._ValueOLSKFundGrant || OLSKFund.OLSKFundResponseIsPresent() ? null : mod.OLSKAppToolbarDispatchFund } OLSKAppToolbarDispatchCloud={ mod.OLSKAppToolbarDispatchCloud } OLSKAppToolbarDispatchLauncher={ mod.OLSKAppToolbarDispatchLauncher } /> @@ -757,13 +635,9 @@ import OLSKApropos from 'OLSKApropos'; {/if} -{#if !!mod._ValueCloudIdentity } - -{/if} - diff --git a/os-app/open-track/ui-test-_access.js b/os-app/open-track/ui-test-_access.js index 4a9a751..1491914 100644 --- a/os-app/open-track/ui-test-_access.js +++ b/os-app/open-track/ui-test-_access.js @@ -78,10 +78,6 @@ describe('EMLTrack_Access', function () { return browser.assert.OLSKLauncherItems('OLSKServiceWorkerLauncherFakeItemProxy', 1); }); - it('shows OLSKFundLauncherFakeItemProxy', function () { - return browser.assert.OLSKLauncherItems('OLSKFundLauncherFakeItemProxy', 1); - }); - it('shows EMLTrackJournalsLauncherFakeItemProxy', function () { return browser.assert.OLSKLauncherItems('EMLTrackJournalsLauncherFakeItemProxy', 1); }); diff --git a/os-app/open-track/ui-test-fund.js b/os-app/open-track/ui-test-fund.js deleted file mode 100644 index d818d82..0000000 --- a/os-app/open-track/ui-test-fund.js +++ /dev/null @@ -1,35 +0,0 @@ -const kDefaultRoute = require('./controller.js').OLSKControllerRoutes().shift(); - -describe('EMLTrack_Fund', function () { - - require('OLSKFund/ui-test_template').default({ - - kDefaultRoute, - - ParamProject: process.env.ROCO_SHARED_PROJECT_ID, - - ParamTriggerGate () { - return browser.pressButton('.EMLBrowseCreateButton'); - }, - - async ParamBeforeCreate () { - await browser.pressButton('.EMLTrackJournalsCreateButton'); - - return browser.pressButton('.OLSKModalViewCloseButton'); - }, - - ParamCreateDocument () { - return browser.pressButton('.EMLBrowseCreateButton'); - }, - - ParamDeleteDocument () { - return browser.pressButton('.EMLBrowseInfoToolbarDiscardButton'); - }, - - ParamCreateDocumentSync () { - return browser.OLSKLauncherRun('FakeSyncCreateMemo'); - }, - - }); - -}); diff --git a/os-app/sub-browse/main.svelte b/os-app/sub-browse/main.svelte index f3ddd47..1bd8676 100644 --- a/os-app/sub-browse/main.svelte +++ b/os-app/sub-browse/main.svelte @@ -7,7 +7,6 @@ export let EMLBrowseShowTemplateForm = false; export let OLSKCatalogDispatchQuantity; export let EMLBrowseListDispatchClose; export let EMLBrowseListDispatchTouch; -export let EMLBrowseDispatchEligible; export let EMLTemplateDispatchUpdate; export let EMLTemplateDispatchDiscard; export let EMLBrowse_DEBUG = false; @@ -126,10 +125,6 @@ const mod = { // CONTROL async ControlMemoCreate(inputData) { - if (!EMLBrowseDispatchEligible()) { - return; - } - const item = await EMLBrowseStorageClient.App.EMLMemo.EMLMemoCreate(mod.DataMemoObjectTemplate(), inputData); mod.ControlMemoActivate(mod._OLSKCatalog.modPublic.OLSKCatalogInsert(item)); diff --git a/os-app/sub-browse/rollup-start.js b/os-app/sub-browse/rollup-start.js index 8431481..8347a11 100644 --- a/os-app/sub-browse/rollup-start.js +++ b/os-app/sub-browse/rollup-start.js @@ -19,9 +19,6 @@ import zerodatawrap from 'zerodatawrap'; ], }], }), - EMLBrowseDispatchEligible: (function () { - return true; - }), OLSKCatalogDispatchQuantity: (function () {}), EMLTemplateDispatchUpdate: (function () {}), EMLTemplateDispatchDiscard: (function () {}), diff --git a/rollup-config.js b/rollup-config.js index 231fb2b..a3880ac 100644 --- a/rollup-config.js +++ b/rollup-config.js @@ -2,11 +2,6 @@ export default require('OLSKRollupScaffold').OLSKRollupScaffoldScanStart(__dirna OLSKRollupPluginSwapTokens: Object.assign(require('OLSKUIAssets').OLSKUIAssetsSwapTokens(), { OLSK_APROPOS_FEEDBACK_EMAIL_SWAP_TOKEN: Buffer.from(`mailto:${ process.env.OLSK_APROPOS_FEEDBACK_EMAIL }`).toString('base64'), - OLSK_FUND_API_URL_SWAP_TOKEN: process.env.OLSK_FUND_API_URL, - OLSK_FUND_FORM_URL_SWAP_TOKEN: process.env.OLSK_FUND_FORM_URL, - OLSK_FUND_PRICING_STRING_SWAP_TOKEN: process.env.OLSK_FUND_PRICING_STRING, - OLSK_FUND_DOCUMENT_LIMIT_SWAP_TOKEN: process.env.OLSK_FUND_DOCUMENT_LIMIT, - OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_RECEIVER_PRIVATE, OLSK_CRYPTO_PAIR_SENDER_PUBLIC_SWAP_TOKEN: process.env.OLSK_CRYPTO_PAIR_SENDER_PUBLIC,