From e71cc91c324a71ff79264c60f04b90c82bd422c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Mendes?= Date: Tue, 28 Jul 2020 10:04:49 +0100 Subject: [PATCH] commit updates --- .../EditProfileCardProperty.tsx | 8 +++----- .../ListCommandBar/ListCommandBar.tsx | 17 +++++++---------- .../src/hooks/useGetOrganizationInfo.ts | 1 - 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/samples/react-manage-profile-card-properties/src/components/EditProfileCardProperty/EditProfileCardProperty.tsx b/samples/react-manage-profile-card-properties/src/components/EditProfileCardProperty/EditProfileCardProperty.tsx index 5b3391835..1aaddea0d 100644 --- a/samples/react-manage-profile-card-properties/src/components/EditProfileCardProperty/EditProfileCardProperty.tsx +++ b/samples/react-manage-profile-card-properties/src/components/EditProfileCardProperty/EditProfileCardProperty.tsx @@ -36,7 +36,7 @@ import { ILocalizationExtended } from "../../Entities/IlocalizationExtended"; import strings from "ManageProfileCardPropertiesWebPartStrings"; // Component -// Add Profile Property Component +// Edit Profile Property Component export const EditProfileCardProperty: React.FunctionComponent = ( props: IEditProfileCardPropertyProps @@ -278,7 +278,7 @@ export const EditProfileCardProperty: React.FunctionComponent = ( props: IListCommandBarProps ) => { + const _applicationContext = React.useContext(AppContext); const {} = _applicationContext; const { selectedItem } = props; @@ -25,13 +26,17 @@ export const ListCommandBar: React.FunctionComponent = ( let _disableDelete: boolean = true; let _disableView: boolean = true; + if (selectedItem) { _disableEdit = false; _disableDelete = false; _disableView = false; } + + // useEffect(() => {}); + // On clear Search const _onClear = () => { let _searchCondition: string = ""; props.onSearch(_searchCondition); @@ -41,6 +46,7 @@ export const ListCommandBar: React.FunctionComponent = ( props.onSearch(value); }; + // CommandBar Options const _items: ICommandBarItemProps[] = [ { key: "newItem", @@ -72,7 +78,7 @@ export const ListCommandBar: React.FunctionComponent = ( onClick: () => props.onActionSelected("Delete"), }, ]; - +// FarItems const _farItems: ICommandBarItemProps[] = [ { key: "search", @@ -99,15 +105,6 @@ export const ListCommandBar: React.FunctionComponent = ( iconProps: { iconName: "Refresh" }, onClick: () => props.onActionSelected("Refresh"), }, - /* { - key: "filter", - text: "Filter", - // This needs an ariaLabel since it's icon-only - ariaLabel: "filter", - iconOnly: true, - iconProps: { iconName: "Filter" }, - onClick: () => console.log("Info"), - }, */ ]; return ( diff --git a/samples/react-manage-profile-card-properties/src/hooks/useGetOrganizationInfo.ts b/samples/react-manage-profile-card-properties/src/hooks/useGetOrganizationInfo.ts index cacb249b4..5951951d6 100644 --- a/samples/react-manage-profile-card-properties/src/hooks/useGetOrganizationInfo.ts +++ b/samples/react-manage-profile-card-properties/src/hooks/useGetOrganizationInfo.ts @@ -7,6 +7,5 @@ export const useGetOrganization = async (msGraphClient: MSGraphClient):Promise