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 c72bb0b commit d2ad18c
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 212 deletions.
5 changes: 0 additions & 5 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ OLSK_REPO_URL=https://github.com/rosano/kommit

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/kommit/touch.png

ROCO_SHARED_PROJECT_ID=RP_004
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 @@ -213,8 +213,6 @@ Counting the number of cards based on its state.
| Global (when cloud is connected) ||
:--- | ---
| `OLSKRemoteStorageLauncherItemCopyLoginLinkText` | Launcher |
| `OLSKFundLauncherItemEnterClueText` | Launcher |
| `OLSKFundLauncherItemClearClueText` | Launcher |
| `OLSKRemoteStorageLauncherItemDebugFlushDataText` | Launcher |

# Add to Home screen on mobile and tablet devices
Expand Down
149 changes: 6 additions & 143 deletions os-app/open-review/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import KOMBrowseLogic from '../sub-browse/ui-logic.js';
import OLSKThrottle from 'OLSKThrottle';
import OLSKLocalStorage from 'OLSKLocalStorage';
import OLSKCache from 'OLSKCache';
import OLSKFund from 'OLSKFund';
import OLSKPact from 'OLSKPact';
import OLSKChain from 'OLSKChain';
import OLSKBeacon from 'OLSKBeacon';
Expand All @@ -36,8 +35,6 @@ const mod = {
_ValueDecksAll: [],
ValueDecksAll (inputData) {
mod._ValueDecksAll = KOMReviewLogic.KOMReviewDeckSort(inputData);
mod.ReactDocumentRemainder();
},
_ValueDeckSelected: undefined,
Expand Down Expand Up @@ -97,16 +94,6 @@ const mod = {
});
},
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));
},
DataNavigator () {
return navigator.serviceWorker ? navigator : {
serviceWorker: {},
Expand Down Expand Up @@ -184,16 +171,6 @@ const mod = {
]);
}
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 @@ -388,23 +365,6 @@ const mod = {
});
},
},
{
LCHRecipeName: 'FakeFundDocumentLimit',
LCHRecipeCallback: async function FakeFundDocumentLimit () {
const deck = await mod._ValueZDRWrap.App.KOMDeck.KOMDeckCreate({
KOMDeckName: Math.random().toString(),
});
await Promise.all(Array.from(Array(mod._ValueDocumentRemainder)).map(function (e) {
return mod._ValueZDRWrap.App.KOMCard.KOMCardCreate(Object.assign(mod.FakeCardObjectValid(), {
KOMCardID: Math.random().toString(),
KOMCardDeckID: deck.KOMDeckID,
}), deck);
}));
return mod.SetupValueDecksAll();
},
},
]);
}
Expand Down Expand Up @@ -681,23 +641,13 @@ const mod = {
mod._ValuePlayVisible = true;
},
KOMBrowseDispatchEligible () {
if (mod._ValueDocumentRemainder < 1 && !mod.DataIsEligible()) {
return mod.OLSKFundDocumentGate();
}
return true;
},
async KOMBrowseDispatchCreate (inputData) {
(await mod.DataDeckSelectedObjects(mod._ValueDeckSelected)).$KOMDeckCards.push(inputData);
(await mod.DataDeckSelectedObjects(mod._ValueDeckSelected)).$KOMDeckSpacings.push(...Object.values(await mod._ValueZDRWrap.App.KOMSpacing.KOMSpacingList(inputData)).map(function (e) {
return Object.assign(e, {
$KOMSpacingCard: inputData,
});
}));
mod.ReactDocumentRemainder();
},
async KOMBrowseDispatchDiscard (inputData) {
Expand All @@ -707,8 +657,6 @@ const mod = {
(await mod.DataDeckSelectedObjects(mod._ValueDeckSelected)).$KOMDeckSpacings = (await mod.DataDeckSelectedObjects(mod._ValueDeckSelected)).$KOMDeckSpacings.filter(function (e) {
return e.$KOMSpacingCard !== inputData;
});
mod.ReactDocumentRemainder();
},
async KOMBrowseDispatchClose () {
Expand Down Expand Up @@ -958,45 +906,8 @@ const mod = {
ZDRSchemaDispatchSyncDeleteSpacing (inputData) {},
OLSKFundSetupDispatchClue () {
return mod.DataSetting('KOMSettingFundClue') || 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.KOMSetting.ZDRModelDeleteObject({
KOMSettingKey: 'KOMSettingFundClue',
});
}
return mod._ValueZDRWrap.App.KOMSetting.ZDRModelWriteObject({
KOMSettingKey: 'KOMSettingFundClue',
KOMSettingValue: inputData,
}).then(function () {
if (OLSK_SPEC_UI()) {
return;
}
setTimeout(function () {
window.location.reload();
}, mod._ValueZDRWrap.ZDRStorageProtocol === zerodatawrap.ZDRProtocolFission() ? 1000 : 0); // #hotfix-fission-delay
});
},
// REACT
async ReactDocumentRemainder () {
mod.OLSKFundDocumentRemainder && mod.OLSKFundDocumentRemainder(KOMReviewLogic.KOMReviewDocumentCount(mod._ValueDecksAll, Object.fromEntries(await Promise.all(Object.entries(mod._ValueDeckSelectedObjectsMap).map(async function (e) {
return [e[0], await e[1]];
})))));
},
ReactDeckIfSelected (inputData) {
if (!mod._ValueDeckSelected) {
return;
Expand Down Expand Up @@ -1104,8 +1015,6 @@ const mod = {
await mod.SetupValueDecksAll();
mod.SetupFund();
mod._ValueIsLoading = false;
// mod.ControlDemo();
Expand Down Expand Up @@ -1205,50 +1114,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();
SetupCleanup() {
window.localStorage.removeItem('OLSK_FUND_GRANT_DATA');
await OLSKFund.OLSKFundSetupPostPay(mod);
if (!mod._ValueCloudIdentity) {
return;
}
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: 'kommit',
OLSKPactAuthMetadataFolderPath: KOMDeck.KOMDeckDirectory() + '/',
},
OLSKPactPayIdentity: mod._ValueCloudIdentity,
OLSKPactPayClue: mod._ValueFundClue,
},
OLSKLocalized,
OLSKFundDispatchProgress: mod.OLSKFundDispatchProgress,
OLSKFundDispatchFail: mod.OLSKFundDispatchFail,
OLSKFundDispatchGrant: mod.OLSKFundDispatchGrant,
};
return OLSKFund.OLSKFundSetupGrant(item);
return mod._ValueSettingsAll.KOMSettingFundClue && mod._ValueZDRWrap.App.KOMSetting.ZDRModelDeleteObject({
KOMSettingKey: 'KOMSettingFundClue',
});
},
// LIFECYCLE
Expand Down Expand Up @@ -1312,7 +1183,6 @@ import OLSKApropos from 'OLSKApropos';
KOMBrowseStorageClient={ mod._ValueZDRWrap }
KOMBrowseDeckSelected={ mod._ValueDeckSelected }
KOMBrowseDeckCards={ mod._ValueBrowseCards }
KOMBrowseDispatchEligible={ mod.KOMBrowseDispatchEligible }
KOMBrowseDispatchCreate={ mod.KOMBrowseDispatchCreate }
KOMBrowseDispatchDiscard={ mod.KOMBrowseDispatchDiscard }
KOMBrowseDispatchClose={ mod.KOMBrowseDispatchClose }
Expand Down Expand Up @@ -1362,13 +1232,10 @@ import OLSKApropos from 'OLSKApropos';
OLSKAppToolbarDispatchApropos={ mod.OLSKAppToolbarDispatchApropos }
OLSKAppToolbarDispatchTongue={ mod.OLSKAppToolbarDispatchTongue }
OLSKAppToolbarGuideURL={ window.OLSKCanonical('KOMGuideRoute') }
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 @@ -1381,13 +1248,9 @@ import OLSKApropos from 'OLSKApropos';
</footer>
{/if}

{#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(OLSKFormatted(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(OLSKFormatted(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-review/ui-test-_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ describe('KOMReview_Access', function () {
return browser.assert.OLSKLauncherItems('OLSKServiceWorkerLauncherFakeItemProxy', 1);
});

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

it('hides KOMReviewLauncherItemSelectDeck', function () {
return browser.assert.OLSKLauncherItems('KOMReviewLauncherItemSelectDeck', 0);
});
Expand Down
45 changes: 0 additions & 45 deletions os-app/open-review/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 @@ -3,7 +3,6 @@ export let KOMBrowseStorageClient;
export let KOMBrowseDeckSelected;
export let KOMBrowseDeckCards;
export let KOMBrowseDispatchEligible;
export let KOMBrowseDispatchCreate;
export let KOMBrowseDispatchDiscard;
export let KOMBrowseDispatchClose;
Expand Down Expand Up @@ -142,10 +141,6 @@ const mod = {
// CONTROL
async ControlCardCreate(param1, param2 = {}) {
if (!KOMBrowseDispatchEligible()) {
return;
}
const item = await KOMBrowseStorageClient.App.KOMCard.KOMCardCreate(Object.assign(mod.DataCardObjectTemplate(), param2), param1);
mod.ControlCardActivate(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';
],
}],
}),
KOMBrowseDispatchEligible: (function () {
return true;
}),
KOMBrowseDispatchCreate: (function (inputData) {
window.TestKOMBrowseDispatchCreate.innerHTML = parseInt(window.TestKOMBrowseDispatchCreate.innerHTML) + 1;
window.TestKOMBrowseDispatchCreateData.innerHTML = JSON.stringify(Object.keys(inputData));
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 d2ad18c

Please sign in to comment.