Skip to content

Commit a09407d

Browse files
authored
feat(ui): Redesign, dashboard, local plugins (#2806)
* feat: basic fonctionality, welcome and kill port widgets * fix: contrast improvements * feat: plugin/dep/vulnerability widgets design * fix: widget add/remove animation * feat: run task widget * feat: news + wip resizing * feat: nuxt * chore: removed widget example * fix: visual polish for widget transform * feat(widget): overlap detection * fix: news default/max size * feat(dashboard): sidepane transition * chore: dev api server port * fix(widget): configure tooltip * refactor(widget): generic Movable mixin * refactor(widget): resizable mixin * feat(widget): resize transition * feat(widget): resize improvements * refactor(widget): zoom factor * refactor(widget): OnGrid mixin * refactor(widget): resize handler style moved to global * chore: remove console.log * refactor: files structure * feat: improved design and layout * fix: content background vars * fix: status bar / view nav z-indexes * fix: webpack dashboard grid gap * feat(news feed): handle errors * fix(card): dimmed box shadow * fix: view nav & status bar z-index * fix: remove (wip) * feat(widget): style tweaks * feat(widget): details pane (wip) * feat: news feed widget improvements * feat(widget): custom header button * feat(news): item details pane * feat(widget): custom title * fix(news): better cache and misc fixes * feat(widget): resize left and top handles * feat(widget): transparent widget while moving/resizing * feat(news): better "big size" style * fix(news): media sizes in rich content * feat(plugin): local plugins support * fix: scrolling issue in Fx * fix: colors * fix(nav bar): more item overflowing * feat(vuln): frontend * chore: locale update * fix: image in suggestion dropdown (dev) * fix(suggestion): missing custom image * feat(view): user default plugin logo if no provided icon * feat(view): better loading UX * feat(view): button background if view is selected * feat(view): new nav indicator * feat(widget): use plugin logo as default icon * feat(widget): better widget modal * feat(widget): longDescription * fix(widget): news validate url param * feat(widget): filter widgets in add pane * feat(widget): tease upcoming widgets * chore: fix merge dev * chore: yarn install * chore: sync versions * chore: update apollo * docs: widget * fix(progress): graphql error * fix(deps): localPath * perf(plugin): faster local plugin refresh * fix(nav): center active indicator * feat(task): improved header * feat(client addon): custom component load timeout message * feat(suggestion): ping animation to improve discoverability * chore: update vue-apollo * feat(api): requestRoute * fix(suggestion): hide more info link if no link * fix(style): ul padding * test(e2e): fix plugin path * chore: change test scripts * chore(deps): upgrade * fix: build error * fix(widget): removed moving scale transform * fix(widget): resize handles style * chore(deps): unpin apollo-utilities * chore(deps): lock fix * test(e2e): fix server * fix: issue with writeQuery See: apollographql/apollo-client#4031 (comment) * test(e2e): fix tests * test(e2e): missing widgets build * fix: missing widgets dep
1 parent 9a64708 commit a09407d

File tree

289 files changed

+6117
-1695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+6117
-1695
lines changed

docs/dev-guide/ui-api.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,58 @@ In this example we only display the vue-router suggestion in the plugins view an
12881288

12891289
Note: `addSuggestion` and `removeSuggestion` can be namespaced with `api.namespace()`.
12901290

1291+
## Widgets
1292+
1293+
You can register a widget for the project dashboard in your plugin ui file:
1294+
1295+
```js
1296+
registerWidget({
1297+
// Unique ID
1298+
id: 'org.vue.widgets.news',
1299+
// Basic infos
1300+
title: 'org.vue.widgets.news.title',
1301+
description: 'org.vue.widgets.news.description',
1302+
icon: 'rss_feed',
1303+
// Main component used to render the widget
1304+
component: 'org.vue.widgets.components.news',
1305+
// (Optional) Secondary component for widget 'fullscreen' view
1306+
detailsComponent: 'org.vue.widgets.components.news',
1307+
// Size
1308+
minWidth: 2,
1309+
minHeight: 1,
1310+
maxWidth: 6,
1311+
maxHeight: 6,
1312+
defaultWidth: 2,
1313+
defaultHeight: 3,
1314+
// (Optional) Limit the maximum number of this widget on the dashboard
1315+
maxCount: 1,
1316+
// (Optional) Add a 'fullscreen' button in widget header
1317+
openDetailsButton: true,
1318+
// (Optional) Default configuration for the widget
1319+
defaultConfig: () => ({
1320+
url: 'https://vuenews.fireside.fm/rss'
1321+
}),
1322+
// (Optional) Require user to configure widget when added
1323+
// You shouldn't use `defaultConfig` with this
1324+
needsUserConfig: true,
1325+
// (Optional) Display prompts to configure the widget
1326+
onConfigOpen: async ({ context }) => {
1327+
return {
1328+
prompts: [
1329+
{
1330+
name: 'url',
1331+
type: 'input',
1332+
message: 'org.vue.widgets.news.prompts.url',
1333+
validate: input => !!input // Required
1334+
}
1335+
]
1336+
}
1337+
}
1338+
})
1339+
```
1340+
1341+
Note: `registerWidget` can be namespaced with `api.namespace()`.
1342+
12911343
## Other methods
12921344

12931345
### hasPlugin
@@ -1324,6 +1376,21 @@ Get currently open project.
13241376
api.getProject()
13251377
```
13261378

1379+
### requestRoute
1380+
1381+
Switch the user on a specific route in the web client.
1382+
1383+
```js
1384+
api.requestRoute({
1385+
name: 'foo',
1386+
params: {
1387+
id: 'bar'
1388+
}
1389+
})
1390+
1391+
api.requestRoute('/foobar')
1392+
```
1393+
13271394
## Public static files
13281395

13291396
You may need to expose some static files over the cli-ui builtin HTTP server (typically if you want to specify an icon to a custom view).

packages/@vue/cli-ui-addon-webpack/src/components/AssetList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="asset-list list-block">
2+
<div class="asset-list card list-block">
33
<div class="content">
44
<div class="title">
55
{{ $t('org.vue.vue-webpack.dashboard.asset-list.title') }}

packages/@vue/cli-ui-addon-webpack/src/components/BuildProgress.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div
3-
class="build-progress"
3+
class="build-progress card"
44
:class="{
55
[`mode-${mode}`]: true
66
}"

packages/@vue/cli-ui-addon-webpack/src/components/BuildStatus.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="build-status">
2+
<div class="build-status card">
33
<div class="content">
44
<div class="info-block status">
55
<div class="label">

packages/@vue/cli-ui-addon-webpack/src/components/ModuleList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="module-list list-block">
2+
<div class="module-list card list-block">
33
<div class="content">
44
<div class="title">
55
{{ $t('org.vue.vue-webpack.dashboard.module-list.title') }}

packages/@vue/cli-ui-addon-webpack/src/components/SpeedStats.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="speed-stats">
2+
<div class="speed-stats card">
33
<div class="content">
44
<div class="title">
55
{{ $t('org.vue.vue-webpack.dashboard.speed-stats.title') }}

packages/@vue/cli-ui-addon-webpack/src/components/WebpackAnalyzer.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="vue-webpack-analyzer">
3-
<div class="pane-toolbar">
3+
<div class="pane-toolbar card">
44
<VueIcon icon="donut_large"/>
55
<div class="title">{{ $t('org.vue.vue-webpack.analyzer.title') }}</div>
66

@@ -84,7 +84,7 @@
8484
</template>
8585

8686
<div v-if="describedModule" class="described-module">
87-
<div class="wrapper">
87+
<div class="wrapper card">
8888
<div class="path" v-html="modulePath"/>
8989
<div
9090
class="stats size"
@@ -345,10 +345,6 @@ export default {
345345
.pane-toolbar,
346346
.described-module .wrapper
347347
padding $padding-item
348-
background $vue-ui-color-light-neutral
349-
border-radius $br
350-
.vue-ui-dark-mode &
351-
background $vue-ui-color-dark
352348
353349
.content
354350
display flex

packages/@vue/cli-ui-addon-webpack/src/components/WebpackDashboard.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="vue-webpack-dashboard">
3-
<div class="pane-toolbar">
3+
<div class="pane-toolbar card">
44
<VueIcon icon="dashboard"/>
55
<div class="title">{{ $t('org.vue.vue-webpack.dashboard.title') }}</div>
66

@@ -40,7 +40,7 @@
4040
/>
4141
</div>
4242

43-
<div class="content vue-ui-grid default-gap">
43+
<div class="content vue-ui-grid">
4444
<BuildStatus />
4545
<BuildProgress />
4646
<SpeedStats class="span-2"/>
@@ -90,6 +90,7 @@ export default {
9090
.vue-webpack-dashboard
9191
.content
9292
grid-template-columns 9fr 4fr
93+
grid-gap $padding-item
9394
9495
>>>
9596
.title
@@ -124,13 +125,8 @@ export default {
124125
opacity .75
125126
font-size 16px
126127
127-
.pane-toolbar,
128-
.content >>> > div
128+
/deep/ .card
129129
padding $padding-item
130-
background $vue-ui-color-light-neutral
131-
border-radius $br
132-
.vue-ui-dark-mode &
133-
background $vue-ui-color-dark
134130
135131
.pane-toolbar
136132
margin-bottom $padding-item
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
'extends': [
7+
'plugin:vue/essential',
8+
'@vue/standard'
9+
],
10+
rules: {
11+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13+
},
14+
parserOptions: {
15+
parser: 'babel-eslint'
16+
},
17+
globals: {
18+
ClientAddonApi: false,
19+
mapSharedData: false,
20+
Vue: false
21+
}
22+
}

0 commit comments

Comments
 (0)