Skip to content

Commit

Permalink
feat: added routing for launch-new-indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin101Zhang committed Jul 26, 2024
1 parent 01632b9 commit a8387d4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
2 changes: 2 additions & 0 deletions frontend/widgets/src/QueryApi.Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ return (
setActiveTab: setActiveTab,
setIndexerWizardCode: setIndexerWizardCode,
setSchemaWizardCode: setSchemaWizardCode,
setSelectedIndexer: setSelectedIndexer,
}}
/>
</Section>
Expand All @@ -120,6 +121,7 @@ return (

{activeTab === 'launch-new-indexer' && (
<Section>
{/* Modify the href post click explorer indexer */}
<Widget
src={`${REPL_ACCOUNT_ID}/widget/QueryApi.Editor`}
props={{
Expand Down
2 changes: 0 additions & 2 deletions frontend/widgets/src/QueryApi.IndexerExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,6 @@ return (
href={`/${REPL_ACCOUNT_ID}/widget/QueryApi.App/?view=create-new-indexer`}
onClick={() => {
setActiveTab("create-new-indexer");
setSelectedIndexerName("");
selectTab("create-new-indexer");
}}
>
Create New Indexer
Expand Down
32 changes: 15 additions & 17 deletions frontend/widgets/src/QueryApi.Launchpad.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
console.log(props);
const { setActiveTab, activeTab, setIndexerWizardCode, setSchemaWizardCode } = props;
const { setActiveTab, activeTab, setIndexerWizardCode, setSchemaWizardCode, setSelectedIndexer } = props;
const AlertText = styled.p`
font-family: 'Mona Sans', sans-serif;
font-size: 14px;
Expand Down Expand Up @@ -452,26 +451,25 @@ const [allIndexers, setAllIndexers] = useState([]);
const [loading, setLoading] = useState(false);

useEffect(() => {
Near.asyncView(`${REPL_REGISTRY_CONTRACT_ID}`, "list_all").then((data) => {
const indexers = [];
Object.keys(data).forEach((accountId) => {
Object.keys(data[accountId]).forEach((functionName) => {
indexers.push({
accountId: accountId,
indexerName: functionName,
});
});
});
setAllIndexers(indexers)
});
});
// Near.asyncView(`${REPL_REGISTRY_CONTRACT_ID}`, "list_all").then((data) => {
// const indexers = [];
// Object.keys(data).forEach((accountId) => {
// Object.keys(data[accountId]).forEach((functionName) => {
// indexers.push({
// accountId: accountId,
// indexerName: functionName,
// });
// });
// });
// setAllIndexers(indexers)
// });
}, []);

const generateMethods = () => {
setIndexerWizardCode('Generating methods... BLAH BLAH BLAH');
setSchemaWizardCode('Generating schema... BLAH BLAH BLAH');

setSelectedIndexer(null);
setActiveTab('launch-new-indexer');
console.log('finish')
};

const handleFetchCheckboxData = async () => {
Expand Down

0 comments on commit a8387d4

Please sign in to comment.