Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@
"governance": "Governance",
"registered_tokens": "Registered Tokens",
"originated_account_maps": "Map Owners",
"big_maps": "Map Definitons",
"big_maps": "Map Definitions",
"big_map_contents": "Map Content",
"big_map_contents_history": "Map History",
"known_addresses": "Known Addresses",
"baker_registry": "TCF Baker Registry",
"bakers_history": "Baker History",
"metadata": "Metadata",
"nfts": "NFTs",
"transactions": "Transactions",
"contracts": "Contracts",
"logs": "Logs",
Expand Down Expand Up @@ -344,7 +347,9 @@
"utc_year": "Year (UTC)",
"utc_month": "Month (UTC)",
"utc_day": "Day (UTC)",
"utc_time": "Time (UTC)"
"utc_time": "Time (UTC)",
"operation_order": "Operation Index"

},
"baking_rights": {
"block_hash": "Block Hash",
Expand Down Expand Up @@ -579,6 +584,33 @@
"tx_in_witness": "",
"txid": "Transaction Id",
"v_out": ""
},
"big_map_contents_history": {
"big_map_id": "Map Index",
"key": "Key",
"key_hash": "Hashed Key",
"value": "Value",
"operation_group_id": "Op Group Hash",
"block_level": "Block Level",
"cycle": "Cycle",
"period": "Period",
"timestamp": "Timestamp"
},
"metadata": {
"address": "Address",
"description": "Description",
"last_updated": "Last Updated",
"name": "Name",
"raw_metadata": "Raw Data"
},
"nfts": {
"asset_location": "Asset URL",
"asset_type": "Asset Type",
"block_level": "Block Level",
"contract_address": "Contract",
"op_group_hash": "Op Group Hash",
"raw_metadata": "Raw Data",
"timestamp": "Timestamp"
}
},
"operators": {
Expand All @@ -604,6 +636,7 @@
"avg": "Average",
"min": "Min",
"max": "Max",
"count": "Count"
"count": "Count",
"countDistinct": "Distinct"
}
}
2 changes: 1 addition & 1 deletion src/components/AggregationPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class AggregationPanel extends React.Component<Props, States> {
function: func.name
};
localAggs[index] = aggregation;
this.setState({localAggs});
this.setState({ localAggs });
};

onResetAggregations = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class FilterSelect extends React.Component<FilterSelectProps, FilterSelectState>
backgroundcolor={backgroundColor}
borderradius={borderRadius}
isactive={value}
iscapital={placeholder !== t('components.filterPanel.select_operator')? 1 : 0}
iscapital={placeholder !== t('components.filterPanel.select_operator') ? 1 : 0}
onClick={this.handleClick}
>
{menuTitle}
Expand Down
12 changes: 6 additions & 6 deletions src/containers/Modal/templates/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const templates: any = {
"tezos/mainnet/operations": operation,
"tezos/mainnet/default": defaultTemplate,

"tezos/granadanet/blocks": block,
"tezos/granadanet/accounts": account,
"tezos/granadanet/bakers": baker,
"tezos/granadanet/contracts": contract,
"tezos/granadanet/operations": operation,
"tezos/granadanet/default": defaultTemplate
"tezos/hangzhounet/blocks": block,
"tezos/hangzhounet/accounts": account,
"tezos/hangzhounet/bakers": baker,
"tezos/hangzhounet/contracts": contract,
"tezos/hangzhounet/operations": operation,
"tezos/hangzhounet/default": defaultTemplate
};

