Skip to content

Commit

Permalink
Merge pull request #132 from RabotaRu/v2.5.2
Browse files Browse the repository at this point in the history
v2.5.2
  • Loading branch information
rpiontik authored Dec 14, 2022
2 parents c11f799 + 9f19e69 commit b921ed3
Show file tree
Hide file tree
Showing 18 changed files with 460 additions and 243 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"error",
"always"
],
"no-console": "warn",
"no-debugger": "off",
"no-console": "warn",
"no-debugger": "warn",
"quotes": [
"error",
"single"
Expand Down Expand Up @@ -106,4 +106,4 @@
"longform"
]
}
}
}
4 changes: 4 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ config.pumlServer =
|| process.env.VUE_APP_PLANTUML_SERVER
|| 'www.plantuml.com/plantuml/svg/';

config.pumlRequestType =
window.$PAPI?.settings?.render?.request_type
|| 'get';

export default config;
2 changes: 1 addition & 1 deletion public/documentation/arch/aspects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ aspects: # Архитектурные аспекты
# Кастомные поля для демонстрации работы расширения метамодели
# смоти
prodact: Буренин Ольгерт Юрьевич
analyst: Семенов Руслан Вазенович
analyst: Семенов Руслан Вазгенович
curator: Кучменко Татьяна Вадимовна
dochub.git:
title: Git
Expand Down
77 changes: 53 additions & 24 deletions public/documentation/entities/extentions/entity.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
entities:
components:
widgets:
# Расширяем презентацию сущности
presentations:
# Встраиваемся в основную перезентацию (т.е. она уже существует)
blank:
# Добавляем собственный виджет
widgets:
outside_links: # Идентификатор виджета
# Название виджета
title: Кто зависит от этого компонента
# Идентификатор презентации, которая будет использоваться в виджете
presentation: outside_links
# В params можно передать дополнительные параметры
# презентации, которые будут доступны в перемнной $params
params:
param1: Значение параметра 1
param2: Значение параметра 2
# Расположение
# < - слева
# > - справа
# = - Растянуть на 100%
align: "<"
# Добавляем собственную презентацию
# Будем показывать внешние связи на данный компонент
outside_links: # Идентификатор виджета
# Название виджета
title: Кто зависит от этого компонента
# Расположение
# < - слева
# > - справа
# = - Растянуть на 100%
align: "<"
outside_links: # Идентификатор представления
# Контракт по параметрам представления в формате JSONSchema
params:
type: object
properties:
component:
title: Идентификатор компонента
type: string
param1:
title: Обязательный параметр 1
type: string
required:
- component
# Тип документа шаблона
type: table
# Определяем заголовок таблицы
Expand Down Expand Up @@ -47,24 +73,27 @@ entities:
))^(id)]
)
# Расширяем сущность "aspects"
# Аналогично расширяем сущность "aspects"
aspects:
# Инъектируем собственный виджет
widgets:
# Будем показывать расширенную информацию об аспекте
people: # Идентификатор виджета
# Название виджета
title: Люди
# Расположение
# < - слева
# > - справа
# = - Растянуть на 100%
align: "<"
# Тип документа шаблона
presentations:
blank:
widgets:
# Будем показывать расширенную информацию об аспекте
people: # Идентификатор виджета
title: Люди
presentation: people
align: "<"
people:
params:
type: object
properties:
aspect:
title: Идентификатор аспекта
type: string
required:
- aspect
type: markdown
# Шаблон виджета
template: templates/people.md
# Данные для шаблона
source: >
(
$lookup(aspects, $params.aspect)
Expand Down
86 changes: 47 additions & 39 deletions src/components/Architecture/Aspect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,21 @@
</v-card>
<src-locations v-bind:locations="srcLocations" />

<widget
<v-card
v-for="widget in widgets.left"
v-bind:id="widget.id"
v-bind:key="widget.id"
class="card-item"
xs12
md12
v-bind:profile="widget.profile"
v-bind:base-u-r-i="widget.baseURI"
v-bind:params="widget.params" />
class="card-item"
xs12
md12>
<v-card-title>
<v-icon left>description</v-icon>
<span class="title">{{ widget.title }}</span>
</v-card-title>
<entity
entity="aspects"
v-bind:presentation="widget.presentation"
v-bind:params="widget.params" />
</v-card>
</v-container>
</v-layout>
</v-flex>
Expand All @@ -72,29 +77,39 @@
v-bind:contexts="contexts"
d-flex />

<widget
<v-card
v-for="widget in widgets.right"
v-bind:id="widget.id"
v-bind:key="widget.id"
xs12
md7
class="card-item"
v-bind:profile="widget.profile"
v-bind:base-u-r-i="widget.baseURI"
v-bind:params="widget.params" />
class="card-item"
xs12
md7>
<v-card-title>
<v-icon left>description</v-icon>
<span class="title">{{ widget.title }}</span>
</v-card-title>
<entity
entity="aspects"
v-bind:presentation="widget.presentation"
v-bind:params="widget.params" />
</v-card>
</v-flex>

<v-flex xs12 md12 d-flex>
<widget
<v-card
v-for="widget in widgets.fill"
v-bind:id="widget.id"
v-bind:key="widget.id"
xs12
md12
class="card-item"
style="margin-top: 12px; "
v-bind:profile="widget.profile"
v-bind:base-u-r-i="widget.baseURI"
v-bind:params="widget.params" />
class="card-item"
xs12
md12>
<v-card-title>
<v-icon left>description</v-icon>
<span class="title">{{ widget.title }}</span>
</v-card-title>
<entity
entity="aspects"
v-bind:presentation="widget.presentation"
v-bind:params="widget.params" />
</v-card>
</v-flex>
</v-layout>

Expand All @@ -112,7 +127,7 @@
import SrcLocations from './tabs/SrcLocations.vue';
import requests from '@/helpers/requests';
import env from '@/helpers/env';
import Widget from './Widget.vue';
import Entity from '@/components/Entities/Entity.vue';
export default {
name: 'Aspect',
Expand All @@ -122,7 +137,7 @@
TabContexts,
Empty,
SrcLocations,
Widget
Entity
},
props: {
aspect: { type: String, default: '' }
Expand Down Expand Up @@ -183,19 +198,12 @@
};
const widgets = (query.expression(query.widgetsForAspect()).evaluate(this.manifest) || {});
for (const id in widgets) {
const wiget = widgets[id];
const profile = {
id,
profile: widgets[id],
baseURI: (this.$store.state.sources.find((item) => item.path === `/entities/aspects/widgets/${id}`) || {}).location,
params: {
aspect: this.aspect
}
};
let wiget = widgets[id];
wiget.params = Object.assign(wiget.params || {}, {aspect: this.aspect});
switch(wiget.align) {
case '<': result.left.push(profile); break;
case '>': result.right.push(profile); break;
default: result.fill.push(profile); break;
case '<': result.left.push(wiget); break;
case '>': result.right.push(wiget); break;
default: result.fill.push(wiget); break;
}
}
return result;
Expand Down
Loading

0 comments on commit b921ed3

Please sign in to comment.