refactor: Extract iconUrl generation of steps to helper

This commit is contained in:
Faruk AYDIN
2025-03-06 17:18:16 +01:00
parent 4a626016b2
commit 0a4d0f9f3a
2 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
import appConfig from '../config/app.js';
export const generateIconUrl = (appKey) => {
if (!appKey) return null;
return `${appConfig.baseUrl}/apps/${appKey}/assets/favicon.svg`;
};

View File

@@ -9,6 +9,7 @@ import appConfig from '../config/app.js';
import globalVariable from '../helpers/global-variable.js';
import computeParameters from '../helpers/compute-parameters.js';
import testRun from '../services/test-run.js';
import { generateIconUrl } from '../helpers/generate-icon-url.js';
class Step extends Base {
static tableName = 'steps';
@@ -88,9 +89,7 @@ class Step extends Base {
}
get iconUrl() {
if (!this.appKey) return null;
return `${appConfig.baseUrl}/apps/${this.appKey}/assets/favicon.svg`;
return generateIconUrl(this.appKey);
}
get isTrigger() {