Skip to content

Commit

Permalink
feat: allow node registry_id to be undefined
Browse files Browse the repository at this point in the history
dependabot[bot] authored and tada5hi committed Jan 10, 2025
1 parent 448e9b8 commit a049c7a
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -47,8 +47,6 @@
"server-train-manager": "npm run dev --workspace=packages/server-train-manager"
},
"lint-staged": {
"*.vue": "npm run lint:fix",
"*.js": "npm run lint:fix",
"*.ts": "npm run lint:fix"
"*.{vue,js,ts}": "npm run lint:fix"
}
}
3 changes: 3 additions & 0 deletions packages/client-ui/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@ export default defineNuxtConfig({
experimental: {
scanPageMeta: false,
},
devtools: {
componentInspector: false,
},
runtimeConfig: {
authupUrl: process.env.AUTHUP_URL,
coreUrl: process.env.CORE_URL,
2 changes: 1 addition & 1 deletion packages/client-vue/src/components/node/FNodeForm.ts
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ export default defineComponent({
required,
},
registry_id: {
required,

},
external_name: {
alphaNumHyphenUnderscore: helpers.regex(alphaNumHyphenUnderscoreRegex),
14 changes: 11 additions & 3 deletions packages/server-core/src/domains/analysis/commands/build-start.ts
Original file line number Diff line number Diff line change
@@ -32,16 +32,24 @@ export async function startAnalysisBuild(
}

const analysisNodeRepository = dataSource.getRepository(AnalysisNodeEntity);
const trainStations = await analysisNodeRepository.find({
const analysisNodes = await analysisNodeRepository.find({
where: {
analysis_id: entity.id,
},
relations: ['node'],
});

for (let i = 0; i < trainStations.length; i++) {
if (trainStations[i].approval_status !== AnalysisNodeApprovalStatus.APPROVED) {
for (let i = 0; i < analysisNodes.length; i++) {
if (analysisNodes[i].approval_status !== AnalysisNodeApprovalStatus.APPROVED) {
throw new BadRequestError('Not all nodes have approved the analysis yet.');
}

if (
analysisNodes[i].node &&
!analysisNodes[i].node.registry_id
) {
throw new BadRequestError(`The node ${analysisNodes[i].node.name} is not assigned to a registry yet.`);
}
}

if (!entity.registry_id) {
11 changes: 0 additions & 11 deletions packages/server-core/src/domains/node/entity.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
*/

import {
BeforeInsert, BeforeUpdate,
Column,
CreateDateColumn,
Entity,
@@ -86,14 +85,4 @@ export class NodeEntity implements Node {

@UpdateDateColumn()
updated_at: Date;

// ------------------------------------------------------------------

@BeforeInsert()
@BeforeUpdate()
setHidden() {
if (!this.registry_id) {
this.hidden = true;
}
}
}

0 comments on commit a049c7a

Please sign in to comment.