Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create details dialog for application exploring - Closes #4356, #4357 #4369

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
02fefd1
feature: created expore domain module
eniolam1000752 Jun 27, 2022
fe626b2
removed empty index.js files
eniolam1000752 Jun 27, 2022
4adb21f
fixed directory structure
eniolam1000752 Jun 28, 2022
9f515d5
added keep to components folder
eniolam1000752 Jun 28, 2022
34bb50f
feature: implemented app details component
eniolam1000752 Jun 28, 2022
b94ba6c
feature: fixed status text css
eniolam1000752 Jun 28, 2022
43020ef
feature: implemented usePinBlockChainApplication hook and written uni…
eniolam1000752 Jun 30, 2022
93dc29a
feature: added test to api implementation
eniolam1000752 Jun 30, 2022
05a82de
feature: extended unit test on hook and component
eniolam1000752 Jun 30, 2022
b0fce38
added e2e test for blochainExplorer
eniolam1000752 Jun 30, 2022
93ca6d3
fix: fixed deepscan issue and tested e2e test
eniolam1000752 Jun 30, 2022
86208a3
chore: added todos
eniolam1000752 Jun 30, 2022
2a0d9ac
fix: fixed pr comments
eniolam1000752 Jul 1, 2022
508e661
fix: fixed failing unit test
eniolam1000752 Jul 1, 2022
b619168
fix: fixed issues raised by ikem
eniolam1000752 Jul 1, 2022
16dc520
fix: fixed pr comment
eniolam1000752 Jul 1, 2022
00342b6
Merge branch 'feature/blockchain-application' into 4356-create-detail…
eniolam1000752 Jul 1, 2022
4e770b9
fix: fixed unit test
eniolam1000752 Jul 1, 2022
842fe34
fix:fixed failing e2e test
eniolam1000752 Jul 1, 2022
e4230ff
Merge branches '4356-create-details-dialog-for-app-exploring' and '43…
eniolam1000752 Jul 1, 2022
6a3b570
fix: fixed comments from masoud
eniolam1000752 Jul 3, 2022
f5c25fe
fix: resolved issues from ikem
eniolam1000752 Jul 3, 2022
36af2bf
fixed failing unit tests
eniolam1000752 Jul 3, 2022
12e57e1
fixed broken tests and minor CSS changes
eniolam1000752 Jul 3, 2022
8c5d7fa
fix: updated background image quality
eniolam1000752 Jul 4, 2022
a24bad6
fixed merge conflicts
eniolam1000752 Jul 4, 2022
e7a1057
fix: fixed failing unit test
eniolam1000752 Jul 4, 2022
534e059
fix: fixed css issues raised by ikem
eniolam1000752 Jul 4, 2022
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
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
["@settings", "./packages/settings/"],
["@token", "./src/modules/token/"],
["@transaction", "./src/modules/transaction"],
["@blockchainApplication", "./src/modules/blockchainApplication"],
["@update", "./src/modules/update"],
["@wallet", "./src/modules/wallet/"],
["@account", "./src/modules/account/"],
Expand Down
1 change: 1 addition & 0 deletions setup/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const config = {
'@settings': resolve('./packages/settings'),
'@token': resolve('./src/modules/token'),
'@transaction': resolve('./src/modules/transaction'),
'@blockchainApplication': resolve('./src/modules/blockchainApplication'),
'@update': resolve('./src/modules/update'),
'@views': resolve('./packages/views'),
'@packages': resolve('./packages'),
Expand Down
1 change: 1 addition & 0 deletions setup/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
'^@fixtures(.*)$': resolve(__dirname, '../tests/fixtures/$1'),
'^@theme(.*)$': resolve(__dirname, '../src/theme/$1'),
'^@account(.*)$': resolve(__dirname, '../src/modules/account/$1'),
'^@blockchainApplication(.*)$': resolve(__dirname, '../src/modules/blockchainApplication/$1'),
'^@block(.*)$': resolve(__dirname, '../src/modules/block/$1'),
'^@bookmark(.*)$': resolve(__dirname, '../src/modules/bookmark/$1'),
'^@search(.*)$': resolve(__dirname, '../src/modules/search/$1'),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions setup/react/assets/images/icons/chain-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions setup/react/assets/images/icons/pinned.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions setup/react/assets/images/icons/unpinned.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"Caution! This delegate was punished on {{punishmentStartDate}}. There is approximately {{daysLeft}} days remaining before the punishment ends.": "Caution! This delegate was punished on {{punishmentStartDate}}. There is approximately {{daysLeft}} days remaining before the punishment ends.",
"Caution! You are about to send the majority of your balance": "Caution! You are about to send the majority of your balance",
"Caution! You are about to vote for the punished delegate, this will result in your LSK tokens being locked for a period of {{daysLeft}} days.": "Caution! You are about to vote for the punished delegate, this will result in your LSK tokens being locked for a period of {{daysLeft}} days.",
"Chain ID": "Chain ID",
"Changed votes": "Changed votes",
"Check for Updates...": "Check for Updates...",
"Choose account": "Choose account",
Expand Down Expand Up @@ -145,6 +146,7 @@
"Delegates overview": "Delegates overview",
"Depending on the number of votes locked to your account (delegate weight), your account can become eligible to forge new blocks on the Lisk blockchain. With every new round (103 blocks), the top 101 active delegates and 2 randomly selected standby delegates each become eligible to forge a new block. For each block forged and accepted by the Lisk network, a delegate receives a new block reward and the transaction fees collected from each sender. The minimum required delegate weight to become eligible is 1000 LSK.": "Depending on the number of votes locked to your account (delegate weight), your account can become eligible to forge new blocks on the Lisk blockchain. With every new round (103 blocks), the top 101 active delegates and 2 randomly selected standby delegates each become eligible to forge a new block. For each block forged and accepted by the Lisk network, a delegate receives a new block reward and the transaction fees collected from each sender. The minimum required delegate weight to become eligible is 1000 LSK.",
"Deposit at least {{amount}} LSK to your new account": "Deposit at least {{amount}} LSK to your new account",
"Deposited:": "Deposited:",
"Details": "Details",
"Disable dark mode": "Disable dark mode",
"Disable discreet mode": "Disable discreet mode",
Expand Down Expand Up @@ -246,6 +248,8 @@
"Label": "Label",
"Label is too long, Max. 20 characters": "Label is too long, Max. 20 characters",
"Label is too long.": "Label is too long.",
"Last Certificate Height": "Last Certificate Height",
"Last Update": "Last Update",
"Last block forged": "Last block forged",
"Last forged block": "Last forged block",
"Last {{num}} blocks": "Last {{num}} blocks",
Expand Down Expand Up @@ -479,6 +483,7 @@
"Terms of Use": "Terms of Use",
"Testnet": "Testnet",
"The aggregated LSK volume transferred over the selected time period.": "The aggregated LSK volume transferred over the selected time period.",
"The chain ID uniquely identifies a chain in the Lisk ecosystem": "The chain ID uniquely identifies a chain in the Lisk ecosystem",
"The delegate has at least 1,000 LSK delegate weight, but is not among the\n top 101 by delegate weight.": "The delegate has at least 1,000 LSK delegate weight, but is not among the\n top 101 by delegate weight.",
"The delegate is permanently banned from generating blocks due to repeated protocol violations or missing too many blocks.": "The delegate is permanently banned from generating blocks due to repeated protocol violations or missing too many blocks.",
"The delegate is temporarily punished and their delegate weight is set to 0 due to a misbehavior.": "The delegate is temporarily punished and their delegate weight is set to 0 due to a misbehavior.",
Expand Down
28 changes: 28 additions & 0 deletions src/modules/blockchainApplication/api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import http from 'src/utils/api/http';
import { HTTP_PREFIX } from 'src/const/httpCodes';

const httpPaths = {
application: `${HTTP_PREFIX}/blockchain/apps`,
};

/**
* Retrieves the details of a single blockchain application
*
* @param {Object} data
* @param {String} data.params
* @param {String} data.params.chainId - Id of the chain
* @param {String?} data.baseUrl - Lisk Service API url to override the
* existing ServiceUrl on the network param.
* @param {Object} data.network - Network setting from Redux store
* @returns {Promise} Blockchain application details API call
*/

// eslint-disable-next-line import/prefer-default-export
export const getApplication = ({
params, network, baseUrl,
}) => http({
path: httpPaths.application,
params,
network,
baseUrl,
});
27 changes: 27 additions & 0 deletions src/modules/blockchainApplication/api/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { getState } from '@fixtures/transactions';
import http from 'src/utils/api/http';
import { getApplication } from '.';

jest.mock('src/utils/api/http', () =>
jest.fn().mockImplementation(() => Promise.resolve({ data: [{ type: 0 }] })));

const baseUrl = 'http://custom-base-url.com/';
const sampleId = 'sample_id';
const { network } = getState();

describe('get blockchain application detail', () => {
it('Should call http with given params', () => {
getApplication({
network,
baseUrl,
params: { chainId: sampleId },
});

expect(http).toHaveBeenCalledWith({
path: '/api/v2/blockchain/apps',
params: { chainId: sampleId },
network,
baseUrl,
});
});
});
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
@import '../../../../../../setup/react/app/mixins.css';

.dialogWrapper {
border: none;

& > span {
color: white !important;
}
}

.wrapper {
width: 100%;
box-sizing: border-box;
max-width: 757px;
min-width: 450px;
border-radius: 16px;
overflow: hidden;
background-color: var(--color-white);

& > div:first-child {
width: 100%;
height: 130px;
background: linear-gradient(268.31deg, #0c152e 0%, #254898 100%);
}
}

.avatarContainer {
width: 100%;
height: 51px;
display: flex;
position: relative;
flex-direction: column;
align-items: center;
justify-content: flex-start;

& > img:first-child {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
bottom: -39px;
width: 77px;
height: 77px;
background-color: white;
border-radius: 40px;
}

& > img:nth-child(2) {
width: 100%;
height: 100%;
}
}

.detailsWrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 51px;
}

.chainNameWrapper {
& > span {
font-size: 28px;
font-weight: 700;
color: var(--color-maastricht-blue);
}

& > span ~ button {
padding: 0px 0px !important;
min-width: fit-content;
margin-left: 16px;
}

& img {
width: 17px;
}
}

.addressRow {
& span {
font-size: 14px;
}
}

.appLink {
margin-top: 14px;
display: flex;
font-size: 14px;
font-weight: 400;

& > img {
width: 16px;
height: 16px;
margin-right: 8px;
}
}

.balanceRow {
display: flex;
align-items: center;
margin-top: 22px;
column-gap: 8px;

& > span:first-child {
font-size: 14px;
color: var(--color-blue-gray);
}

& > span:nth-child(2) {
font-size: 20px;
font-weight: 600;
color: var(--color-link-active);
}
}

.footerDetailsRow {
width: 100%;
padding: 32px;
box-sizing: border-box;
flex-direction: row;
column-gap: 10px;
align-items: flex-start;

& .headerText {
font-size: 13px;
font-weight: 400;
color: var(--color-blue-gray);
}

& .detailContentText {
font-size: 15px;
}

& .statusChip {
font-size: 14px !important;
padding: 10px 16px;
border-radius: 40px;
}

& .active {
background-color: #00d5631a;
color: var(--color-jade-green);
}

& .registered {
background-color: #4070f41a;
color: var(--color-ultramarine-blue);
}

& .terminated {
background-color: var(--color-maastricht-blue);
color: var(--color-ghost-white);
}
}

.detail {
width: 20%;
}

.detail:first-of-type {
width: 35%;
}

.detail:last-of-type {
width: 25%;
}
Loading