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+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
# local env files
6+
.env.local
7+
.env.*.local
8+
9+
# Log files
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
14+
# Editor directories and files
15+
.idea
16+
.vscode
17+
*.suo
18+
*.ntvs*
19+
*.njsproj
20+
*.sln
21+
*.sw*
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# cli-ui-addon-widgets
2+
3+
## Project setup
4+
```
5+
yarn install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
yarn run serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
yarn run build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
yarn run lint
21+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@vue/cli-ui-addon-widgets",
3+
"version": "3.0.5",
4+
"files": [
5+
"dist",
6+
"src"
7+
],
8+
"scripts": {
9+
"serve": "vue-cli-service serve",
10+
"build": "vue-cli-service build",
11+
"lint": "vue-cli-service lint",
12+
"prepublishOnly": "yarn run lint --no-fix && yarn run build"
13+
},
14+
"devDependencies": {
15+
"@vue/cli-plugin-babel": "^3.0.5",
16+
"@vue/cli-plugin-eslint": "^3.0.5",
17+
"@vue/cli-service": "^3.0.5",
18+
"@vue/eslint-config-standard": "^3.0.5",
19+
"stylus": "^0.54.5",
20+
"stylus-loader": "^3.0.2",
21+
"vue-template-compiler": "^2.5.17"
22+
},
23+
"publishConfig": {
24+
"access": "public"
25+
}
26+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: {
3+
autoprefixer: {}
4+
}
5+
}
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title>cli-ui-addon-widgets</title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but cli-ui-addon-widgets doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<template>
2+
<div class="dependency-updates">
3+
<StatusWidget
4+
v-if="status"
5+
:icon="icons[status.status]"
6+
:icon-class="iconClasses[status.status]"
7+
:title="$t(`org.vue.widgets.dependency-updates.messages.${status.status}`)"
8+
:status="status"
9+
@check="checkForUpdates()"
10+
>
11+
<template slot="more-actions">
12+
<VueButton
13+
:to="{ name: 'project-dependencies' }"
14+
:label="$t('org.vue.widgets.dependency-updates.page')"
15+
icon-left="collections_bookmark"
16+
/>
17+
</template>
18+
</StatusWidget>
19+
</div>
20+
</template>
21+
22+
<script>
23+
import { UPDATES_ICONS, UPDATES_ICON_CLASSES } from '../util/consts'
24+
25+
import StatusWidget from './StatusWidget.vue'
26+
27+
export default {
28+
components: {
29+
StatusWidget
30+
},
31+
32+
sharedData () {
33+
return mapSharedData('org.vue.widgets.dependency-updates.', {
34+
status: 'status'
35+
})
36+
},
37+
38+
created () {
39+
this.icons = UPDATES_ICONS
40+
this.iconClasses = UPDATES_ICON_CLASSES
41+
},
42+
43+
methods: {
44+
checkForUpdates () {
45+
// TODO
46+
}
47+
}
48+
}
49+
</script>

0 commit comments

Comments
 (0)