export default templates;
5 changes: 4 additions & 1 deletion src/reducers/app/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ let initialState: AppState = {
{ name: 'max', displayName: 'Max' },
{ name: 'count', displayName: 'Count' },
],
string: [{ name: 'count', displayName: 'Count' }],
string: [
{ name: 'count', displayName: 'Count' },
{ name: 'countDistinct', displayName: 'Distinct' }
],
dateTime: [
{ name: 'min', displayName: 'Min' },
{ name: 'max', displayName: 'Max' },
Expand Down
28 changes: 19 additions & 9 deletions src/reducers/app/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import { defaultPath } from '../../router/routes';

import { Config, Sort, Filter, Aggregation, InitLoad } from '../../types';

const { executeEntityQuery } = ConseilDataClient;
const { blankQuery, addOrdering, addFields, setLimit, addPredicate, addAggregationFunction } = ConseilQueryBuilder;

const CACHE_TIME = 432000000; // 5*24*3600*1000
Expand Down Expand Up @@ -265,7 +264,7 @@ export const fetchInitEntityAction = (
query = addOrdering(query, sorts[0].orderBy, sorts[0].order);
}

const items = await executeEntityQuery(serverInfo, platform, network, entity, query).catch(() => {
const items = await ConseilDataClient.executeEntityQuery(serverInfo, platform, network, entity, query).catch(() => {
const name = entities.find((e: EntityDefinition) => e.name === entity)?.displayName.toLowerCase();
dispatch(createMessageAction(`Unable to retrieve data for ${name} request.`, true));
return [];
Expand Down Expand Up @@ -419,14 +418,14 @@ const loadAttributes = (query: string) => async (dispatch: any, state: any) => {
const metadata = await fetch(state().app.selectedConfig.metadataOverrideUrl)
.then(response => response.text())
.catch(e => "" );
console.log(`loaded metadata override of length ${metadata.length}`)
console.debug(`loaded metadata override of length ${metadata.length}`)
await hocon().then((instance) => {
const cfg = new instance.Config(metadata);
injectedMetadata = JSON.parse(cfg.toJSON());
cfg.delete();
}).catch(e => { console.log(`hocon parse error ${JSON.stringify(e)}`)});
}).catch(e => { console.warn(`hocon parse error ${JSON.stringify(e)}`)});
} catch (err) {
console.log(`hocon error ${JSON.stringify(err)}`)
console.warn(`hocon error ${JSON.stringify(err)}`)
}
}

Expand All @@ -444,13 +443,24 @@ const loadAttributes = (query: string) => async (dispatch: any, state: any) => {
try {
attrObjsList.forEach((entity: any) => {
entity.attributes.forEach((attribute: any) => {
if (!injectedMetadata['entities'][entity.entity]) {
console.log(`no overrides for ${entity.entity}`);
return;
}

if (!injectedMetadata['entities'][entity.entity]['attributes'][attribute.name]) {
console.log(`no overrides for ${entity.entity}/${attribute.name}`);
return;
}

if (injectedMetadata['entities'][entity.entity]['attributes'][attribute.name]['value-map']) {
console.log(`updated value map for ${entity.entity}/${attribute.name}`)
attribute.valueMap = {...injectedMetadata['entities'][entity.entity]['attributes'][attribute.name]['value-map']};
}
});
});
} catch (err) {
// meh
console.warn(`metadata override error`, err);
}

const attrMap = [...attrObjsList].reduce((curr: any, next: any) => {
Expand Down Expand Up @@ -632,7 +642,7 @@ export const exportCsvData = () => async (dispatch: any, state: any) => {
query = ConseilQueryBuilder.setOutputType(query, ConseilOutput.csv);
query = ConseilQueryBuilder.setLimit(query, 80000);

const result: any = await executeEntityQuery(serverInfo, platform, network, selectedEntity, query);
const result: any = await ConseilDataClient.executeEntityQuery(serverInfo, platform, network, selectedEntity, query);

if (!result || result.length === 0) {
dispatch(createMessageAction('Export failed, no results were returned.', true));
Expand Down Expand Up @@ -663,7 +673,7 @@ export const submitQuery = () => async (dispatch: any, state: any) => {
let query = getMainQuery(attributeNames, selectedFilters[selectedEntity], sort[selectedEntity], aggregations[selectedEntity]);
query = setLimit(query, 5000);
try {
const items = await executeEntityQuery(serverInfo, platform, network, selectedEntity, query);
const items = await ConseilDataClient.executeEntityQuery(serverInfo, platform, network, selectedEntity, query);
await dispatch(setSubmitAction(selectedEntity, items, selectedFilters[selectedEntity].length));
await dispatch(setQueryFilters(selectedEntity, query));
dispatch(setLoadingAction(false));
Expand Down Expand Up @@ -703,7 +713,7 @@ export const searchByIdThunk = (id: string | number) => async (dispatch: any, st

try {
const { entity, query } = TezosConseilClient.getEntityQueryForId(id);
const items = await executeEntityQuery(serverInfo, platform, network, entity, query);
const items = await ConseilDataClient.executeEntityQuery(serverInfo, platform, network, entity, query);
if (items.length > 0) {
await dispatch(changeTab(entity));
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/modal/thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ export const loadModal = (platform: string, network: string, id: string) => asyn

try {
const { entity, query } = TezosConseilClient.getEntityQueryForId(id); // TODO: eth
let items: any = await executeEntityQuery({ url, apiKey, network }, platform, network, entity, query);
let items: any[] = await executeEntityQuery({ url, apiKey, network }, platform, network, entity, query);
if (!items.length && platform === 'tezos' && entity === 'operations') { items = await getMempoolOperation(nodeUrl, id); }

if (!items.length) {
Expand Down