Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
24bf07e068 | ||
![]() |
bae234827f | ||
![]() |
81c698f45b | ||
![]() |
c9fecec575 | ||
![]() |
2f42dfdc51 | ||
![]() |
5afd500c26 | ||
![]() |
cc1a924c8b | ||
![]() |
02005a3f09 | ||
![]() |
d9219a5a48 |
@@ -52,7 +52,7 @@ const appConfig = {
|
|||||||
isDev: appEnv === 'development',
|
isDev: appEnv === 'development',
|
||||||
isTest: appEnv === 'test',
|
isTest: appEnv === 'test',
|
||||||
isProd: appEnv === 'production',
|
isProd: appEnv === 'production',
|
||||||
version: '0.13.0',
|
version: '0.13.1',
|
||||||
postgresDatabase: process.env.POSTGRES_DATABASE || 'automatisch_development',
|
postgresDatabase: process.env.POSTGRES_DATABASE || 'automatisch_development',
|
||||||
postgresSchema: process.env.POSTGRES_SCHEMA || 'public',
|
postgresSchema: process.env.POSTGRES_SCHEMA || 'public',
|
||||||
postgresPort: parseInt(process.env.POSTGRES_PORT || '5432'),
|
postgresPort: parseInt(process.env.POSTGRES_PORT || '5432'),
|
||||||
|
@@ -1,13 +1,17 @@
|
|||||||
import appConfig from '../../../../config/app.js';
|
import appConfig from '../../../../config/app.js';
|
||||||
import { hasValidLicense } from '../../../../helpers/license.ee.js';
|
import { hasValidLicense } from '../../../../helpers/license.ee.js';
|
||||||
import { renderObject } from '../../../../helpers/renderer.js';
|
import { renderObject } from '../../../../helpers/renderer.js';
|
||||||
|
import Config from '../../../../models/config.js';
|
||||||
|
|
||||||
export default async (request, response) => {
|
export default async (request, response) => {
|
||||||
|
const installationCompleted = await Config.isInstallationCompleted();
|
||||||
|
|
||||||
const info = {
|
const info = {
|
||||||
isCloud: appConfig.isCloud,
|
|
||||||
isMation: appConfig.isMation,
|
|
||||||
isEnterprise: await hasValidLicense(),
|
|
||||||
docsUrl: appConfig.docsUrl,
|
docsUrl: appConfig.docsUrl,
|
||||||
|
installationCompleted,
|
||||||
|
isCloud: appConfig.isCloud,
|
||||||
|
isEnterprise: await hasValidLicense(),
|
||||||
|
isMation: appConfig.isMation,
|
||||||
};
|
};
|
||||||
|
|
||||||
renderObject(response, info);
|
renderObject(response, info);
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
import { vi, expect, describe, it } from 'vitest';
|
import { vi, expect, describe, it } from 'vitest';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
import appConfig from '../../../../config/app.js';
|
import appConfig from '../../../../config/app.js';
|
||||||
|
import Config from '../../../../models/config.js';
|
||||||
import app from '../../../../app.js';
|
import app from '../../../../app.js';
|
||||||
import infoMock from '../../../../../test/mocks/rest/api/v1/automatisch/info.js';
|
import infoMock from '../../../../../test/mocks/rest/api/v1/automatisch/info.js';
|
||||||
import * as license from '../../../../helpers/license.ee.js';
|
import * as license from '../../../../helpers/license.ee.js';
|
||||||
|
|
||||||
describe('GET /api/v1/automatisch/info', () => {
|
describe('GET /api/v1/automatisch/info', () => {
|
||||||
it('should return Automatisch info', async () => {
|
it('should return Automatisch info', async () => {
|
||||||
|
vi.spyOn(Config, 'isInstallationCompleted').mockResolvedValue(true);
|
||||||
vi.spyOn(appConfig, 'isCloud', 'get').mockReturnValue(false);
|
vi.spyOn(appConfig, 'isCloud', 'get').mockReturnValue(false);
|
||||||
vi.spyOn(appConfig, 'isMation', 'get').mockReturnValue(false);
|
vi.spyOn(appConfig, 'isMation', 'get').mockReturnValue(false);
|
||||||
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
vi.spyOn(license, 'hasValidLicense').mockResolvedValue(true);
|
||||||
|
@@ -10,7 +10,7 @@ describe('GET /api/v1/automatisch/version', () => {
|
|||||||
|
|
||||||
const expectedPayload = {
|
const expectedPayload = {
|
||||||
data: {
|
data: {
|
||||||
version: '0.13.0',
|
version: '0.13.1',
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
count: 1,
|
count: 1,
|
||||||
|
@@ -37,6 +37,10 @@ export default function computeParameters(parameters, executionSteps) {
|
|||||||
try {
|
try {
|
||||||
const parsedValue = JSON.parse(computedValue);
|
const parsedValue = JSON.parse(computedValue);
|
||||||
|
|
||||||
|
if (typeof parsedValue === 'number') {
|
||||||
|
throw new Error('Use original unparsed value.');
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...result,
|
...result,
|
||||||
[key]: parsedValue,
|
[key]: parsedValue,
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
const infoMock = () => {
|
const infoMock = () => {
|
||||||
return {
|
return {
|
||||||
data: {
|
data: {
|
||||||
isCloud: false,
|
|
||||||
isMation: false,
|
|
||||||
isEnterprise: true,
|
|
||||||
docsUrl: 'https://automatisch.io/docs',
|
docsUrl: 'https://automatisch.io/docs',
|
||||||
|
installationCompleted: true,
|
||||||
|
isCloud: false,
|
||||||
|
isEnterprise: true,
|
||||||
|
isMation: false,
|
||||||
},
|
},
|
||||||
meta: {
|
meta: {
|
||||||
count: 1,
|
count: 1,
|
||||||
|
@@ -8,11 +8,6 @@
|
|||||||
name="description"
|
name="description"
|
||||||
content="Build workflow automation without spending time and money. No code is required."
|
content="Build workflow automation without spending time and money. No code is required."
|
||||||
/>
|
/>
|
||||||
<!--
|
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
|
||||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
||||||
-->
|
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
||||||
<!--
|
<!--
|
||||||
Notice the use of %PUBLIC_URL% in the tags above.
|
Notice the use of %PUBLIC_URL% in the tags above.
|
||||||
It will be replaced with the URL of the `public` folder during the build.
|
It will be replaced with the URL of the `public` folder during the build.
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"short_name": "automatisch",
|
|
||||||
"name": "automatisch",
|
|
||||||
"description": "Build workflow automation without spending time and money. No code is required.",
|
|
||||||
"start_url": ".",
|
|
||||||
"display": "standalone",
|
|
||||||
"theme_color": "#000000",
|
|
||||||
"background_color": "#ffffff"
|
|
||||||
}
|
|
@@ -44,7 +44,7 @@ function InstallationForm() {
|
|||||||
|
|
||||||
const handleOnRedirect = () => {
|
const handleOnRedirect = () => {
|
||||||
queryClient.invalidateQueries({
|
queryClient.invalidateQueries({
|
||||||
queryKey: ['automatisch', 'config'],
|
queryKey: ['automatisch', 'info'],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -29,14 +29,16 @@ import adminSettingsRoutes from './adminSettingsRoutes';
|
|||||||
import Notifications from 'pages/Notifications';
|
import Notifications from 'pages/Notifications';
|
||||||
import useAutomatischConfig from 'hooks/useAutomatischConfig';
|
import useAutomatischConfig from 'hooks/useAutomatischConfig';
|
||||||
import useAuthentication from 'hooks/useAuthentication';
|
import useAuthentication from 'hooks/useAuthentication';
|
||||||
|
import useAutomatischInfo from 'hooks/useAutomatischInfo';
|
||||||
import Installation from 'pages/Installation';
|
import Installation from 'pages/Installation';
|
||||||
|
|
||||||
function Routes() {
|
function Routes() {
|
||||||
const { data: configData, isSuccess } = useAutomatischConfig();
|
const { data: automatischInfo, isSuccess } = useAutomatischInfo();
|
||||||
|
const { data: configData } = useAutomatischConfig();
|
||||||
const { isAuthenticated } = useAuthentication();
|
const { isAuthenticated } = useAuthentication();
|
||||||
const config = configData?.data;
|
const config = configData?.data;
|
||||||
|
|
||||||
const installed = isSuccess ? config?.['installation.completed'] === true : true;
|
const installed = isSuccess ? automatischInfo.data.installationCompleted : true;
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Reference in New Issue
Block a user