Skip to content

Commit

Permalink
Move owner to child
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed May 13, 2021
1 parent 12ac71d commit 9973648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions x-pack/plugins/cases/public/components/recent_cases/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { RecentCasesFilters } from './filters';
import { RecentCasesComp } from './recent_cases';
import { FilterMode as RecentCasesFilterMode } from './types';
import { useCurrentUser } from '../../common/lib/kibana';
import { useOwnerContext } from '../owner_context/use_owner_context';

export interface RecentCasesProps {
allCasesNavigation: CasesNavigation;
Expand All @@ -29,7 +28,6 @@ const RecentCases = ({
createCaseNavigation,
maxCasesToShow,
}: RecentCasesProps) => {
const owner = useOwnerContext();
const currentUser = useCurrentUser();
const [recentCasesFilterBy, setRecentCasesFilterBy] = useState<RecentCasesFilterMode>(
'recentlyCreated'
Expand Down Expand Up @@ -76,7 +74,6 @@ const RecentCases = ({
createCaseNavigation={createCaseNavigation}
filterOptions={recentCasesFilterOptions}
maxCasesToShow={maxCasesToShow}
owner={owner}
/>
<EuiHorizontalRule margin="s" />
<EuiText size="xs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { NoCases } from './no_cases';
import { isSubCase } from '../all_cases/helpers';
import { MarkdownRenderer } from '../markdown_editor';
import { FilterOptions } from '../../containers/types';
import { useOwnerContext } from '../owner_context/use_owner_context';

const MarkdownContainer = styled.div`
max-height: 150px;
Expand All @@ -31,8 +32,8 @@ export interface RecentCasesProps {
caseDetailsNavigation: CasesNavigation<CaseDetailsHrefSchema, 'configurable'>;
createCaseNavigation: CasesNavigation;
maxCasesToShow: number;
owner: string[];
}

const usePrevious = (value: Partial<FilterOptions>) => {
const ref = useRef();
useEffect(() => {
Expand All @@ -45,8 +46,8 @@ export const RecentCasesComp = ({
createCaseNavigation,
filterOptions,
maxCasesToShow,
owner,
}: RecentCasesProps) => {
const owner = useOwnerContext();
const previousFilterOptions = usePrevious(filterOptions);
const { data, loading, setFilters } = useGetCases({
initialQueryParams: { perPage: maxCasesToShow },
Expand Down

0 comments on commit 9973648

Please sign in to comment.