Skip to content

Commit

Permalink
Merge branch 'master' into ADO-32-e2e-undo
Browse files Browse the repository at this point in the history
* master:
  refactor(editor): Apply Prettier (no-changelog) (#4920)
  feat: Set all resources view as default subview (#4919)

# Conflicts:
#	packages/editor-ui/src/components/Node.vue
#	packages/editor-ui/src/components/NodeTitle.vue
  • Loading branch information
MiloradFilipovic committed Dec 14, 2022
2 parents 48591f4 + 5ca2148 commit c7daa5d
Show file tree
Hide file tree
Showing 284 changed files with 18,668 additions and 14,961 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
coverage
dist
packages/editor-ui
package.json
.pnpm-lock.yml
2 changes: 1 addition & 1 deletion packages/editor-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
'import/no-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/order': 'off',
'indent': 'off',
indent: 'off',
'prettier/prettier': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/dot-notation': 'off',
Expand Down
9 changes: 8 additions & 1 deletion packages/editor-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,50 @@ npm install n8n -g
```

## Project setup

```
pnpm install
```

### Compiles and hot-reloads for development

```
pnpm serve
```

### Compiles and minifies for production

```
pnpm build
```

### Run your tests

```
pnpm test
```

### Lints and fixes files

```
pnpm lint
```

### Run your end-to-end tests

```
pnpm test:e2e
```

### Run your unit tests

```
pnpm test:unit
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

See [Configuration Reference](https://cli.vuejs.org/config/).

## License

Expand Down
35 changes: 20 additions & 15 deletions packages/editor-ui/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<script type="text/javascript">window.BASE_PATH = "/{{BASE_PATH}}/";</script>
<title>n8n.io - Workflow Automation</title>
</head>
<body>
<noscript>
<strong>We're sorry but the n8n Editor-UI doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="/favicon.ico" />
<script type="text/javascript">
window.BASE_PATH = '/{{BASE_PATH}}/';
</script>
<title>n8n.io - Workflow Automation</title>
</head>
<body>
<noscript>
<strong
>We're sorry but the n8n Editor-UI doesn't work properly without JavaScript enabled. Please
enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dev": "pnpm serve",
"lint": "tslint -p tsconfig.json -c tslint.json && eslint --ext .js,.ts,.vue src",
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint --ext .js,.ts,.vue src --fix",
"format": "prettier **/**.{ts,vue} --write",
"format": "prettier --write . --ignore-path ../../.prettierignore",
"serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev",
"test": "vitest run",
"test:ci": "vitest run --coverage",
Expand Down
49 changes: 23 additions & 26 deletions packages/editor-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
id="app"
:class="{
[$style.container]: true,
[$style.sidebarCollapsed]: uiStore.sidebarMenuCollapsed
[$style.sidebarCollapsed]: uiStore.sidebarMenuCollapsed,
}"
>
<div id="header" :class="$style.header">
Expand Down Expand Up @@ -47,12 +47,7 @@ import { useTemplatesStore } from './stores/templates';
import { useNodeTypesStore } from './stores/nodeTypes';
import { historyHelper } from '@/mixins/history';
export default mixins(
showMessage,
userHelpers,
restApi,
historyHelper,
).extend({
export default mixins(showMessage, userHelpers, restApi, historyHelper).extend({
name: 'App',
components: {
LoadingView,
Expand All @@ -68,14 +63,14 @@ export default mixins(
},
computed: {
...mapStores(
useNodeTypesStore,
useRootStore,
useSettingsStore,
useTemplatesStore,
useUIStore,
useUsersStore,
),
defaultLocale (): string {
useNodeTypesStore,
useRootStore,
useSettingsStore,
useTemplatesStore,
useUIStore,
useUsersStore,
),
defaultLocale(): string {
return this.rootStore.defaultLocale;
},
},
Expand Down Expand Up @@ -110,8 +105,7 @@ export default mixins(
}
try {
await this.settingsStore.testTemplatesEndpoint();
} catch (e) {
}
} catch (e) {}
},
logHiringBanner() {
if (this.settingsStore.isHiringBannerEnabled && this.$route.name !== VIEWS.DEMO) {
Expand All @@ -126,8 +120,7 @@ export default mixins(
this.uiStore.currentView = this.$route.name || '';
if (this.$route && this.$route.meta && this.$route.meta.templatesEnabled) {
this.templatesStore.setSessionId();
}
else {
} else {
this.templatesStore.resetSessionId(); // reset telemetry session id when user leaves template pages
}
Expand Down Expand Up @@ -161,7 +154,8 @@ export default mixins(
// if cannot access page and is logged in, respect signin redirect
if (this.$route.name === VIEWS.SIGNIN && typeof this.$route.query.redirect === 'string') {
const redirect = decodeURIComponent(this.$route.query.redirect);
if (redirect.startsWith('/')) { // protect against phishing
if (redirect.startsWith('/')) {
// protect against phishing
this.$router.replace(redirect);
return;
}
Expand All @@ -171,7 +165,10 @@ export default mixins(
this.$router.replace({ name: VIEWS.HOMEPAGE });
},
redirectIfNecessary() {
const redirect = this.$route.meta && typeof this.$route.meta.getRedirect === 'function' && this.$route.meta.getRedirect();
const redirect =
this.$route.meta &&
typeof this.$route.meta.getRedirect === 'function' &&
this.$route.meta.getRedirect();
if (redirect) {
this.$router.replace(redirect);
}
Expand Down Expand Up @@ -221,11 +218,11 @@ export default mixins(
.container {
display: grid;
grid-template-areas:
"sidebar header"
"sidebar content";
grid-auto-columns: fit-content($sidebar-expanded-width) 1fr;
grid-template-rows: fit-content($sidebar-width) 1fr;
grid-template-areas:
'sidebar header'
'sidebar content';
grid-auto-columns: fit-content($sidebar-expanded-width) 1fr;
grid-template-rows: fit-content($sidebar-width) 1fr;
}
.content {
Expand Down
Loading

0 comments on commit c7daa5d

Please sign in to comment.