Skip to content

Commit

Permalink
Purge fund
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Sep 1, 2023
1 parent 9b34eb1 commit 03dd4e3
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 192 deletions.
5 changes: 0 additions & 5 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions os-app/open-guide/text-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
140 changes: 7 additions & 133 deletions os-app/open-track/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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();
},
},
]);
}
Expand Down Expand Up @@ -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);
Expand All @@ -338,8 +298,6 @@ const mod = {
mod.ControlJournalSave(Object.assign(mod._ValueJournalSelected, {
EMLJournalChildCount,
}));
mod.ReactDocumentRemainder();
},
EMLTemplateDispatchUpdate () {
Expand Down Expand Up @@ -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 () {
Expand All @@ -530,7 +452,7 @@ const mod = {
mod.SetupCollectionAPI();
mod.SetupFund();
await mod.SetupCleanup();
mod._ValueIsLoading = false;
},
Expand Down Expand Up @@ -598,8 +520,6 @@ const mod = {
});
mod._EMLTrackJournals.modPublic.OLSKCollectionSort();
mod.ReactDocumentRemainder();
},
async SetupSettingsAll () {
Expand All @@ -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
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
/>
Expand All @@ -757,13 +635,9 @@ import OLSKApropos from 'OLSKApropos';
{/if}
</footer>

{#if !!mod._ValueCloudIdentity }
<OLSKWebView OLSKModalViewTitleText={ OLSKLocalized('OLSKFundWebViewTitleText') } OLSKWebViewURL={ mod._ValueFundURL } bind:this={ mod._OLSKWebView } DEBUG_OLSKWebViewDataSource={ OLSK_SPEC_UI() } />
{/if}

<OLSKModalView OLSKModalViewTitleText={ OLSKLocalized('OLSKAproposHeadingText') } bind:this={ mod._OLSKModalView } OLSKModalViewIsCapped={ true }>
<OLSKApropos
OLSKAproposFeedbackValue={ `javascript:window.location.href = window.atob('${ window.btoa(OLSKString.OLSKStringFormatted(window.atob('OLSK_APROPOS_FEEDBACK_EMAIL_SWAP_TOKEN'), 'ROCO_SHARED_PROJECT_ID_SWAP_TOKEN' + (mod._ValueFundClue ? '+' + mod._ValueFundClue : ''))) }')` }
OLSKAproposFeedbackValue={ `javascript:window.location.href = window.atob('${ window.btoa(OLSKString.OLSKStringFormatted(window.atob('OLSK_APROPOS_FEEDBACK_EMAIL_SWAP_TOKEN'), 'ROCO_SHARED_PROJECT_ID_SWAP_TOKEN')) }')` }
/>
</OLSKModalView>

Expand Down
4 changes: 0 additions & 4 deletions os-app/open-track/ui-test-_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
35 changes: 0 additions & 35 deletions os-app/open-track/ui-test-fund.js

This file was deleted.

5 changes: 0 additions & 5 deletions os-app/sub-browse/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
3 changes: 0 additions & 3 deletions os-app/sub-browse/rollup-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import zerodatawrap from 'zerodatawrap';
],
}],
}),
EMLBrowseDispatchEligible: (function () {
return true;
}),
OLSKCatalogDispatchQuantity: (function () {}),
EMLTemplateDispatchUpdate: (function () {}),
EMLTemplateDispatchDiscard: (function () {}),
Expand Down
5 changes: 0 additions & 5 deletions rollup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down

0 comments on commit 03dd4e3

Please sign in to comment.