Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19 create the button that will content the link #20

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ISPServices } from "./SPServices/ISPServices";
import { spservices } from "./SPServices/spservices";
import { PersonaCard } from "./PersonaCard/PersonaCard";
import Paging from "./Pagination/Paging";
import { UserBase } from "@pnp/sp/src/siteusers";

const wrapStackTokens: IStackTokens = { childrenGap: 30 };

Expand Down Expand Up @@ -120,13 +121,15 @@ const DirectoryHook: React.FC<IReactDirectoryProps> = (props) => {
context={props.context}
prefLang={props.prefLang}
profileProperties={{
DisplayName: user.PreferredName,
DisplayName:
user.FirstName && user.LastName ? `${user.FirstName} ${user.LastName}` : user.PreferredName,
Title: user.JobTitle,
PictureUrl: user.PictureURL,
Email: user.WorkEmail,
Department: user.Department,
WorkPhone: user.WorkPhone,
Location: user.OfficeNumber ? user.OfficeNumber : user.BaseOfficeLocation,
UserID: "priyamvada.singh_tbs-sct.gc.ca#EXT#@gcxgce.onmicrosoft.com",
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
export interface IUserProperties {
Department: string;
MobilePhone?: string;
PictureUrl: string;
PictureUrl?: string;
Title: string;
DisplayName: string;
Email: string;
WorkPhone?: string;
Location?: string;
UserID: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,16 @@ export class PersonaCard extends React.Component<IPersonaCardProps, IPersonaCard
</Stack.Item>
<Stack.Item align="center" styles={stackItemStyles}>
<PrimaryButton href={`mailto: ${this.props.profileProperties.Email}`}>
<Icon iconName="PublicEmail" style={{ verticalAlign: "sub", marginRight: 5 }} />
{strings.SendEmailLabel}
</PrimaryButton>
<PrimaryButton
style={{ marginLeft: 50 }}
href={`https://teams.microsoft.com/l/chat/0/0?users=${this.props.profileProperties.Email}`}
target="_blank"
>
<Icon iconName="Chat" style={{ verticalAlign: "sub", marginRight: 5 }} /> {strings.StartChatLabel}
</PrimaryButton>
</Stack.Item>
</Stack>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export class spservices implements ISPServices {
"BaseOfficeLocation",
"SPS-UserType",
"GroupId",
"UserPrincipalName",
];
try {
let users = await sp.search(<SearchQuery>{
Querytext: qrytext,
StartRow: startItem,
RowLimit: endItem,
EnableInterleaving: true,
// EnableInterleaving: true,
SelectProperties: searchProperties,
SourceId: "b09a7990-05ea-4af9-81ef-edfab16c4e31",
SortList: [{ Property: "FirstName", Direction: SortDirection.Ascending }],
Expand Down
3 changes: 2 additions & 1 deletion src/webparts/spfxReactDirectoryWebpart/loc/en-us.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define([], function () {
return {
SearchPlaceHolder: "Search by last name",
SearchPlaceHolder: "Search by last name id",
PropertyPaneDescription: "Search People from Organization Directory",
BasicGroupName: "Properties",
TitleFieldLabel: "Web Part Title",
Expand All @@ -11,6 +11,7 @@ define([], function () {
SearchBoxLabel: "Search for a colleague (Last Name)",
SearchButtonLabel: "Search",
SendEmailLabel: "Send Email",
StartChatLabel: "Start Chat",
NoUserFoundLabelText: "Invite a colleague",
NoUserFoundImageAltText: "A hiding yeti",
NoUserFoundEmail:
Expand Down
1 change: 1 addition & 0 deletions src/webparts/spfxReactDirectoryWebpart/loc/fr-fr.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/webparts/spfxReactDirectoryWebpart/loc/mystrings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ declare interface ISpfxReactDirectoryWebpartWebPartStrings {
AppTeamsTabEnvironment: string;
AppOfficeEnvironment: string;
AppOutlookEnvironment: string;

SearchPlaceHolder: string;
PropertyPaneDescription: string;
BasicGroupName: string;
Expand All @@ -21,16 +20,17 @@ declare interface ISpfxReactDirectoryWebpartWebPartStrings {
LoadingText: string;
SearchBoxLabel: string;
SendEmailLabel: string;
StartChatLabel: string;
NoUserFoundLabelText: string;
NoUserFoundImageAltText: string;
NoUserFoundEmailSubject: string;
NoUserFoundEmailBody: string;
NoUserFoundEmail: string;

SearchButtonLabel:String;
SearchButtonLabel: String;
}

declare module 'SpfxReactDirectoryWebpartWebPartStrings' {
declare module "SpfxReactDirectoryWebpartWebPartStrings" {
const strings: ISpfxReactDirectoryWebpartWebPartStrings;
export = strings;
}