Skip to content

Commit

Permalink
fix: remove agenda tooltip (#2621)
Browse files Browse the repository at this point in the history
removed tooltip
  • Loading branch information
gavinbarron authored Jul 28, 2023
1 parent a0ce2f4 commit 27e1fc9
Showing 1 changed file with 10 additions and 40 deletions.
50 changes: 10 additions & 40 deletions packages/mgt-components/src/components/mgt-agenda/mgt-agenda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,17 @@
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
import { html, TemplateResult } from 'lit';
import { property } from 'lit/decorators.js';
import {
Providers,
ProviderState,
MgtTemplatedComponent,
prepScopes,
mgtHtml,
customElement,
CollectionResponse
} from '@microsoft/mgt-element';
import { Providers, ProviderState, MgtTemplatedComponent, mgtHtml, customElement } from '@microsoft/mgt-element';
import '../../styles/style-helper';
import '../mgt-person/mgt-person';
import { styles } from './mgt-agenda-css';
import { getEventsPageIterator, getEventsQueryPageIterator } from './mgt-agenda.graph';
import { SvgIcon, getSvg } from '../../utils/SvgHelper';
import { MgtPeople } from '../mgt-people/mgt-people';
import { registerFluentComponents } from '../../utils/FluentComponents';
import { fluentCard, fluentTooltip } from '@fluentui/web-components';
import { fluentCard } from '@fluentui/web-components';
import { classMap } from 'lit/directives/class-map.js';
registerFluentComponents(fluentCard, fluentTooltip);
registerFluentComponents(fluentCard);

/**
* Web Component which represents events in a user or group calendar.
Expand Down Expand Up @@ -407,38 +399,16 @@ export class MgtAgenda extends MgtTemplatedComponent {
* @memberof MgtAgenda
*/
protected renderTitle(event: MicrosoftGraph.Event): TemplateResult {
let eventDescription = event?.bodyPreview ? event.bodyPreview.slice(0, 100) : '';
const hasDescription = eventDescription !== '';

const eventSubjectClasses = {
'event-subject': true,
narrow: this._isNarrow
};

eventDescription = eventDescription.split(' ').slice(0, -1).join(' ') + '...';

const hasDescriptionDiv = html`
<div
aria-describedby="tooltip-${event.id}"
class="${classMap(eventSubjectClasses)}"
id=${event.id}>
${event.subject}
</div>
<fluent-tooltip
id="tooltip-${event.id}"
position="right"
anchor="${event.id}">
${eventDescription}
</fluent-tooltip>
`;

const noDescriptionDiv = html`
return html`
<div
aria-label=${event.subject}
class="${classMap(eventSubjectClasses)}">
${event.subject}
class="${classMap({
'event-subject': true,
narrow: this._isNarrow
})}"
>
${event.subject}
</div>`;
return hasDescription ? hasDescriptionDiv : noDescriptionDiv;
}

/**
Expand Down

0 comments on commit 27e1fc9

Please sign in to comment.