fix(mobile): stabilize finding creation and narrow-screen actions
Android CI / RC / Android · lint, tests, debug APK, release compile (push) Successful in 3m3s
DH V2 CI / API · typecheck, tests, build (push) Successful in 34s
DH V2 CI / WEB · typecheck, build (push) Successful in 18s
Production dependency audit / API · production dependencies (push) Successful in 9s
Production dependency audit / WEB · production dependencies (push) Successful in 9s
DH V2 CI / Docker / scripts contract (push) Successful in 1m3s
Android CI / RC / Android · lint, tests, debug APK, release compile (push) Successful in 3m3s
DH V2 CI / API · typecheck, tests, build (push) Successful in 34s
DH V2 CI / WEB · typecheck, build (push) Successful in 18s
Production dependency audit / API · production dependencies (push) Successful in 9s
Production dependency audit / WEB · production dependencies (push) Successful in 9s
DH V2 CI / Docker / scripts contract (push) Successful in 1m3s
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "dhv2-api",
|
||||
"version": "0.29.0-5",
|
||||
"version": "0.29.0-6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dhv2-api",
|
||||
"version": "0.29.0-5",
|
||||
"version": "0.29.0-6",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dhv2-api",
|
||||
"version": "0.29.0-5",
|
||||
"version": "0.29.0-6",
|
||||
"private": true,
|
||||
"license": "UNLICENSED",
|
||||
"scripts": {
|
||||
|
||||
@@ -1166,10 +1166,13 @@ export class InspectionFindingsService {
|
||||
principal: AuthPrincipal,
|
||||
): Promise<number> {
|
||||
const [row] = await manager.query(`
|
||||
UPDATE inspection_findings
|
||||
SET current_version = current_version + 1
|
||||
WHERE id = $1
|
||||
RETURNING current_version AS "versionNumber"
|
||||
WITH updated AS (
|
||||
UPDATE inspection_findings
|
||||
SET current_version = current_version + 1
|
||||
WHERE id = $1
|
||||
RETURNING current_version
|
||||
)
|
||||
SELECT current_version AS "versionNumber" FROM updated
|
||||
`, [finding.id]) as Array<{ versionNumber: number }>;
|
||||
const versionNumber = Number(row.versionNumber);
|
||||
finding.currentVersion = versionNumber;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export const API_VERSION = '0.29.0-5';
|
||||
export const API_VERSION = '0.29.0-6';
|
||||
export const API_PHASE = 'F6.2';
|
||||
|
||||
@@ -8,5 +8,5 @@ test('health metadata reports the current F6.1 release', () => {
|
||||
assert.equal(API_PHASE, 'F6.2');
|
||||
const pkg = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8')) as { version: string };
|
||||
assert.equal(API_VERSION, pkg.version);
|
||||
assert.equal(API_VERSION, '0.29.0-5');
|
||||
assert.equal(API_VERSION, '0.29.0-6');
|
||||
});
|
||||
@@ -10,8 +10,8 @@ function mountedRepoFile(path: string): string {
|
||||
test('F6.3 Android test cut targets production API and has a distinct installable debug version', () => {
|
||||
const gradle = mountedRepoFile('android-app/app/build.gradle.kts');
|
||||
|
||||
assert.match(gradle, /versionCode = 35/);
|
||||
assert.match(gradle, /versionName = "0\.19\.7"/);
|
||||
assert.match(gradle, /versionCode = 36/);
|
||||
assert.match(gradle, /versionName = "0\.19\.8"/);
|
||||
assert.match(gradle, /https:\/\/dhv2\.korexlabs\.com\/api\/v3\//);
|
||||
assert.match(gradle, /applicationIdSuffix = "\.debug"/);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import test from 'node:test';
|
||||
|
||||
function source(path: string): string {
|
||||
return readFileSync(resolve(process.cwd(), path), 'utf8');
|
||||
}
|
||||
|
||||
test('F6.6 Hallazgo version capture uses a SELECT-shaped CTE so TypeORM never turns the version into NaN', () => {
|
||||
const service = source('src/inspection-findings/inspection-findings.service.ts');
|
||||
|
||||
assert.match(service, /WITH updated AS \(/);
|
||||
assert.match(service, /UPDATE inspection_findings/);
|
||||
assert.match(service, /RETURNING current_version/);
|
||||
assert.match(service, /SELECT current_version AS "versionNumber" FROM updated/);
|
||||
assert.match(service, /const versionNumber = Number\(row\.versionNumber\)/);
|
||||
});
|
||||
|
||||
test('F6.6 mobile home keeps Salir readable on narrow screens', () => {
|
||||
const home = source('../android-app/app/src/main/java/com/korexlabs/dhinspeccion/ui/MobileHomeScreen.kt');
|
||||
|
||||
assert.match(home, /Text\("Actualizar", maxLines = 1\)/);
|
||||
assert.match(home, /Text\("Salir", maxLines = 1\)/);
|
||||
assert.match(home, /modifier = Modifier\.weight\(1f\)/);
|
||||
});
|
||||
|
||||
test('F6.6 Hallazgos can receive as many field photos as needed', () => {
|
||||
const screen = source('../android-app/app/src/main/java/com/korexlabs/dhinspeccion/ui/FieldFindingScreen.kt');
|
||||
const model = source('../android-app/app/src/main/java/com/korexlabs/dhinspeccion/MainViewModel.kt');
|
||||
|
||||
assert.match(screen, /Agregar foto con GPS/);
|
||||
assert.match(screen, /Agregar otra foto con GPS/);
|
||||
assert.match(screen, /Podés adjuntar todas las fotos que necesites/);
|
||||
assert.match(model, /loadEvidenceInternal\(findingId\)/);
|
||||
assert.doesNotMatch(screen, /máximo de 1 foto|solo una foto/i);
|
||||
});
|
||||
Reference in New Issue
Block a user