Forced merge: merge ai-dev into master
This commit is contained in:
commit
b34e6de2b1
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
**/node_modules/
|
||||
*/build/
|
||||
**/build/
|
||||
.DS_Store
|
||||
.env
|
||||
5
app-shell/src/_schema.json
Normal file
5
app-shell/src/_schema.json
Normal file
File diff suppressed because one or more lines are too long
18
app-shell/src/config.js
Normal file
18
app-shell/src/config.js
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
const config = {
|
||||
admin_pass: "df170051",
|
||||
admin_email: "admin@flatlogic.com",
|
||||
schema_encryption_key: process.env.SCHEMA_ENCRYPTION_KEY || '',
|
||||
|
||||
project_uuid: 'df170051-a138-4641-ad0d-a5ac07a19601',
|
||||
flHost: process.env.NODE_ENV === 'production' ? 'https://flatlogic.com/projects' : 'http://localhost:3000/projects',
|
||||
|
||||
gitea_domain: process.env.GITEA_DOMAIN || 'gitea.flatlogic.app',
|
||||
gitea_username: process.env.GITEA_USERNAME || 'admin',
|
||||
gitea_api_token: process.env.GITEA_API_TOKEN || null,
|
||||
github_repo_url: process.env.GITHUB_REPO_URL || null,
|
||||
github_token: process.env.GITHUB_TOKEN || null,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
54
app-shell/src/index.js
Normal file
54
app-shell/src/index.js
Normal file
@ -0,0 +1,54 @@
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const app = express();
|
||||
const bodyParser = require('body-parser');
|
||||
const checkPermissions = require('./middlewares/check-permissions');
|
||||
const modifyPath = require('./middlewares/modify-path');
|
||||
const VCS = require('./services/vcs');
|
||||
|
||||
const executorRoutes = require('./routes/executor');
|
||||
const vcsRoutes = require('./routes/vcs');
|
||||
|
||||
// Function to initialize the Git repository
|
||||
function initRepo() {
|
||||
const projectId = '34916';
|
||||
return VCS.initRepo(projectId);
|
||||
}
|
||||
|
||||
// Start the Express app on APP_SHELL_PORT (4000)
|
||||
function startServer() {
|
||||
const PORT = 4000;
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Listening on port ${PORT}`);
|
||||
});
|
||||
}
|
||||
|
||||
// Run Git check after the server is up
|
||||
function runGitCheck() {
|
||||
initRepo()
|
||||
.then(result => {
|
||||
console.log(result?.message ? result.message : result);
|
||||
// Here you can add additional logic if needed
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Error during repo initialization:', err);
|
||||
// Optionally exit the process if Git check is critical:
|
||||
// process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
app.use(cors({ origin: true }));
|
||||
app.use(bodyParser.json());
|
||||
app.use(checkPermissions);
|
||||
app.use(modifyPath);
|
||||
|
||||
app.use('/executor', executorRoutes);
|
||||
app.use('/vcs', vcsRoutes);
|
||||
|
||||
// Start the app_shell server
|
||||
startServer();
|
||||
|
||||
// Now perform Git check
|
||||
runGitCheck();
|
||||
|
||||
module.exports = app;
|
||||
54
backend/src/db/migrations/1760712716317.js
Normal file
54
backend/src/db/migrations/1760712716317.js
Normal file
@ -0,0 +1,54 @@
|
||||
module.exports = {
|
||||
/**
|
||||
* @param {QueryInterface} queryInterface
|
||||
* @param {Sequelize} Sequelize
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async up(queryInterface, Sequelize) {
|
||||
/**
|
||||
* @type {Transaction}
|
||||
*/
|
||||
const transaction = await queryInterface.sequelize.transaction();
|
||||
try {
|
||||
await queryInterface.addColumn(
|
||||
'archival_items',
|
||||
'periodId',
|
||||
{
|
||||
type: Sequelize.DataTypes.UUID,
|
||||
|
||||
references: {
|
||||
model: 'periods',
|
||||
key: 'id',
|
||||
},
|
||||
},
|
||||
{ transaction },
|
||||
);
|
||||
|
||||
await transaction.commit();
|
||||
} catch (err) {
|
||||
await transaction.rollback();
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @param {QueryInterface} queryInterface
|
||||
* @param {Sequelize} Sequelize
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async down(queryInterface, Sequelize) {
|
||||
/**
|
||||
* @type {Transaction}
|
||||
*/
|
||||
const transaction = await queryInterface.sequelize.transaction();
|
||||
try {
|
||||
await queryInterface.removeColumn('archival_items', 'periodId', {
|
||||
transaction,
|
||||
});
|
||||
|
||||
await transaction.commit();
|
||||
} catch (err) {
|
||||
await transaction.rollback();
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
};
|
||||
88
backend/src/db/migrations/1760713191687.js
Normal file
88
backend/src/db/migrations/1760713191687.js
Normal file
@ -0,0 +1,88 @@
|
||||
module.exports = {
|
||||
/**
|
||||
* @param {QueryInterface} queryInterface
|
||||
* @param {Sequelize} Sequelize
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async up(queryInterface, Sequelize) {
|
||||
/**
|
||||
* @type {Transaction}
|
||||
*/
|
||||
const transaction = await queryInterface.sequelize.transaction();
|
||||
try {
|
||||
await queryInterface.removeColumn('periods', 'period_from', {
|
||||
transaction,
|
||||
});
|
||||
|
||||
await queryInterface.removeColumn('periods', 'period_to', {
|
||||
transaction,
|
||||
});
|
||||
|
||||
await queryInterface.addColumn(
|
||||
'periods',
|
||||
'period_from',
|
||||
{
|
||||
type: Sequelize.DataTypes.DATEONLY,
|
||||
},
|
||||
{ transaction },
|
||||
);
|
||||
|
||||
await queryInterface.addColumn(
|
||||
'periods',
|
||||
'period_to',
|
||||
{
|
||||
type: Sequelize.DataTypes.DATEONLY,
|
||||
},
|
||||
{ transaction },
|
||||
);
|
||||
|
||||
await transaction.commit();
|
||||
} catch (err) {
|
||||
await transaction.rollback();
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @param {QueryInterface} queryInterface
|
||||
* @param {Sequelize} Sequelize
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async down(queryInterface, Sequelize) {
|
||||
/**
|
||||
* @type {Transaction}
|
||||
*/
|
||||
const transaction = await queryInterface.sequelize.transaction();
|
||||
try {
|
||||
await queryInterface.removeColumn('periods', 'period_to', {
|
||||
transaction,
|
||||
});
|
||||
|
||||
await queryInterface.removeColumn('periods', 'period_from', {
|
||||
transaction,
|
||||
});
|
||||
|
||||
await queryInterface.addColumn(
|
||||
'periods',
|
||||
'period_to',
|
||||
{
|
||||
type: Sequelize.DataTypes.DATE,
|
||||
},
|
||||
{ transaction },
|
||||
);
|
||||
|
||||
await queryInterface.addColumn(
|
||||
'periods',
|
||||
'period_from',
|
||||
{
|
||||
type: Sequelize.DataTypes.DATE,
|
||||
},
|
||||
{ transaction },
|
||||
);
|
||||
|
||||
await transaction.commit();
|
||||
} catch (err) {
|
||||
await transaction.rollback();
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -19,11 +19,23 @@ module.exports = function (sequelize, DataTypes) {
|
||||
},
|
||||
|
||||
period_from: {
|
||||
type: DataTypes.DATE,
|
||||
type: DataTypes.DATEONLY,
|
||||
|
||||
get: function () {
|
||||
return this.getDataValue('period_from')
|
||||
? moment.utc(this.getDataValue('period_from')).format('YYYY-MM-DD')
|
||||
: null;
|
||||
},
|
||||
},
|
||||
|
||||
period_to: {
|
||||
type: DataTypes.DATE,
|
||||
type: DataTypes.DATEONLY,
|
||||
|
||||
get: function () {
|
||||
return this.getDataValue('period_to')
|
||||
? moment.utc(this.getDataValue('period_to')).format('YYYY-MM-DD')
|
||||
: null;
|
||||
},
|
||||
},
|
||||
|
||||
importHash: {
|
||||
|
||||
14
cloudbuild.yaml
Normal file
14
cloudbuild.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
steps:
|
||||
- name: 'gcr.io/cloud-builders/docker'
|
||||
entrypoint: 'bash'
|
||||
args: ['-c', 'docker pull gcr.io/fldemo-315215/hoboken-34916-dev:latest || exit 0']
|
||||
- name: 'gcr.io/cloud-builders/docker'
|
||||
args: [
|
||||
'build',
|
||||
'-t', 'gcr.io/fldemo-315215/hoboken-34916-dev:latest',
|
||||
'--file', 'Dockerfile.dev',
|
||||
'--cache-from', 'gcr.io/fldemo-315215/hoboken-34916-dev:latest',
|
||||
'.'
|
||||
]
|
||||
images: ['gcr.io/fldemo-315215/hoboken-34916-dev:latest']
|
||||
logsBucket: 'gs://fldemo-315215-cloudbuild-logs'
|
||||
1
frontend/json/runtimeError.json
Normal file
1
frontend/json/runtimeError.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
3
frontend/next-env.d.ts
vendored
3
frontend/next-env.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
/// <reference path="./build/types/routes.d.ts" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
|
||||
|
||||
@ -89,7 +89,7 @@ const CardPeriods = ({
|
||||
</dt>
|
||||
<dd className='flex items-start gap-x-2'>
|
||||
<div className='font-medium line-clamp-4'>
|
||||
{dataFormatter.dateTimeFormatter(item.period_from)}
|
||||
{dataFormatter.dateFormatter(item.period_from)}
|
||||
</div>
|
||||
</dd>
|
||||
</div>
|
||||
@ -100,7 +100,7 @@ const CardPeriods = ({
|
||||
</dt>
|
||||
<dd className='flex items-start gap-x-2'>
|
||||
<div className='font-medium line-clamp-4'>
|
||||
{dataFormatter.dateTimeFormatter(item.period_to)}
|
||||
{dataFormatter.dateFormatter(item.period_to)}
|
||||
</div>
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
@ -59,14 +59,14 @@ const ListPeriods = ({
|
||||
<div className={'flex-1 px-3'}>
|
||||
<p className={'text-xs text-gray-500 '}>Period From</p>
|
||||
<p className={'line-clamp-2'}>
|
||||
{dataFormatter.dateTimeFormatter(item.period_from)}
|
||||
{dataFormatter.dateFormatter(item.period_from)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className={'flex-1 px-3'}>
|
||||
<p className={'text-xs text-gray-500 '}>Period To</p>
|
||||
<p className={'line-clamp-2'}>
|
||||
{dataFormatter.dateTimeFormatter(item.period_to)}
|
||||
{dataFormatter.dateFormatter(item.period_to)}
|
||||
</p>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
@ -61,7 +61,7 @@ export const loadColumns = async (
|
||||
|
||||
editable: hasUpdatePermission,
|
||||
|
||||
type: 'dateTime',
|
||||
type: 'date',
|
||||
valueGetter: (params: GridValueGetterParams) =>
|
||||
new Date(params.row.period_from),
|
||||
},
|
||||
@ -77,7 +77,7 @@ export const loadColumns = async (
|
||||
|
||||
editable: hasUpdatePermission,
|
||||
|
||||
type: 'dateTime',
|
||||
type: 'date',
|
||||
valueGetter: (params: GridValueGetterParams) =>
|
||||
new Date(params.row.period_to),
|
||||
},
|
||||
|
||||
@ -99,8 +99,7 @@ const EditPeriods = () => {
|
||||
|
||||
<FormField label='Period From'>
|
||||
<DatePicker
|
||||
dateFormat='yyyy-MM-dd hh:mm'
|
||||
showTimeSelect
|
||||
dateFormat='yyyy-MM-dd'
|
||||
selected={
|
||||
initialValues.period_from
|
||||
? new Date(
|
||||
@ -118,8 +117,7 @@ const EditPeriods = () => {
|
||||
|
||||
<FormField label='Period To'>
|
||||
<DatePicker
|
||||
dateFormat='yyyy-MM-dd hh:mm'
|
||||
showTimeSelect
|
||||
dateFormat='yyyy-MM-dd'
|
||||
selected={
|
||||
initialValues.period_to
|
||||
? new Date(
|
||||
|
||||
@ -97,8 +97,7 @@ const EditPeriodsPage = () => {
|
||||
|
||||
<FormField label='Period From'>
|
||||
<DatePicker
|
||||
dateFormat='yyyy-MM-dd hh:mm'
|
||||
showTimeSelect
|
||||
dateFormat='yyyy-MM-dd'
|
||||
selected={
|
||||
initialValues.period_from
|
||||
? new Date(
|
||||
@ -116,8 +115,7 @@ const EditPeriodsPage = () => {
|
||||
|
||||
<FormField label='Period To'>
|
||||
<DatePicker
|
||||
dateFormat='yyyy-MM-dd hh:mm'
|
||||
showTimeSelect
|
||||
dateFormat='yyyy-MM-dd'
|
||||
selected={
|
||||
initialValues.period_to
|
||||
? new Date(
|
||||
|
||||
@ -28,12 +28,7 @@ const PeriodsTablesPage = () => {
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const [filters] = useState([
|
||||
{ label: 'Name', title: 'name' },
|
||||
|
||||
{ label: 'Period From', title: 'period_from', date: 'true' },
|
||||
{ label: 'Period To', title: 'period_to', date: 'true' },
|
||||
]);
|
||||
const [filters] = useState([{ label: 'Name', title: 'name' }]);
|
||||
|
||||
const hasCreatePermission =
|
||||
currentUser && hasPermission(currentUser, 'CREATE_PERIODS');
|
||||
|
||||
@ -36,8 +36,10 @@ const initialValues = {
|
||||
name: '',
|
||||
|
||||
period_from: '',
|
||||
datePeriod_from: '',
|
||||
|
||||
period_to: '',
|
||||
datePeriod_to: '',
|
||||
};
|
||||
|
||||
const PeriodsNew = () => {
|
||||
@ -73,18 +75,14 @@ const PeriodsNew = () => {
|
||||
|
||||
<FormField label='Period From'>
|
||||
<Field
|
||||
type='datetime-local'
|
||||
type='date'
|
||||
name='period_from'
|
||||
placeholder='Period From'
|
||||
/>
|
||||
</FormField>
|
||||
|
||||
<FormField label='Period To'>
|
||||
<Field
|
||||
type='datetime-local'
|
||||
name='period_to'
|
||||
placeholder='Period To'
|
||||
/>
|
||||
<Field type='date' name='period_to' placeholder='Period To' />
|
||||
</FormField>
|
||||
|
||||
<BaseDivider />
|
||||
|
||||
@ -28,12 +28,7 @@ const PeriodsTablesPage = () => {
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const [filters] = useState([
|
||||
{ label: 'Name', title: 'name' },
|
||||
|
||||
{ label: 'Period From', title: 'period_from', date: 'true' },
|
||||
{ label: 'Period To', title: 'period_to', date: 'true' },
|
||||
]);
|
||||
const [filters] = useState([{ label: 'Name', title: 'name' }]);
|
||||
|
||||
const hasCreatePermission =
|
||||
currentUser && hasPermission(currentUser, 'CREATE_PERIODS');
|
||||
|
||||
@ -62,7 +62,7 @@ const PeriodsView = () => {
|
||||
<FormField label='Period From'>
|
||||
{periods.period_from ? (
|
||||
<DatePicker
|
||||
dateFormat='yyyy-MM-dd hh:mm'
|
||||
dateFormat='yyyy-MM-dd'
|
||||
showTimeSelect
|
||||
selected={
|
||||
periods.period_from
|
||||
@ -81,7 +81,7 @@ const PeriodsView = () => {
|
||||
<FormField label='Period To'>
|
||||
{periods.period_to ? (
|
||||
<DatePicker
|
||||
dateFormat='yyyy-MM-dd hh:mm'
|
||||
dateFormat='yyyy-MM-dd'
|
||||
showTimeSelect
|
||||
selected={
|
||||
periods.period_to
|
||||
|
||||
1
pids/backend.pid
Normal file
1
pids/backend.pid
Normal file
@ -0,0 +1 @@
|
||||
4
|
||||
1
pids/frontend.pid
Normal file
1
pids/frontend.pid
Normal file
@ -0,0 +1 @@
|
||||
3
|
||||
Loading…
x
Reference in New Issue
Block a user