import { runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions';
import { getUserUuid } from '~/common/getuser';
import { matchProjectRoute } from '~/routes/routes';
-import { GroupResource } from '~/models/group';
+import { GroupClass, GroupResource } from '~/models/group';
import { ResourcesState, getResource } from '~/store/resources/resources';
import { extractUuidKind, ResourceKind } from '~/models/resource';
horizontal: 0
};
-const isProjectTrashed = (proj: GroupResource, resources: ResourcesState): boolean => {
+export const isProjectTrashed = (proj: GroupResource | undefined, resources: ResourcesState): boolean => {
+ if (proj === undefined) { return false; }
if (proj.isTrashed) { return true; }
if (extractUuidKind(proj.ownerUuid) === ResourceKind.USER) { return false; }
const parentProj = getResource<GroupResource>(proj.ownerUuid)(resources);
- return isProjectTrashed(parentProj!, resources);
+ return isProjectTrashed(parentProj, resources);
};
export const SidePanelButton = withStyles(styles)(
const currentProject = getResource<GroupResource>(currentItemId)(resources);
if (currentProject &&
currentProject.writableBy.indexOf(currentUserUUID || '') >= 0 &&
- !isProjectTrashed(currentProject, resources)) {
+ !isProjectTrashed(currentProject, resources) &&
+ currentProject.groupClass !== GroupClass.FILTER) {
enabled = true;
}
}
}
}
)
-);
\ No newline at end of file
+);