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

feature: Update teams-channel-picker to fluent UI designs #1805

Merged
merged 49 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
81499f0
update: Set rtl and images for fluent UI look
musale Aug 15, 2022
61f7151
Merge branch 'next/fluentui' of github.com:microsoftgraph/microsoft-g…
musale Aug 22, 2022
ca344ca
Merge branch 'next/fluentui' of github.com:microsoftgraph/microsoft-g…
musale Aug 31, 2022
675e17f
update: Make card height wrap around the content
musale Sep 1, 2022
35cd885
update: Make searched channels expand in dropdown
musale Sep 1, 2022
dd37e34
refactor: Remove deprecated even.keyCode for event.code
musale Sep 1, 2022
efea9bc
Merge branch 'next/fluentui' of github.com:microsoftgraph/microsoft-g…
musale Sep 2, 2022
006e2d0
Merge branch 'next/fluentui' of github.com:microsoftgraph/microsoft-g…
musale Sep 26, 2022
fc7d28f
fix: Apply auto card height on the fluent-card
musale Sep 26, 2022
4aa9dee
fix: Set render direction to ltr by default and auto height card
musale Sep 26, 2022
9db6970
update: set the dir attribute at the top most part of the element
musale Oct 14, 2022
4de5ee0
update: Change the usage of fluentui components
musale Oct 17, 2022
74872e2
update: Set card width
musale Oct 17, 2022
77b06d7
update: Set the width to 368px
musale Oct 21, 2022
ae37b8e
update: Handle enter keypress on channel
musale Oct 21, 2022
6971b17
Merge branch 'next/fluentui' of github.com:microsoftgraph/microsoft-g…
musale Nov 17, 2022
3c5efbe
fix: use min-width to allow growth of element when txt is long
musale Jan 17, 2023
55a78a6
fix: flexible width for the dropdown and selected values
musale Jan 17, 2023
c82db8c
fix: hide the dropdown on losing component focus
musale Jan 17, 2023
502ebe9
fix: change the loading component props to align with main component
musale Jan 17, 2023
137941b
Merge branch 'musale/fluentui/teams-channel-picker' of github.com:mic…
musale Jan 24, 2023
947371a
refactor: remove unused code
musale Jan 31, 2023
40cab85
Merge branch 'next/fluentui' into musale/fluentui/teams-channel-picker
musale Jan 31, 2023
161de47
Merge branch 'next/fluentui' into musale/fluentui/teams-channel-picker
musale Feb 7, 2023
d4f23e7
fix: format fixes and new lock file
musale Feb 7, 2023
84f3680
fix: disable input on selecting a channel
musale Feb 7, 2023
528b52d
fix: toggle the chevrons and close btn correctly
musale Feb 7, 2023
6b4ea5c
fix: set a fixed width and resize selected channel img
musale Feb 7, 2023
5fdf671
fix: truncate selected team or channel to fit the width
musale Feb 7, 2023
51d8531
fix: test the fluent component in spinner
musale Feb 7, 2023
5a84bf1
Merge branch 'next/fluentui' into musale/fluentui/teams-channel-picker
musale Feb 13, 2023
1adda79
Merge branch 'musale/fluentui/teams-channel-picker' of github.com:mic…
musale Feb 13, 2023
5574e08
fix: custom event detail should be an obj in an array
musale Feb 13, 2023
8babdba
fix: mark a channel selected by ID as highlighted in the DOM
musale Feb 13, 2023
5aa6b86
fix: remove the click event on the team tree-item
musale Feb 13, 2023
c04556d
fix: remove highlight on clicking a team name
musale Feb 14, 2023
fa70ae4
fix: stop showing the previously selected channel
musale Feb 14, 2023
6850658
fix: use the width of the container element
musale Feb 14, 2023
f528e07
fix: remove manual ellipsizing based on width
musale Feb 14, 2023
2150fa5
fix: failing build issues and update the lock file
musale Feb 14, 2023
e38b48a
fix: selectionChanged evt to emit correct type
musale Feb 14, 2023
d801658
Merge branch 'next/fluentui' of github.com:microsoftgraph/microsoft-g…
musale Feb 14, 2023
19339d7
feat: add theme management tools (#2037)
gavinbarron Feb 15, 2023
0fb8f65
fix: set the search icon to be on the same level with the input field…
musale Feb 15, 2023
ab11850
fix: update the yarn.lock file
musale Feb 21, 2023
7de78a2
Merge branch 'next/fluentui' into musale/fluentui/teams-channel-picker
musale Feb 21, 2023
11634ef
fix: remove end slot on selected team
musale Feb 23, 2023
fdf2072
Merge branch 'next/fluentui' into musale/fluentui/teams-channel-picker
musale Feb 23, 2023
c9d4148
Merge branch 'musale/fluentui/teams-channel-picker' of github.com:mic…
musale Feb 23, 2023
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 @@ -5,8 +5,15 @@
* -------------------------------------------------------------------------------------------
*/

import { IGraph, prepScopes } from '@microsoft/mgt-element';
import { IGraph, BetaGraph, CacheItem, CacheService, CacheStore } from '@microsoft/mgt-element';
import { Team } from '@microsoft/microsoft-graph-types';
import {
getPhotoForResource,
CachePhoto,
getPhotoInvalidationTime,
getIsPhotosCacheEnabled
} from '../../graph/graph.photos';
import { schemas } from '../../graph/cacheStores';

/**
* async promise, returns all Teams associated with the user logged in
Expand All @@ -15,11 +22,46 @@ import { Team } from '@microsoft/microsoft-graph-types';
* @memberof Graph
*/
export async function getAllMyTeams(graph: IGraph): Promise<Team[]> {
const scopes = 'team.readbasic.all';
const teams = await graph
.api('/me/joinedTeams')
.select(['displayName', 'id', 'isArchived'])
.middlewareOptions(prepScopes(scopes))
.get();
const teams = await graph.api('/me/joinedTeams').select(['displayName', 'id', 'isArchived']).get();
return teams ? teams.value : null;
}

/** An object collection of cached photos. */
type CachePhotos = {
[key: string]: CachePhoto;
};

export async function getTeamsPhotosforPhotoIds(graph: BetaGraph, teamIds: string[]): Promise<CachePhotos> {
let cache: CacheStore<CachePhoto>;
let photos: CachePhotos = {};

if (getIsPhotosCacheEnabled()) {
cache = CacheService.getCache<CachePhoto>(schemas.photos, schemas.photos.stores.teams);
for (const id of teamIds) {
try {
const photoDetail = await cache.getValue(id);
if (photoDetail && getPhotoInvalidationTime() > Date.now() - photoDetail.timeCached) {
photos[id] = photoDetail;
}
} catch (_) {}
}
if (Object.keys(photos).length) {
return photos;
}
}

let scopes = ['team.readbasic.all'];
photos = {};

for (const id of teamIds) {
try {
const photoDetail = await getPhotoForResource(graph, `/teams/${id}`, scopes);
if (getIsPhotosCacheEnabled() && photoDetail) {
cache.putValue(id, photoDetail);
}
photos[id] = photoDetail;
} catch (_) {}
}

return photos;
}
Loading