mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-27 21:16:48 +00:00
Remove and fix some TODO entries (#188)
This commit is contained in:
parent
42d69365b8
commit
19ad3153e4
28
lib/api.dart
28
lib/api.dart
@ -691,16 +691,16 @@ class InvenTreeAPI {
|
||||
showServerError(url, L10().connectionRefused, error.toString());
|
||||
return;
|
||||
} on TimeoutException {
|
||||
print("TimeoutException at ${url}");
|
||||
debug("TimeoutException at ${url}");
|
||||
showTimeoutError(url);
|
||||
return;
|
||||
} on HandshakeException catch (error) {
|
||||
print("HandshakeException at ${url}:");
|
||||
debug("HandshakeException at ${url}:");
|
||||
debug(error.toString());
|
||||
showServerError(url, L10().serverCertificateError, error.toString());
|
||||
return;
|
||||
} catch (error, stackTrace) {
|
||||
print("Server error at ${url}: ${error.toString()}");
|
||||
debug("Server error at ${url}: ${error.toString()}");
|
||||
showServerError(url, L10().serverError, error.toString());
|
||||
sentryReportError(
|
||||
"api.downloadFile : client.openUrl",
|
||||
@ -730,8 +730,8 @@ class InvenTreeAPI {
|
||||
} on TimeoutException {
|
||||
showTimeoutError(url);
|
||||
} catch (error, stackTrace) {
|
||||
print("Error downloading image:");
|
||||
print(error.toString());
|
||||
debug("Error downloading image:");
|
||||
debug(error.toString());
|
||||
showServerError(url, L10().downloadError, error.toString());
|
||||
sentryReportError(
|
||||
"api.downloadFile : client.closeRequest",
|
||||
@ -956,25 +956,25 @@ class InvenTreeAPI {
|
||||
|
||||
return _request;
|
||||
} on SocketException catch (error) {
|
||||
print("SocketException at ${url}: ${error.toString()}");
|
||||
debug("SocketException at ${url}: ${error.toString()}");
|
||||
showServerError(url, L10().connectionRefused, error.toString());
|
||||
return null;
|
||||
} on TimeoutException {
|
||||
print("TimeoutException at ${url}");
|
||||
debug("TimeoutException at ${url}");
|
||||
showTimeoutError(url);
|
||||
return null;
|
||||
} on CertificateException catch (error) {
|
||||
print("CertificateException at ${url}:");
|
||||
print(error.toString());
|
||||
debug("CertificateException at ${url}:");
|
||||
debug(error.toString());
|
||||
showServerError(url, L10().serverCertificateError, error.toString());
|
||||
return null;
|
||||
} on HandshakeException catch (error) {
|
||||
print("HandshakeException at ${url}:");
|
||||
print(error.toString());
|
||||
debug("HandshakeException at ${url}:");
|
||||
debug(error.toString());
|
||||
showServerError(url, L10().serverCertificateError, error.toString());
|
||||
return null;
|
||||
} catch (error, stackTrace) {
|
||||
print("Server error at ${url}: ${error.toString()}");
|
||||
debug("Server error at ${url}: ${error.toString()}");
|
||||
showServerError(url, L10().serverError, error.toString());
|
||||
sentryReportError(
|
||||
"api.apiRequest : openUrl",
|
||||
@ -1054,8 +1054,8 @@ class InvenTreeAPI {
|
||||
response.error = "SocketException";
|
||||
response.errorDetail = error.toString();
|
||||
} on CertificateException catch (error) {
|
||||
print("CertificateException at ${request.uri.toString()}:");
|
||||
print(error.toString());
|
||||
debug("CertificateException at ${request.uri.toString()}:");
|
||||
debug(error.toString());
|
||||
showServerError(url, L10().serverCertificateError, error.toString());
|
||||
} on TimeoutException {
|
||||
showTimeoutError(url);
|
||||
|
@ -44,8 +44,9 @@ void debug(dynamic msg) {
|
||||
|
||||
if (Platform.environment.containsKey("FLUTTER_TEST")) {
|
||||
debug_messages.add(msg.toString());
|
||||
print("DEBUG: ${msg.toString()}");
|
||||
}
|
||||
|
||||
print("DEBUG: ${msg.toString()}");
|
||||
}
|
||||
|
||||
|
||||
|
@ -514,12 +514,6 @@ class InvenTreeModel {
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
// Provide a listing of objects at the endpoint
|
||||
// TODO - Static function which returns a list of objects (of this class)
|
||||
|
||||
// TODO - Define a "save" / "update" function
|
||||
|
||||
// Override this function for each sub-class
|
||||
bool matchAgainstString(String filter) {
|
||||
// Default implementation matches name and description
|
||||
|
@ -57,8 +57,6 @@ class InvenTreePartCategory extends InvenTreeModel {
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
var cat = InvenTreePartCategory.fromJson(json);
|
||||
|
||||
// TODO ?
|
||||
|
||||
return cat;
|
||||
}
|
||||
}
|
||||
|
@ -705,8 +705,6 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => StockNotesWidget(item))
|
||||
);
|
||||
// TODO: Load notes in markdown viewer widget
|
||||
// TODO: Make this widget editable?
|
||||
}
|
||||
)
|
||||
);
|
||||
|
@ -79,8 +79,7 @@ void main() {
|
||||
bool result = await api.connectToServer();
|
||||
assert(!result);
|
||||
|
||||
// TODO: Test the the right 'error message' is returned
|
||||
// TODO: The request above should throw a 'SockeException'
|
||||
debugContains("SocketException at");
|
||||
|
||||
// Test incorrect login details
|
||||
profile.server = "http://localhost:12345";
|
||||
@ -91,7 +90,7 @@ void main() {
|
||||
await api.connectToServer();
|
||||
assert(!result);
|
||||
|
||||
// TODO: Test that the connection attempt above throws an authentication error
|
||||
debugContains("Token request failed");
|
||||
|
||||
assert(!api.checkConnection());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user