Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1600 from ArkEcosystem/develop
Browse files Browse the repository at this point in the history
release: 2.7.0
  • Loading branch information
alexbarnsley committed Jan 9, 2020
2 parents 516c16b + 5abc305 commit 2bdab6c
Show file tree
Hide file tree
Showing 18 changed files with 323 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('PluginManagerButtonInstallSource', () => {
})

it('should emit click event', () => {
wrapper.trigger('click')
wrapper.find('.PluginManagerButtonInstallSource').trigger('click')
expect(wrapper.emitted('click')).toBeTruthy()
})
})
7 changes: 7 additions & 0 deletions __tests__/unit/store/modules/session.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,11 @@ describe('SessionModule', () => {
expect(store.getters['session/hideWalletButtonText']).toEqual(true)
})
})

describe('actions > setIsAdvancedModeEnabled', () => {
it('should set the value for isAdvancedModeEnabled', () => {
store.dispatch('session/setIsAdvancedModeEnabled', true)
expect(store.getters['session/isAdvancedModeEnabled']).toEqual(true)
})
})
})
3 changes: 2 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ exports.MARKET = {

exports.PLUGINS = {
adapters: ['npm'],
blacklistUrl: 'https://raw.githubusercontent.com/ark-ecosystem-desktop-plugins/blacklisted-plugins/master/blacklist.json',
blacklistUrl: 'https://raw.githubusercontent.com/ark-ecosystem-desktop-plugins/config/master/blacklist.json',
whitelistUrl: 'https://raw.githubusercontent.com/ark-ecosystem-desktop-plugins/config/master/whitelist.json',
categories: [
'gaming',
'theme',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"postcss-import": "^12.0.1",
"pretty-bytes": "^5.3.0",
"qrious": "^4.0.2",
"semver": "^6.0.0",
"semver": "^7.0.0",
"stream-http": "^3.0.0",
"titlecase": "^1.1.3",
"trash": "^6.0.0",
Expand Down Expand Up @@ -149,14 +149,14 @@
"file-loader": "^4.1.0",
"glob-all": "^3.1.0",
"html-webpack-plugin": "^3.2.0",
"husky": "^3.0.0",
"husky": "^4.0.0",
"intl": "^1.2.5",
"jest": "^24.5.0",
"jest-extended": "^0.11.1",
"jest-serializer-vue": "^2.0.2",
"jest-vue-preprocessor": "^1.5.0",
"lint-staged": "^9.2.1",
"mini-css-extract-plugin": "^0.8.0",
"mini-css-extract-plugin": "^0.9.0",
"mock-socket": "^9.0.0",
"multispinner": "^0.2.1",
"nock": "^v11.0.0-beta.28",
Expand Down
33 changes: 21 additions & 12 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,26 @@
/>

<PortalTarget
:slot-props="{ setBlurFilter }"
:slot-props="{ setPortalHasContent }"
name="modal"
multiple
@change="onPortalChange"
@change="onPortalChange('modal', ...arguments)"
/>

<PortalTarget
:slot-props="{ setBlurFilter }"
:slot-props="{ setPortalHasContent }"
name="updater"
@change="onPortalChange"
@change="onPortalChange('updater', ...arguments)"
/>

<PortalTarget
name="loading"
@change="onPortalChange"
@change="onPortalChange('loading', ...arguments)"
/>

<PortalTarget
name="qr-scan"
@change="onPortalChange"
@change="onPortalChange('qr-scan', ...arguments)"
/>

<AlertMessage />
Expand Down Expand Up @@ -127,8 +127,14 @@ export default {
data: vm => ({
isReady: false,
hasBlurFilter: false,
isUriTransactionOpen: false,
forceBlurFilter: false,
portalHasContent: {
modal: false,
update: false,
loading: false,
'qr-scan': false
},
uriTransactionSchema: {},
aliveRouteComponents: []
}),
Expand All @@ -142,6 +148,9 @@ export default {
}),
computed: {
hasBlurFilter () {
return Object.values(this.portalHasContent).some(hasContent => !!hasContent)
},
background () {
return this.$store.getters['session/background'] || `wallpapers/${this.hasSeenIntroduction ? 1 : 2}Default.png`
},
Expand Down Expand Up @@ -320,11 +329,11 @@ export default {
this.$warn('Ledger Disconnected!')
})
await Promise.all([this.$plugins.fetchPluginsFromAdapter(), this.$plugins.fetchBlacklist()])
await Promise.all([this.$plugins.fetchPluginsFromAdapter(), this.$plugins.fetchBlacklist(), this.$plugins.fetchWhitelist()])
},
onPortalChange (isActive) {
this.hasBlurFilter = isActive
onPortalChange (portal, isActive) {
this.setPortalHasContent(portal, isActive)
},
__watchProcessURL () {
Expand Down Expand Up @@ -353,8 +362,8 @@ export default {
this.uriTransactionSchema = {}
},
setBlurFilter (isActive) {
this.hasBlurFilter = isActive
setPortalHasContent (portal, isActive) {
this.portalHasContent[portal] = isActive
},
setIntroDone () {
Expand Down
22 changes: 18 additions & 4 deletions src/renderer/components/MarketChart/MarketChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default {
isReady: false,
chartData: {},
options: {},
gradient: null
gradient: null,
lastCurrency: null
}),
computed: {
Expand Down Expand Up @@ -137,9 +138,13 @@ export default {
}
},
mounted () {
this.setLastCurrency()
},
activated () {
// Only if it's not already rendered
if (this.isExpanded && !this.isReady) {
if ((this.isExpanded && !this.isReady) || this.lastCurrency !== this.currency) {
this.renderChart()
}
},
Expand All @@ -149,7 +154,15 @@ export default {
this.isReady = true
},
setLastCurrency () {
this.lastCurrency = this.currency
},
async renderChart () {
if (!this._inactive) {
this.setLastCurrency()
}
await this.renderGradient()
const response = await cryptoCompare.historicByType(this.period, this.ticker, this.currency)
Expand Down Expand Up @@ -255,7 +268,8 @@ export default {
tooltips: {
displayColors: false,
intersect: false,
mode: 'x',
mode: 'index',
axis: 'x',
callbacks: {
label: (item, data) => {
return this.currency_format(item.yLabel / scaleCorrection, { currency: this.currency })
Expand Down Expand Up @@ -291,7 +305,7 @@ export default {
labels: response.labels,
datasets: [{
// Do not show the points, but enable a big target for the tooltip
pointHitRadius: 12,
pointHitRadius: 6,
pointRadius: 0,
borderWidth: 3,
type: 'line',
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/Modal/ModalWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:to="portalTarget"
>
<div
slot-scope="{ setBlurFilter }"
slot-scope="{ setPortalHasContent }"
class="ModalWindow"
:class="{
'ModalWindow--maximized': isMaximized,
Expand Down Expand Up @@ -31,7 +31,7 @@
:icon-name="isMaximized ? 'minus' : 'resize'"
icon-class="text-grey"
class="ModalWindow__resize-button p-6"
@click="toggleMaximized(setBlurFilter)"
@click="toggleMaximized(setPortalHasContent)"
/>
</span>

Expand Down Expand Up @@ -150,7 +150,7 @@ export default {
methods: {
toggleMaximized (callback) {
this.isMaximized = !this.isMaximized
isFunction(callback) && callback(this.isMaximized)
isFunction(callback) && callback(this.portalTarget, this.isMaximized)
},
onBackdropClick () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<template>
<button
class="PluginManagerButtonInstallSource justify-end"
@click="emitClick"
<div
v-tooltip="disabledTooltip"
class="justify-end"
>
<span class="PluginManagerButtonInstallSource__icon">
<SvgIcon
:name="source === 'file' ? 'save': 'open-external'"
view-box="0 0 14 14"
class="text-center"
/>
</span>

<span class="flex items-center h-10 px-4 whitespace-no-wrap">
{{ $t(`PAGES.PLUGIN_MANAGER.INSTALL_${source.toUpperCase()}`) }}
</span>
</button>
<button
class="PluginManagerButtonInstallSource"
:disabled="isDisabled"
@click="emitClick"
>
<span class="PluginManagerButtonInstallSource__icon">
<SvgIcon
:name="source === 'file' ? 'save': 'open-external'"
view-box="0 0 14 14"
class="text-center"
/>
</span>

<span class="flex items-center h-10 px-4 whitespace-no-wrap">
{{ $t(`PAGES.PLUGIN_MANAGER.INSTALL_${source.toUpperCase()}`) }}
</span>
</button>
</div>
</template>

<script>
Expand All @@ -32,6 +38,24 @@ export default {
type: String,
required: false,
default: 'url'
},
isDisabled: {
type: Boolean,
required: false,
default: false
}
},
computed: {
disabledTooltip () {
if (!this.isDisabled) {
return null
}
return {
content: this.$t('COMMON.ENABLE_ADVANCED_MODE'),
placement: 'left'
}
}
},
Expand All @@ -46,7 +70,7 @@ export default {
<style lang="postcss" scoped>
.PluginManagerButtonInstallSource {
transition: all .1s ease-in;
@apply .flex .items-center .font-semibold .bg-theme-button .rounded .cursor-pointer .text-theme-button-text .ml-4;
@apply .flex .items-center .font-semibold .bg-theme-button .rounded .cursor-pointer .text-theme-button-text;
}
.PluginManagerButtonInstallSource:hover {
@apply .bg-blue .text-white;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<ModalConfirmation
:title="$t('PAGES.PROFILE_EDITION.ADVANCED_MODE.TITLE')"
:question="$t('PAGES.PROFILE_EDITION.ADVANCED_MODE.QUESTION')"
:cancel-button="$t('PAGES.PROFILE_EDITION.ADVANCED_MODE.DECLINE')"
:continue-button="$t('PAGES.PROFILE_EDITION.ADVANCED_MODE.ACCEPT')"
container-classes="ProfileAdvancedModeConfirmation"
@close="emitClose"
@cancel="emitClose"
@continue="emitSave"
/>
</template>

<script>
import { ModalConfirmation } from '@/components/Modal'
export default {
name: 'ProfileAdvancedModeConfirmation',
components: {
ModalConfirmation
},
methods: {
emitSave () {
this.$emit('save')
},
emitClose () {
this.$emit('close')
}
}
}
</script>

<style>
.ProfileAdvancedModeConfirmation .ModalConfirmation__container {
min-width: calc(var(--profile-avatar-xl) + 74px * 2 + 80px);
max-width: calc(var(--profile-avatar-xl) + 74px * 2 + 120px)
}
.ProfileAdvancedModeConfirmation .ModalConfirmation__container > div:first-child {
@apply .mb-0
}
/*.ProfileAdvancedModeConfirmation__container__arrow {
width: 74px;
height: 75px;
margin-top: calc(var(--profile-avatar-xl) - 75px + 2rem)
}
.ProfileAdvancedModeConfirmation__container__arrow--reverse {
transform: scaleX(-1)
}*/
</style>
2 changes: 2 additions & 0 deletions src/renderer/components/Profile/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import ProfileAdvancedModeConfirmation from './ProfileAdvancedModeConfirmation'
import ProfileAvatar from './ProfileAvatar'
import ProfileLeavingConfirmation from './ProfileLeavingConfirmation'
import ProfileRemovalConfirmation from './ProfileRemovalConfirmation'

export {
ProfileAdvancedModeConfirmation,
ProfileAvatar,
ProfileLeavingConfirmation,
ProfileRemovalConfirmation
Expand Down
10 changes: 9 additions & 1 deletion src/renderer/i18n/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default {
DATE: 'Date',
DELEGATE: 'Delegate',
DONE: 'Done',
ENABLE_ADVANCED_MODE: 'Enable Advanced Mode to use this feature',
FAILED_UPDATE: 'Failed to update \'{name}\'. Reason: {reason}',
FAILED_FETCH: 'Failed to fetch {name}. Reason: "{msg}".',
FETCH: 'Fetch',
Expand Down Expand Up @@ -47,7 +48,8 @@ export default {
VERSION: 'Version',
WARNING: 'Warning',
WILL: 'will',
WALLET: 'Wallet'
WALLET: 'Wallet',
ADVANCED_MODE: 'Advanced Mode'
},

ANNOUNCEMENTS: {
Expand Down Expand Up @@ -732,6 +734,12 @@ export default {
TEXT: 'Here you can adjust the settings of the Plugin Manager.'
},
TITLE: 'Plugins'
},
ADVANCED_MODE: {
DECLINE: 'I Decline',
ACCEPT: 'I Accept',
QUESTION: 'By enabling Advanced Mode you hereby assume the risk associated with downloading files and installing said files from a direct URL link. The aforementioned links have neither been tested nor approved by ARK.io and ARK SCIC. We make no warranties, expressed or implied, as to the sustainability, availability, security, of these URLs. We are not responsible for any consequences which may occur from downloading, viewing, or installing files directly from a URL or feature that is activated via toggling on Advanced Mode. ARK.io and ARK SCIC shall bear no liability for any loss suffered by users who bypass certain measures by toggling on Advanced Mode. By clicking “I Accept” you acknowledge that enabling Advanced Mode may result in you downloading, viewing, or installing content that may have bugs, glitches, lack of functionality, or can cause damage to your machine or result in the loss of data.',
TITLE: 'Advanced Mode Disclaimer'
}
},

Expand Down

0 comments on commit 2bdab6c

Please sign in to comment.