Skip to content
Permalink
Browse files

[DDW-646] Fix linting rules and changelog item

  • Loading branch information...
yakovkaravelov committed May 16, 2019
1 parent d3c86f7 commit d14764d7a119244c99fca5fbde24749a337a0ac8
@@ -5,13 +5,13 @@ Changelog

### Features

- Implemented "Start of decentralisation notification" UI ([PR 1390](https://github.com/input-output-hk/daedalus/pull/1390))
- Implemented the wallet UTxO statistics screen ([PR 1353](https://github.com/input-output-hk/daedalus/pull/1353))
- Implemented scroll error message into view ([PR 1383](https://github.com/input-output-hk/daedalus/pull/1383))
- Implemented new Block-consolidation status design ([PR 1377](https://github.com/input-output-hk/daedalus/pull/1377))
- Implemented "In progress" download logs notification ([PR 1341](https://github.com/input-output-hk/daedalus/pull/1341))
- Implemented status icons on the "Loading" screens ([PR 1325](https://github.com/input-output-hk/daedalus/pull/1325), [PR 1365](https://github.com/input-output-hk/daedalus/pull/1365))
- Implemented detection for system locale on Daedalus start when user hasn't yet selected language preference so that locale defaults to Japanese if system locale is Japan/Japanese, otherwise defaults to English ([PR 1348](https://github.com/input-output-hk/daedalus/pull/1348))
- Implemented "Start of decentralisation notification" UI ([PR 1390](https://github.com/input-output-hk/daedalus/pull/1390))

### Fixes

@@ -1,9 +1,9 @@
@import './stakingConfig';

.component {
background-color: var(--theme-staking-background-color);
height: 100%;
padding: 20px;
background-color: var(--theme-staking-background-color);
}

.mainContent {
@@ -1,7 +1,7 @@
%contentBorderAndBackground {
background-color: var(--theme-staking-content-background-color);
border: solid 1px var(--theme-staking-content-border-color);
border-radius: 4px;
background-color: var(--theme-staking-content-background-color);
}

%baseTypography {
@@ -11,12 +11,12 @@

%accentText {
@extend %baseTypography;
font-family: var(--font-semibold);
color: var(--theme-staking-font-color-accent);
font-family: var(--font-semibold);
}

%regularText {
@extend %baseTypography;
font-family: var(--font-regular);
color: var(--theme-staking-font-color-regular);
font-family: var(--font-regular);
}
@@ -1,7 +1,7 @@
%contentBorderAndBackground {
background-color: var(--theme-staking-content-background-color);
border: solid 1px var(--theme-staking-content-border-color);
border-radius: 4px;
background-color: var(--theme-staking-content-background-color);
}

%baseTypography {
@@ -11,12 +11,12 @@

%accentText {
@extend %baseTypography;
font-family: var(--font-semibold);
color: var(--theme-staking-font-color-accent);
font-family: var(--font-semibold);
}

%regularText {
@extend %baseTypography;
font-family: var(--font-regular);
color: var(--theme-staking-font-color-regular);
font-family: var(--font-regular);
}
@@ -23,7 +23,7 @@ import {
// TODO: refactor all parts that rely on this to ipc channels!
const { ipcRenderer } = global;

export default class SettingsStore extends Store {
export default class ProfileStore extends Store {
LANGUAGE_OPTIONS = [
{ value: 'en-US', label: globalMessages.languageEnglish },
{ value: 'ja-JP', label: globalMessages.languageJapanese },
@@ -34,8 +34,7 @@ export default class SettingsStore extends Store {
];

@observable systemLocale: string = LOCALES.english;
@observable
bigNumberDecimalFormat = {
@observable bigNumberDecimalFormat = {
decimalSeparator: '.',
groupSeparator: ',',
groupSize: 3,
@@ -51,12 +50,10 @@ export default class SettingsStore extends Store {
@observable setProfileLocaleRequest: Request<string> = new Request(
this.api.localStorage.setUserLocale
);
@observable
getTermsOfUseAcceptanceRequest: Request<string> = new Request(
@observable getTermsOfUseAcceptanceRequest: Request<string> = new Request(
this.api.localStorage.getTermsOfUseAcceptance
);
@observable
setTermsOfUseAcceptanceRequest: Request<string> = new Request(
@observable setTermsOfUseAcceptanceRequest: Request<string> = new Request(
this.api.localStorage.setTermsOfUseAcceptance
);
@observable
@@ -111,92 +108,79 @@ export default class SettingsStore extends Store {
BigNumber.config({ FORMAT: this.bigNumberDecimalFormat });
};

@computed
get currentLocale(): string {
@computed get currentLocale(): string {
const { result } = this.getProfileLocaleRequest.execute();
if (this.isCurrentLocaleSet) return result;
return this.systemLocale;
}

@computed
get hasLoadedCurrentLocale(): boolean {
@computed get hasLoadedCurrentLocale(): boolean {
return (
this.getProfileLocaleRequest.wasExecuted &&
this.getProfileLocaleRequest.result !== null
);
}

@computed
get isCurrentLocaleSet(): boolean {
@computed get isCurrentLocaleSet(): boolean {
return (
this.getProfileLocaleRequest.result !== null &&
this.getProfileLocaleRequest.result !== ''
);
}

@computed
get currentTheme(): string {
@computed get currentTheme(): string {
const { result } = this.getThemeRequest.execute();
if (this.isCurrentThemeSet) return result;
return this.environment.isMainnet ? THEMES.DARK_BLUE : THEMES.LIGHT_BLUE; // defaults
}

@computed
get isCurrentThemeSet(): boolean {
@computed get isCurrentThemeSet(): boolean {
return (
this.getThemeRequest.result !== null && this.getThemeRequest.result !== ''
);
}

@computed
get hasLoadedCurrentTheme(): boolean {
@computed get hasLoadedCurrentTheme(): boolean {
return (
this.getThemeRequest.wasExecuted && this.getThemeRequest.result !== null
);
}

@computed
get termsOfUse(): string {
@computed get termsOfUse(): string {
const network = this.environment.isMainnet ? 'mainnet' : 'other';
return require(`../i18n/locales/terms-of-use/${network}/${
this.currentLocale
}.md`);
}

@computed
get hasLoadedTermsOfUseAcceptance(): boolean {
@computed get hasLoadedTermsOfUseAcceptance(): boolean {
return (
this.getTermsOfUseAcceptanceRequest.wasExecuted &&
this.getTermsOfUseAcceptanceRequest.result !== null
);
}

@computed
get areTermsOfUseAccepted(): boolean {
@computed get areTermsOfUseAccepted(): boolean {
return this.getTermsOfUseAcceptanceRequest.result === true;
}

@computed
get hasLoadedDataLayerMigrationAcceptance(): boolean {
@computed get hasLoadedDataLayerMigrationAcceptance(): boolean {
return (
this.getDataLayerMigrationAcceptanceRequest.wasExecuted &&
this.getDataLayerMigrationAcceptanceRequest.result !== null
);
}

@computed
get isDataLayerMigrationAccepted(): boolean {
@computed get isDataLayerMigrationAccepted(): boolean {
return this.getDataLayerMigrationAcceptanceRequest.result === true;
}

@computed
get isProfilePage(): boolean {
@computed get isProfilePage(): boolean {
const { currentRoute } = this.stores.app;
return includes(ROUTES.PROFILE, currentRoute);
}

@computed
get isSettingsPage(): boolean {
@computed get isSettingsPage(): boolean {
const { currentRoute } = this.stores.app;
return includes(ROUTES.SETTINGS, currentRoute);
}
@@ -382,13 +366,11 @@ export default class SettingsStore extends Store {
}
});

@action
_onReceiveSystemLocale = (systemLocale: string) => {
@action _onReceiveSystemLocale = (systemLocale: string) => {
this.systemLocale = systemLocale;
};

@action
_reset = () => {
@action _reset = () => {
this.error = null;
this.compressedLogsFilePath = null;
this.compressedLogsStatus = {};

0 comments on commit d14764d

Please sign in to comment.
You can’t perform that action at this time.