feat: Expose iconUrl together with steps
This commit is contained in:
@@ -330,6 +330,7 @@ type Step {
|
|||||||
previousStepId: String
|
previousStepId: String
|
||||||
key: String
|
key: String
|
||||||
appKey: String
|
appKey: String
|
||||||
|
iconUrl: String
|
||||||
type: StepEnumType
|
type: StepEnumType
|
||||||
parameters: JSONObject
|
parameters: JSONObject
|
||||||
connection: Connection
|
connection: Connection
|
||||||
|
@@ -6,6 +6,7 @@ import Connection from './connection';
|
|||||||
import ExecutionStep from './execution-step';
|
import ExecutionStep from './execution-step';
|
||||||
import type { IStep } from '@automatisch/types';
|
import type { IStep } from '@automatisch/types';
|
||||||
import Telemetry from '../helpers/telemetry';
|
import Telemetry from '../helpers/telemetry';
|
||||||
|
import appConfig from '../config/app';
|
||||||
|
|
||||||
class Step extends Base {
|
class Step extends Base {
|
||||||
id!: string;
|
id!: string;
|
||||||
@@ -40,6 +41,10 @@ class Step extends Base {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static get virtualAttributes() {
|
||||||
|
return ['iconUrl'];
|
||||||
|
}
|
||||||
|
|
||||||
static relationMappings = () => ({
|
static relationMappings = () => ({
|
||||||
flow: {
|
flow: {
|
||||||
relation: Base.BelongsToOneRelation,
|
relation: Base.BelongsToOneRelation,
|
||||||
@@ -67,6 +72,10 @@ class Step extends Base {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
get iconUrl() {
|
||||||
|
return `${appConfig.baseUrl}/apps/${this.appKey}/assets/favicon.svg`;
|
||||||
|
}
|
||||||
|
|
||||||
async $afterInsert(queryContext: QueryContext) {
|
async $afterInsert(queryContext: QueryContext) {
|
||||||
await super.$afterInsert(queryContext);
|
await super.$afterInsert(queryContext);
|
||||||
Telemetry.stepCreated(this);
|
Telemetry.stepCreated(this);
|
||||||
|
Reference in New Issue
Block a user