mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-29 05:56:47 +00:00
Fix URL getters
This commit is contained in:
parent
beeea794cb
commit
2dfe8921eb
@ -13,7 +13,7 @@ class InvenTreeCompany extends InvenTreeModel {
|
||||
String NAME = "Company";
|
||||
|
||||
@override
|
||||
String URL = "company/";
|
||||
String get URL => "company/";
|
||||
|
||||
InvenTreeCompany() : super();
|
||||
|
||||
@ -49,7 +49,7 @@ class InvenTreeCompany extends InvenTreeModel {
|
||||
*/
|
||||
class InvenTreeSupplierPart extends InvenTreeModel {
|
||||
@override
|
||||
String URL = "company/part/";
|
||||
String get URL => "company/part/";
|
||||
|
||||
Map<String, String> _filters() {
|
||||
return {
|
||||
|
@ -37,7 +37,7 @@ class InvenTreePageResponse {
|
||||
class InvenTreeModel {
|
||||
|
||||
// Override the endpoint URL for each subclass
|
||||
String URL = "";
|
||||
String get URL => "";
|
||||
|
||||
// Override the web URL for each subclass
|
||||
// Note: If the WEB_URL is the same (except for /api/) as URL then just leave blank
|
||||
|
@ -14,7 +14,7 @@ class InvenTreePartCategory extends InvenTreeModel {
|
||||
String NAME = "PartCategory";
|
||||
|
||||
@override
|
||||
String URL = "part/category/";
|
||||
String get URL => "part/category/";
|
||||
|
||||
@override
|
||||
Map<String, String> defaultListFilters() {
|
||||
@ -68,7 +68,7 @@ class InvenTreePartTestTemplate extends InvenTreeModel {
|
||||
String NAME = "PartTestTemplate";
|
||||
|
||||
@override
|
||||
String URL = "part/test-template/";
|
||||
String get URL => "part/test-template/";
|
||||
|
||||
String get key => jsondata['key'] ?? '';
|
||||
|
||||
@ -125,7 +125,7 @@ class InvenTreePart extends InvenTreeModel {
|
||||
String NAME = "Part";
|
||||
|
||||
@override
|
||||
String URL = "part/";
|
||||
String get URL => "part/";
|
||||
|
||||
@override
|
||||
Map<String, String> defaultListFilters() {
|
||||
|
@ -18,7 +18,7 @@ class InvenTreeStockItemTestResult extends InvenTreeModel {
|
||||
String NAME = "StockItemTestResult";
|
||||
|
||||
@override
|
||||
String URL = "stock/test/";
|
||||
String get URL => "stock/test/";
|
||||
|
||||
String get key => jsondata['key'] ?? '';
|
||||
|
||||
@ -103,7 +103,7 @@ class InvenTreeStockItem extends InvenTreeModel {
|
||||
String NAME = "StockItem";
|
||||
|
||||
@override
|
||||
String URL = "stock/";
|
||||
String get URL => "stock/";
|
||||
|
||||
@override
|
||||
String WEB_URL = "stock/item/";
|
||||
@ -540,7 +540,7 @@ class InvenTreeStockLocation extends InvenTreeModel {
|
||||
String NAME = "StockLocation";
|
||||
|
||||
@override
|
||||
String URL = "stock/location/";
|
||||
String get URL => "stock/location/";
|
||||
|
||||
String get pathstring => jsondata['pathstring'] ?? '';
|
||||
|
||||
|
2
lib/l10n
2
lib/l10n
@ -1 +1 @@
|
||||
Subproject commit 3a2f1660fd5a93304272180b25340d04ba0e81aa
|
||||
Subproject commit dd16aa783769f261d73cb42ea70a831ddde04086
|
@ -43,27 +43,6 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
||||
|
||||
List<Widget> actions = [];
|
||||
|
||||
/*
|
||||
actions.add(
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.search),
|
||||
onPressed: () {
|
||||
|
||||
Map<String, String> filters = {};
|
||||
|
||||
if (category != null) {
|
||||
filters["category"] = "${category.pk}";
|
||||
}
|
||||
|
||||
showSearch(
|
||||
context: context,
|
||||
delegate: PartSearchDelegate(context, filters: filters)
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
*/
|
||||
|
||||
if ((category != null) && InvenTreeAPI().checkPermission('part_category', 'change')) {
|
||||
actions.add(
|
||||
IconButton(
|
||||
@ -206,12 +185,10 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
||||
label: L10().parts,
|
||||
),
|
||||
// TODO - Add the "actions" item back in
|
||||
/*
|
||||
BottomNavigationBarItem(
|
||||
icon: FaIcon(FontAwesomeIcons.wrench),
|
||||
label: L10().actions
|
||||
),
|
||||
*/
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -469,12 +469,10 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
label: L10().stock
|
||||
),
|
||||
// TODO - Add part actions
|
||||
/*
|
||||
BottomNavigationBarItem(
|
||||
icon: FaIcon(FontAwesomeIcons.wrench),
|
||||
label: L10().actions,
|
||||
),
|
||||
*/
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user