Projects
This commit is contained in:
parent
251617d0d7
commit
eb78346dc1
|
|
@ -36,14 +36,18 @@ List<int> filteredProjectsSelector(
|
||||||
BuiltMap<int, ClientEntity> clientMap) {
|
BuiltMap<int, ClientEntity> clientMap) {
|
||||||
final list = projectList.where((projectId) {
|
final list = projectList.where((projectId) {
|
||||||
final project = projectMap[projectId];
|
final project = projectMap[projectId];
|
||||||
|
final client = clientMap[project.clientId] ?? ClientEntity(id: project.clientId);
|
||||||
if (project.clientId > 0 && clientMap[project.clientId].isArchived) {
|
if (client == null || !client.isActive) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!project.matchesStates(projectListState.stateFilters)) {
|
if (!project.matchesStates(projectListState.stateFilters)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (projectListState.filterEntityId != null &&
|
||||||
|
project.clientId != projectListState.filterEntityId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (projectListState.custom1Filters.isNotEmpty &&
|
if (projectListState.custom1Filters.isNotEmpty &&
|
||||||
!projectListState.custom1Filters.contains(project.customValue1)) {
|
!projectListState.custom1Filters.contains(project.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ List<int> filteredStubsSelector(BuiltMap<int, StubEntity> stubMap,
|
||||||
if (!stub.matchesStates(stubListState.stateFilters)) {
|
if (!stub.matchesStates(stubListState.stateFilters)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (stubListState.filterEntityId != null &&
|
||||||
|
stub.clientId != stubListState.filterEntityId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (stubListState.custom1Filters.isNotEmpty &&
|
if (stubListState.custom1Filters.isNotEmpty &&
|
||||||
!stubListState.custom1Filters.contains(stub.customValue1)) {
|
!stubListState.custom1Filters.contains(stub.customValue1)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue