n8n/packages/editor-ui/src/components/VersionCard.vue

134 lines
3 KiB
Vue
Raw Normal View History

:sparkles: Add new version notification (#1977) * add menu item * implement versions modal * fix up modal * clean up badges * implement key features * fix up spacing * add error message * add notification icon * fix notification * fix bug when no updates * address lint issues * address multi line nodes * add closing animation * keep drawer open * address design feedback * address badge styling * use grid for icons * update cli to return version information * set env variables * add scss color variables * address comments * fix lint issue * handle edge cases * update scss variables, spacing * update spacing * build * override top value for theme * bolden version * update config * check endpoint exists * handle long names * set dates * set title * fix bug * update warning * remove unused component * refactor components * add fragments * inherit styles * fix icon size * fix lint issues * add cli dep * address comments * handle network error * address empty case * Revert "address comments" 480f969e07c3282c50bc326babbc5812baac5dae * remove dependency * build * update variable names * update variable names * refactor verion card * split out variables * clean up impl * clean up scss * move from nodeview * refactor out gift notification icon * fix lint issues * clean up variables * update scss variables * update info url * Add instanceId to frontendSettings * Use createHash from crypto module * Add instanceId to store & send it as http header * Fix lintings * Fix interfaces & apply review changes * Apply review changes * add console message * update text info * update endpoint * clean up interface * address comments * cleanup todo * Update packages/cli/config/index.ts Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> * update console message * :zap: Display node-name on hover * :zap: Formatting fix Co-authored-by: MedAliMarz <servfrdali@yahoo.fr> Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-22 01:22:17 -07:00
<template functional>
:art: Set up linting and formatting (#2120) * :arrow_up: Upgrade TS to 4.3.5 * :shirt: Add ESLint configs * :art: Add Prettier config * :package: Add deps and commands * :zap: Adjust global .editorconfig to new ruleset * :fire: Remove unneeded local .editorconfig * :package: Update deps in editor-ui * :hammer: Limit Prettier to only TS files * :zap: Add recommended VSCode extensions * :shirt: Fix build * :fire: Remove Vue setting from global config * :zap: Disable prefer-default-export per feedback * :pencil2: Add forgotten divider * :shirt: Disable no-plusplus * :shirt: Disable class-methods-use-this * :pencil2: Alphabetize overrides * :shirt: Add one-var consecutive override * :rewind: Revert one-var consecutive override This reverts commit b9252cf935659ba6d76727ad484a1d3c00008fcc. * 🎨 👕 Lint and format workflow package (#2121) * :art: Format /workflow package * :shirt: Lint /workflow package * :art: Re-format /workflow package * :shirt: Re-lint /workflow package * :pencil2: Fix typo * :zap: Consolidate if-checks * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 🎨 👕 Lint and format node-dev package (#2122) * :art: Format /node-dev package * :zap: Exclude templates from ESLint config This keeps the templates consistent with the codebase while preventing lint exceptions from being made part of the templates. * :shirt: Lint /node-dev package * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * 🎨 👕 Lint and format core package (#2123) * :art: Format /core package * :shirt: Lint /core package * :art: Re-format /core package * :shirt: Re-lint /core package * :fire: Remove prefer-default-export exceptions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 🎨 👕 Lint and format cli package (#2124) * :art: Format /cli package * :shirt: Exclude migrations from linting * :shirt: Lint /cli package * :art: Re-format /cli package * :shirt: Re-lint /cli package * :shirt: Fix build * :fire: Remove prefer-default-export exceptions * :zap: Update exceptions in ActiveExecutions * :fire: Remove no-plusplus exceptions * :fire: Remove class-methods-use-this exceptions * 👕 fix lint issues * :wrench: use package specific linter, remove tslint command * :hammer: resolve build issue, sync dependencies * :wrench: change lint command Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>
2021-08-29 11:58:11 -07:00
<!-- eslint-disable-next-line vue/no-mutating-props -->
:sparkles: Add new version notification (#1977) * add menu item * implement versions modal * fix up modal * clean up badges * implement key features * fix up spacing * add error message * add notification icon * fix notification * fix bug when no updates * address lint issues * address multi line nodes * add closing animation * keep drawer open * address design feedback * address badge styling * use grid for icons * update cli to return version information * set env variables * add scss color variables * address comments * fix lint issue * handle edge cases * update scss variables, spacing * update spacing * build * override top value for theme * bolden version * update config * check endpoint exists * handle long names * set dates * set title * fix bug * update warning * remove unused component * refactor components * add fragments * inherit styles * fix icon size * fix lint issues * add cli dep * address comments * handle network error * address empty case * Revert "address comments" 480f969e07c3282c50bc326babbc5812baac5dae * remove dependency * build * update variable names * update variable names * refactor verion card * split out variables * clean up impl * clean up scss * move from nodeview * refactor out gift notification icon * fix lint issues * clean up variables * update scss variables * update info url * Add instanceId to frontendSettings * Use createHash from crypto module * Add instanceId to store & send it as http header * Fix lintings * Fix interfaces & apply review changes * Apply review changes * add console message * update text info * update endpoint * clean up interface * address comments * cleanup todo * Update packages/cli/config/index.ts Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> * update console message * :zap: Display node-name on hover * :zap: Formatting fix Co-authored-by: MedAliMarz <servfrdali@yahoo.fr> Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-22 01:22:17 -07:00
<a v-if="props.version" :set="version = props.version" :href="version.documentationUrl" target="_blank" :class="$style.card">
<div :class="$style.header">
<div>
<div :class="$style.name">
Version {{version.name}}
</div>
<WarningTooltip v-if="version.hasSecurityIssue">
<template>
This version has a security issue.<br/>It is listed here for completeness.
</template>
</WarningTooltip>
<Badge
v-if="version.hasSecurityFix"
text="Security update"
type="danger"
/>
<Badge
v-if="version.hasBreakingChange"
text="Breaking changes"
type="warning"
/>
</div>
<div :class="$style['release-date']">
Released&nbsp;<TimeAgo :date="version.createdAt" />
</div>
</div>
<div :class="$style.divider" v-if="version.description || (version.nodes && version.nodes.length)"></div>
<div>
<div v-if="version.description" v-html="version.description" :class="$style.description"></div>
<div v-if="version.nodes && version.nodes.length > 0" :class="$style.nodes">
<NodeIcon
v-for="node in version.nodes"
:key="node.name"
:nodeType="node"
:title="$options.nodeName(node)"
/>
</div>
</div>
</a>
</template>
<script lang="ts">
import Vue from 'vue';
import NodeIcon from './NodeIcon.vue';
import TimeAgo from './TimeAgo.vue';
import Badge from './Badge.vue';
import WarningTooltip from './WarningTooltip.vue';
import { IVersionNode } from '@/Interface';
Vue.component('NodeIcon', NodeIcon);
Vue.component('TimeAgo', TimeAgo);
Vue.component('Badge', Badge);
Vue.component('WarningTooltip', WarningTooltip);
export default Vue.extend({
components: { NodeIcon, TimeAgo, Badge, WarningTooltip },
name: 'UpdatesPanel',
props: ['version'],
// @ts-ignore
nodeName (node: IVersionNode): string {
return node !== null ? node.displayName : 'unknown';
},
});
</script>
<style module lang="scss">
.card {
background-color: $--version-card-background-color;
border: $--version-card-border;
border-radius: 8px;
display: block;
padding: 16px;
text-decoration: none;
&:hover {
box-shadow: 0px 2px 10px $--version-card-box-shadow-color;
}
}
.header {
display: flex;
flex-wrap: wrap;
> * {
display: flex;
margin-bottom: 5px;
}
> div:first-child {
flex-grow: 1;
> * {
margin-right: 5px;
}
}
}
.name {
font-weight: 600;
font-size: 16px;
line-height: 18px;
color: $--version-card-name-text-color;
}
.divider {
border-bottom: $--version-card-border;
width: 100%;
margin: 10px 0 15px 0;
}
.description {
font-size: 14px;
font-weight: 400;
line-height: 19px;
color: $--version-card-description-text-color;
}
.release-date {
font-size: 12px;
line-height: 18px;
font-weight: 400;
color: $--version-card-release-date-text-color;
}
.nodes {
display: grid;
grid-template-columns: repeat(10, 1fr);
grid-row-gap: 12px;
margin-block-start: 24px;
}
</style>