Skip to content

Commit e987922

Browse files
committed
Merge branch 'next/wc-registration' into next/wc-registration-samples
2 parents 29dc0f9 + 38d8b01 commit e987922

File tree

4 files changed

+71
-55
lines changed

4 files changed

+71
-55
lines changed

packages/mgt-components/src/components/mgt-person-card/mgt-person-card.ts

Lines changed: 56 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,15 @@ export class MgtPersonCard extends MgtTemplatedComponent {
510510
? html`<div @keydown=${this.handleEndOfCard} aria-label=${this.strings.endOfCard} tabindex="0" id="end-of-container"></div>`
511511
: html``;
512512
return html`
513-
<div class="root" dir=${this.direction}>
514-
<div class=${this._smallView ? 'small' : ''}>
515-
${navigationTemplate}
516-
${closeCardTemplate}
517-
<div class="person-details-container">${personDetailsTemplate}</div>
518-
<div class="expanded-details-container">${expandedDetailsTemplate}</div>
519-
${tabLocker}
520-
</div>
521-
</div>
513+
<div class="root" dir=${this.direction}>
514+
<div class=${this._smallView ? 'small' : ''}>
515+
${navigationTemplate}
516+
${closeCardTemplate}
517+
<div class="person-details-container">${personDetailsTemplate}</div>
518+
<div class="expanded-details-container">${expandedDetailsTemplate}</div>
519+
${tabLocker}
520+
</div>
521+
</div>
522522
`;
523523
}
524524

@@ -685,13 +685,14 @@ export class MgtPersonCard extends MgtTemplatedComponent {
685685
*/
686686
protected renderExpandedDetailsButton(): TemplateResult {
687687
return html`
688-
<div
688+
<div
689689
class="expanded-details-button"
690690
@click=${this.showExpandedDetails}
691691
@keydown=${this.handleKeyDown}
692-
tabindex=0>
693-
${getSvg(SvgIcon.ExpandDown)}
694-
</div>
692+
tabindex=0
693+
>
694+
${getSvg(SvgIcon.ExpandDown)}
695+
</div>
695696
`;
696697
}
697698

@@ -729,8 +730,8 @@ export class MgtPersonCard extends MgtTemplatedComponent {
729730
<div
730731
class="section-host ${this._smallView ? 'small' : ''} ${this._smallView ? 'small' : ''}"
731732
@wheel=${(e: WheelEvent) => this.handleSectionScroll(e)}
732-
tabindex=0>
733-
</div>
733+
tabindex=0
734+
></div>
734735
`;
735736
}
736737

@@ -770,10 +771,10 @@ export class MgtPersonCard extends MgtTemplatedComponent {
770771

771772
const additionalPanelTemplates = this.sections.map((section, i) => {
772773
return html`
773-
<fluent-tab-panel slot="tabpanel">
774-
<div class="inserted">${this._currentSection ? section.asFullView() : null}</div>
775-
</fluent-tab-panel>
776-
`;
774+
<fluent-tab-panel slot="tabpanel">
775+
<div class="inserted">${this._currentSection ? section.asFullView() : null}</div>
776+
</fluent-tab-panel>
777+
`;
777778
});
778779

