mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Display test results
This commit is contained in:
parent
ec31c26932
commit
e89713660b
3 changed files with 164 additions and 6 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:InvenTree/api.dart';
|
||||
import 'package:InvenTree/inventree/stock.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import 'model.dart';
|
||||
import 'dart:io';
|
||||
|
|
@ -95,6 +97,29 @@ class InvenTreePartTestTemplate extends InvenTreeModel {
|
|||
|
||||
return template;
|
||||
}
|
||||
|
||||
bool passFailStatus() {
|
||||
var result = latestResult();
|
||||
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return result.result;
|
||||
}
|
||||
|
||||
// List of test results associated with this template
|
||||
List<InvenTreeStockItemTestResult> results = [];
|
||||
|
||||
// Return the most recent test result recorded against this template
|
||||
InvenTreeStockItemTestResult latestResult() {
|
||||
if (results.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return results.last;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class InvenTreeStockItemTestResult extends InvenTreeModel {
|
|||
|
||||
String get key => jsondata['key'] ?? '';
|
||||
|
||||
String get test_name => jsondata['test'] ?? '';
|
||||
String get testName => jsondata['test'] ?? '';
|
||||
|
||||
bool get result => jsondata['result'] ?? false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue