From 1e92d211ed5da6b75325297a4f034a4839665da5 Mon Sep 17 00:00:00 2001 From: Sunny Gleason Date: Mon, 21 Oct 2019 13:31:39 -0400 Subject: [PATCH] feat: webapp rename application to program --- src/App.js | 4 +- src/AppV2.js | 18 ++++----- src/v2/Bx2NavDrawer.jsx | 6 +-- src/v2/api/applications.js | 34 ----------------- src/v2/api/programs.js | 34 +++++++++++++++++ .../components/Accounts/Detail/Code/index.jsx | 6 +-- .../Accounts/Detail/Transactions/index.jsx | 10 ++--- src/v2/components/Accounts/Detail/index.jsx | 2 +- src/v2/components/Accounts/Detail/styles.js | 2 +- src/v2/components/Dashboard/ViewAll/index.jsx | 2 +- src/v2/components/Favorites/Accounts.jsx | 10 ++--- src/v2/components/Favorites/index.jsx | 8 ++-- .../assets/{applications.svg => programs.svg} | 0 src/v2/components/NavBar/index.jsx | 8 ++-- .../Detail/ApplicationsTab.jsx | 8 ++-- .../Detail/Code/index.jsx | 10 ++--- .../Detail/Code/styles.js | 0 .../Detail/Details/index.jsx | 4 +- .../Detail/Details/styles.js | 0 .../Detail/Program}/index.jsx | 8 ++-- .../Detail/Program}/styles.js | 0 .../Detail/Status/index.jsx | 4 +- .../Detail/Status/styles.js | 0 .../Detail/index.jsx | 32 ++++++++-------- .../Detail/styles.js | 2 +- .../Table/index.jsx | 38 +++++++++---------- .../Table/styles.js | 0 .../{Applications => Programs}/index.jsx | 24 ++++++------ .../{Applications => Programs}/styles.js | 0 .../Transactions/Detail/ApplicationsTab.jsx | 16 -------- .../Detail/{Application => Program}/index.jsx | 10 ++--- .../Detail/{Application => Program}/styles.js | 0 .../Transactions/Detail/ProgramsTab.jsx | 16 ++++++++ .../Transactions/Detail/Status/index.jsx | 4 +- .../components/Transactions/Detail/index.jsx | 10 ++--- .../components/Transactions/Table/index.jsx | 10 ++--- .../{applications => programs}/detail.js | 22 +++++------ .../{applications => programs}/timeline.js | 30 +++++++-------- 38 files changed, 196 insertions(+), 196 deletions(-) delete mode 100644 src/v2/api/applications.js create mode 100644 src/v2/api/programs.js rename src/v2/components/NavBar/assets/{applications.svg => programs.svg} (100%) rename src/v2/components/{Applications => Programs}/Detail/ApplicationsTab.jsx (54%) rename src/v2/components/{Applications => Programs}/Detail/Code/index.jsx (64%) rename src/v2/components/{Applications => Programs}/Detail/Code/styles.js (100%) rename src/v2/components/{Applications => Programs}/Detail/Details/index.jsx (87%) rename src/v2/components/{Applications => Programs}/Detail/Details/styles.js (100%) rename src/v2/components/{Applications/Detail/Application => Programs/Detail/Program}/index.jsx (88%) rename src/v2/components/{Applications/Detail/Application => Programs/Detail/Program}/styles.js (100%) rename src/v2/components/{Applications => Programs}/Detail/Status/index.jsx (93%) rename src/v2/components/{Applications => Programs}/Detail/Status/styles.js (100%) rename src/v2/components/{Applications => Programs}/Detail/index.jsx (80%) rename src/v2/components/{Applications => Programs}/Detail/styles.js (98%) rename src/v2/components/{Applications => Programs}/Table/index.jsx (70%) rename src/v2/components/{Applications => Programs}/Table/styles.js (100%) rename src/v2/components/{Applications => Programs}/index.jsx (58%) rename src/v2/components/{Applications => Programs}/styles.js (100%) delete mode 100644 src/v2/components/Transactions/Detail/ApplicationsTab.jsx rename src/v2/components/Transactions/Detail/{Application => Program}/index.jsx (83%) rename src/v2/components/Transactions/Detail/{Application => Program}/styles.js (100%) create mode 100644 src/v2/components/Transactions/Detail/ProgramsTab.jsx rename src/v2/stores/{applications => programs}/detail.js (60%) rename src/v2/stores/{applications => programs}/timeline.js (56%) diff --git a/src/App.js b/src/App.js index 24042c18..32dd985b 100755 --- a/src/App.js +++ b/src/App.js @@ -743,10 +743,10 @@ class App extends Component { )} /> ( - + )} /> import('v2/components/Transactions')); const TransactionDetail = lazy(() => import('v2/components/Transactions/Detail'), ); -const Applications = lazy(() => import('v2/components/Applications')); -const ApplicationDetail = lazy(() => - import('v2/components/Applications/Detail'), +const Programs = lazy(() => import('v2/components/Programs')); +const ProgramDetail = lazy(() => + import('v2/components/Programs/Detail'), ); const Accounts = lazy(() => import('v2/components/Accounts')); const AccountDetail = lazy(() => import('v2/components/Accounts/Detail')); @@ -134,22 +134,22 @@ const App = () => { path="/transactions/:id" component={TransactionDetail} /> - + diff --git a/src/v2/Bx2NavDrawer.jsx b/src/v2/Bx2NavDrawer.jsx index 11f31786..772bf75e 100644 --- a/src/v2/Bx2NavDrawer.jsx +++ b/src/v2/Bx2NavDrawer.jsx @@ -53,14 +53,14 @@ class Bx2NavDrawer extends React.Component { - + diff --git a/src/v2/api/applications.js b/src/v2/api/applications.js deleted file mode 100644 index 6f5a1b48..00000000 --- a/src/v2/api/applications.js +++ /dev/null @@ -1,34 +0,0 @@ -import _ from 'lodash'; - -import api from '.'; - -const DEFAULT_PAGE_SIZE = 100; - -const APPLICATION_DETAIL_VERSION = 'ApplicationDetailView@1.0.0'; - -export function apiGetApplicationDetail({applicationId, version}) { - return api( - `/explorer/applications/${encodeURIComponent(applicationId)}?v=${version || - APPLICATION_DETAIL_VERSION}`, - ); -} - -const APPLICATION_INDEX_VERSION = 'ApplicationIndexView@1.0.0'; - -export function apiGetApplicationsTimelinePage({ - start = '', - count = DEFAULT_PAGE_SIZE, - direction = '-', - version, -}) { - const queryString = _.toPairs({ - start, - count, - direction, - v: version || APPLICATION_INDEX_VERSION, - }) - .map(([k, v]) => `${k}=${encodeURIComponent(v)}`) - .join('&'); - - return api(`/explorer/applications/index?${queryString}`); -} diff --git a/src/v2/api/programs.js b/src/v2/api/programs.js new file mode 100644 index 00000000..32ff0b7c --- /dev/null +++ b/src/v2/api/programs.js @@ -0,0 +1,34 @@ +import _ from 'lodash'; + +import api from '.'; + +const DEFAULT_PAGE_SIZE = 100; + +const PROGRAM_DETAIL_VERSION = 'ProgramDetailView@1.0.0'; + +export function apiGetProgramDetail({programId, version}) { + return api( + `/explorer/programs/${encodeURIComponent(programId)}?v=${version || + PROGRAM_DETAIL_VERSION}`, + ); +} + +const PROGRAM_INDEX_VERSION = 'ProgramIndexView@1.0.0'; + +export function apiGetProgramsTimelinePage({ + start = '', + count = DEFAULT_PAGE_SIZE, + direction = '-', + version, +}) { + const queryString = _.toPairs({ + start, + count, + direction, + v: version || PROGRAM_INDEX_VERSION, + }) + .map(([k, v]) => `${k}=${encodeURIComponent(v)}`) + .join('&'); + + return api(`/explorer/programs/index?${queryString}`); +} diff --git a/src/v2/components/Accounts/Detail/Code/index.jsx b/src/v2/components/Accounts/Detail/Code/index.jsx index 446cef51..8fd6daaa 100644 --- a/src/v2/components/Accounts/Detail/Code/index.jsx +++ b/src/v2/components/Accounts/Detail/Code/index.jsx @@ -9,17 +9,17 @@ import useStyles from './styles'; const AccountCode = ({accountView}: {accountView: Object}) => { const classes = useStyles(); - const applicationCode = YAML.stringify(accountView); + const accountCode = YAML.stringify(accountView); return (
- +
- {applicationCode} + {accountCode}
diff --git a/src/v2/components/Accounts/Detail/Transactions/index.jsx b/src/v2/components/Accounts/Detail/Transactions/index.jsx index da0a35cb..7311e44b 100644 --- a/src/v2/components/Accounts/Detail/Transactions/index.jsx +++ b/src/v2/components/Accounts/Detail/Transactions/index.jsx @@ -28,8 +28,8 @@ const fields = [ term: '', }, { - id: 'application_id', - label: 'Application Id', + id: 'program_id', + label: 'Program Id', text: '', term: '', }, @@ -53,7 +53,7 @@ const demoData = [ block: '7887219', time: '55 sec ago', timeType: 'in', - application_id: '5CpdpKwKUBJgD4Bdase123as12asd21312', + program_id: '5CpdpKwKUBJgD4Bdase123as12asd21312', type: 'other', confirmations: 5, }, @@ -75,8 +75,8 @@ const Transactions = ({transactions}: {transactions: Array}) => { - - {transaction.application_id} + + {transaction.program_id} diff --git a/src/v2/components/Accounts/Detail/index.jsx b/src/v2/components/Accounts/Detail/index.jsx index 74d9b045..8880c6dd 100644 --- a/src/v2/components/Accounts/Detail/index.jsx +++ b/src/v2/components/Accounts/Detail/index.jsx @@ -82,7 +82,7 @@ const AccountDetail = ({match}: {match: Match}) => {
-
+
{accountId} diff --git a/src/v2/components/Accounts/Detail/styles.js b/src/v2/components/Accounts/Detail/styles.js index bf433b71..17bbf324 100644 --- a/src/v2/components/Accounts/Detail/styles.js +++ b/src/v2/components/Accounts/Detail/styles.js @@ -2,7 +2,7 @@ import {makeStyles} from '@material-ui/core'; import getColor from 'v2/utils/getColor'; export default makeStyles(theme => ({ - applicationTitle: { + programTitle: { display: 'flex', alignItems: 'center', marginLeft: 100, diff --git a/src/v2/components/Dashboard/ViewAll/index.jsx b/src/v2/components/Dashboard/ViewAll/index.jsx index e245fcc8..5541ac72 100644 --- a/src/v2/components/Dashboard/ViewAll/index.jsx +++ b/src/v2/components/Dashboard/ViewAll/index.jsx @@ -23,7 +23,7 @@ const ViewAll = () => { diff --git a/src/v2/components/Favorites/Accounts.jsx b/src/v2/components/Favorites/Accounts.jsx index 11698a4c..b1feded7 100644 --- a/src/v2/components/Favorites/Accounts.jsx +++ b/src/v2/components/Favorites/Accounts.jsx @@ -48,11 +48,11 @@ const AccountsTable = ({separate}: {separate: boolean}) => { const showTable = useMediaQuery(theme.breakpoints.up('md')); const blocks = []; - const renderRow = ({data: application}) => { + const renderRow = ({data: program}) => { return ( - + - + 7887319 @@ -84,7 +84,7 @@ const AccountsTable = ({separate}: {separate: boolean}) => { {map(renderRow)(blocks)} - + 7887319 @@ -99,7 +99,7 @@ const AccountsTable = ({separate}: {separate: boolean}) => {
  • -
    Application id
    +
    Program id
    7887219
  • diff --git a/src/v2/components/Favorites/index.jsx b/src/v2/components/Favorites/index.jsx index 1201c9ac..06655757 100644 --- a/src/v2/components/Favorites/index.jsx +++ b/src/v2/components/Favorites/index.jsx @@ -5,7 +5,7 @@ import {eq, map} from 'lodash/fp'; import React, {useState} from 'react'; import SectionHeader from 'v2/components/UI/SectionHeader'; import TabNav from 'v2/components/UI/TabNav'; -import ApplicationsTable from 'v2/components/Applications/Table'; +import ProgramsTable from 'v2/components/Programs/Table'; import {ReactComponent as WarnIcon} from 'v2/assets/icons/warn.svg'; import AccountsTable from './Accounts'; @@ -13,11 +13,11 @@ import useStyles from './styles'; const TransactionsPage = () => { const classes = useStyles(); - const [tab, setTab] = useState('applications'); + const [tab, setTab] = useState('programs'); const theme = useTheme(); const verticalTabs = useMediaQuery(theme.breakpoints.down('xs')); const handleTabChange = (event, tab) => setTab(tab); - const tabNav = ['applications', 'accounts']; + const tabNav = ['programs', 'accounts']; const renderTabNav = label => ( ); @@ -40,7 +40,7 @@ const TransactionsPage = () => { > {map(renderTabNav)(tabNav)} - {eq('applications', tab) && } + {eq('programs', tab) && } {eq('accounts', tab) && } ); diff --git a/src/v2/components/NavBar/assets/applications.svg b/src/v2/components/NavBar/assets/programs.svg similarity index 100% rename from src/v2/components/NavBar/assets/applications.svg rename to src/v2/components/NavBar/assets/programs.svg diff --git a/src/v2/components/NavBar/index.jsx b/src/v2/components/NavBar/index.jsx index 6c6142f2..3346a1a7 100644 --- a/src/v2/components/NavBar/index.jsx +++ b/src/v2/components/NavBar/index.jsx @@ -24,7 +24,7 @@ import {ReactComponent as dashboard} from './assets/dashboard.svg'; import {ReactComponent as transactions} from './assets/transactions.svg'; import {ReactComponent as validators} from './assets/validators.svg'; import {ReactComponent as tourdesol} from './assets/tourdesol.svg'; -import {ReactComponent as applications} from './assets/applications.svg'; +import {ReactComponent as programs} from './assets/programs.svg'; import {ReactComponent as blocks} from './assets/blocks.svg'; import {ReactComponent as favorites} from './assets/favorites.svg'; import useStyles from './styles'; @@ -34,7 +34,7 @@ const icons = { transactions, validators, tourdesol, - applications, + programs, blocks, favorites, }; @@ -44,7 +44,7 @@ const navTracks = { transactions: 'Clicked Transactions Page', validators: 'Clicked Validators Page', tourdesol: 'Clicked TDS Page', - applications: 'Clicked Applications page', + programs: 'Clicked Programs page', blocks: 'Clicked Blocks page', favorites: 'Clicked Favorites page', }; @@ -82,7 +82,7 @@ const NavBar = ({ disabled: true, }, { - link: 'applications', + link: 'programs', disabled: true, }, { diff --git a/src/v2/components/Applications/Detail/ApplicationsTab.jsx b/src/v2/components/Programs/Detail/ApplicationsTab.jsx similarity index 54% rename from src/v2/components/Applications/Detail/ApplicationsTab.jsx rename to src/v2/components/Programs/Detail/ApplicationsTab.jsx index 652b199d..649e29c9 100644 --- a/src/v2/components/Applications/Detail/ApplicationsTab.jsx +++ b/src/v2/components/Programs/Detail/ApplicationsTab.jsx @@ -1,12 +1,12 @@ // @flow import React from 'react'; -import Application from './Application'; +import Program from './Program'; -const ApplicationsTab = ({applications}) => { +const ProgramsTab = ({programs}) => { return (
    - @@ -14,4 +14,4 @@ const ApplicationsTab = ({applications}) => { ); }; -export default ApplicationsTab; +export default ProgramsTab; diff --git a/src/v2/components/Applications/Detail/Code/index.jsx b/src/v2/components/Programs/Detail/Code/index.jsx similarity index 64% rename from src/v2/components/Applications/Detail/Code/index.jsx rename to src/v2/components/Programs/Detail/Code/index.jsx index bcd48848..35776439 100644 --- a/src/v2/components/Applications/Detail/Code/index.jsx +++ b/src/v2/components/Programs/Detail/Code/index.jsx @@ -5,23 +5,23 @@ import {observer} from 'mobx-react-lite'; import useStyles from './styles'; import YAML from 'yaml'; -const ApplicationCode = ({applicationView}: {applicationView: Object}) => { +const ProgramCode = ({programView}: {programView: Object}) => { const classes = useStyles(); - const applicationCode = YAML.stringify(applicationView); + const programCode = YAML.stringify(programView); return (
    - +
    - {applicationCode} + {programCode}
    ); }; -export default observer(ApplicationCode); +export default observer(ProgramCode); diff --git a/src/v2/components/Applications/Detail/Code/styles.js b/src/v2/components/Programs/Detail/Code/styles.js similarity index 100% rename from src/v2/components/Applications/Detail/Code/styles.js rename to src/v2/components/Programs/Detail/Code/styles.js diff --git a/src/v2/components/Applications/Detail/Details/index.jsx b/src/v2/components/Programs/Detail/Details/index.jsx similarity index 87% rename from src/v2/components/Applications/Detail/Details/index.jsx rename to src/v2/components/Programs/Detail/Details/index.jsx index a2a26268..f2e361c7 100644 --- a/src/v2/components/Applications/Detail/Details/index.jsx +++ b/src/v2/components/Programs/Detail/Details/index.jsx @@ -6,7 +6,7 @@ import {observer} from 'mobx-react-lite'; import {Table, TableBody, TableCell, TableRow} from '@material-ui/core'; import ValidatorName from 'v2/components/UI/ValidatorName'; -const ApplicationDetails = ({programAccounts}: {programAccounts: Object}) => { +const ProgramDetails = ({programAccounts}: {programAccounts: Object}) => { const renderAccount = (account, i) => { return ( @@ -32,4 +32,4 @@ const ApplicationDetails = ({programAccounts}: {programAccounts: Object}) => { ); }; -export default observer(ApplicationDetails); +export default observer(ProgramDetails); diff --git a/src/v2/components/Applications/Detail/Details/styles.js b/src/v2/components/Programs/Detail/Details/styles.js similarity index 100% rename from src/v2/components/Applications/Detail/Details/styles.js rename to src/v2/components/Programs/Detail/Details/styles.js diff --git a/src/v2/components/Applications/Detail/Application/index.jsx b/src/v2/components/Programs/Detail/Program/index.jsx similarity index 88% rename from src/v2/components/Applications/Detail/Application/index.jsx rename to src/v2/components/Programs/Detail/Program/index.jsx index 0cb7559d..2f19efe4 100644 --- a/src/v2/components/Applications/Detail/Application/index.jsx +++ b/src/v2/components/Programs/Detail/Program/index.jsx @@ -8,12 +8,12 @@ import TypeLabel from 'v2/components/UI/TypeLabel'; import useStyles from './styles'; -type TApplication = { +type TProgram = { id: string, accounts: string[], }; -const Application = ({id, accounts}: TApplication) => { +const Program = ({id, accounts}: TProgram) => { const classes = useStyles(); const renderAccount = account => (
    @@ -34,7 +34,7 @@ const Application = ({id, accounts}: TApplication) => {
    -