779780
const overviewClasses = classMap({
@@ -783,19 +784,26 @@ export class MgtPersonCard extends MgtTemplatedComponent {
783784
});
784785

785786
return html`
786-
<fluent-tabs orientation="horizontal" activeindicator @wheel=${(e: WheelEvent) =>
787-
this.handleSectionScroll(e)}>
788-
<fluent-tab class="${overviewClasses}" slot="tab" @keyup="${() =>
789-
this.updateCurrentSection(null)}" @click=${() => this.updateCurrentSection(null)}>
790-
<div>${getSvg(SvgIcon.Overview)}</div>
791-
</fluent-tab>
792-
${additionalSectionTemplates}
793-
<fluent-tab-panel slot="tabpanel" >
794-
<div class="overview-panel">${!this._currentSection ? this.renderOverviewSection() : null}</div>
795-
</fluent-tab-panel>
796-
${additionalPanelTemplates}
797-
</fluent-tabs>
798-
`;
787+
<fluent-tabs
788+
orientation="horizontal"
789+
activeindicator
790+
@wheel=${(e: WheelEvent) => this.handleSectionScroll(e)}
791+
>
792+
<fluent-tab
793+
class="${overviewClasses}"
794+
slot="tab"
795+
@keyup="${() => this.updateCurrentSection(null)}"
796+
@click=${() => this.updateCurrentSection(null)}
797+
>
798+
<div>${getSvg(SvgIcon.Overview)}</div>
799+
</fluent-tab>
800+
${additionalSectionTemplates}
801+
<fluent-tab-panel slot="tabpanel" >
802+
<div class="overview-panel">${!this._currentSection ? this.renderOverviewSection() : null}</div>
803+
</fluent-tab-panel>
804+
${additionalPanelTemplates}
805+
</fluent-tabs>
806+
`;
799807
}
800808

801809
/**
@@ -808,17 +816,20 @@ export class MgtPersonCard extends MgtTemplatedComponent {
808816
protected renderOverviewSection(): TemplateResult {
809817
const compactTemplates = this.sections.map(
810818
(section: BasePersonCardSection) => html`
811-
<div class="section">
812-
<div class="section__header">
813-
<div class="section__title" tabindex=0>${section.displayName}</div>
814-
<fluent-button appearance="lightweight" class="section__show-more" @click=${() =>
815-
this.updateCurrentSection(section)}>
816-
${this.strings.showMoreSectionButton}
817-
</fluent-button>
818-
</div>
819-
<div class="section__content">${section.asCompactView()}</div>
820-
</div>
821-
`
819+
<div class="section">
820+
<div class="section__header">
821+
<div class="section__title" tabindex=0>${section.displayName}</div>
822+
<fluent-button
823+
appearance="lightweight"
824+
class="section__show-more"
825+
@click=${() => this.updateCurrentSection(section)}
826+
>
827+
${this.strings.showMoreSectionButton}
828+
</fluent-button>
829+
</div>
830+
<div class="section__content">${section.asCompactView()}</div>
831+
</div>
832+
`
822833
);
823834

824835
const additionalDetails = this.renderTemplate('additional-details', {
@@ -1214,8 +1225,8 @@ export class MgtPersonCard extends MgtTemplatedComponent {
12141225
call: false
12151226
};
12161227

1217-
private setHoveredState = (icon: string, state: boolean) => {
1218-
this.hoverStates[icon] = state;
1228+
private setHoveredState = (icon: string, hoverState: boolean) => {
1229+
this.hoverStates[icon] = hoverState;
12191230
this.hoverStates = { ...this.hoverStates };
12201231
};
12211232

packages/mgt-components/src/components/mgt-person-card/sections/mgt-person-card-organization/mgt-person-card-organization.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,19 @@ export class MgtPersonCardOrganization extends BasePersonCardSection {
280280
<div class="direct-report__compact">
281281
${directReports.slice(0, 6).map(
282282
person => mgtHtml`
283-
<div class="direct-report" @keydown=${(e: KeyboardEvent) => {
284-
e.code === 'Enter' ? this.navigateCard(person) : '';
285-
}} @click=${() => this.navigateCard(person)} @keydown=${(e: KeyboardEvent) => {
286-
e.code === 'Enter' ? this.navigateCard(person) : '';
287-
}}>
288-
<mgt-person .personDetails=${person} .fetchImage=${true} .showPresence=${true} .view=${
289-
ViewType.twolines
290-
}></mgt-person>
283+
<div
284+
class="direct-report"
285+
@keydown=${(e: KeyboardEvent) => {
286+
e.code === 'Enter' ? this.navigateCard(person) : '';
287+
}}
288+
@click=${() => this.navigateCard(person)}
289+
>
290+
<mgt-person
291+
.personDetails=${person}
292+
.fetchImage=${true}
293+
.showPresence=${true}
294+
.view=${ViewType.twolines}
295+
></mgt-person>
291296
</div>
292297
`
293298
)}

packages/mgt-components/src/graph/graph.userWithPhoto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function getUserWithPhoto(
7575
}
7676
} catch (e) {
7777
//if 404 received (photo not found) but user already in cache, update timeCache value to prevent repeated 404 error / graph calls on each page refresh
78-
if (e.code === 'ErrorItemNotFound') {
78+
if (e.code === 'ErrorItemNotFound' || e.code === 'ImageNotFound') {
7979
storePhotoInCache(userId || 'me', schemas.photos.stores.users, { eTag: null, photo: null });
8080
}
8181
}

packages/mgt-spfx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/mgt-spfx",
3-
"version": "2.0.3",
3+
"version": "3.0.0",
44
"description": "SharePoint Framework library for Microsoft Graph Toolkit",
55
"main": "lib/index.js",
66
"keywords": [

0 commit comments

Comments
 (0)