Skip to content

Implement Texera User Avatars Featuer - #1373

Merged
Yicong-Huang merged 19 commits into
masterfrom
zhen-user-avatar
Mar 2, 2022
Merged

Yicong-Huang merged 19 commits into
masterfrom
zhen-user-avatar

Conversation

@Zhen-Guan

@Zhen-Guan Zhen-Guan commented Nov 19, 2021 •

Copy link
Copy Markdown
Contributor

This PR creates an Angular component to show the avatar of a Texera user.

The library/component ngx-avatar does not support retrieving Google users' avatars by Google ID (HaithemMosbahi/ngx-avatar#51), so I implemented the logic to retrieve Google users' avatars myself in the component.

In order to send requests to Google People API, a public key is needed to provide.
Creating a Google API Public Key is easy, please follow this instruction.
https://developers.google.com/maps/documentation/maps-static/get-api-key

Then fill the public key in the environment.default.ts
google: { clientID: "", publicKey: "", },

Demo:
If the user is a normal Texera user, the avatar will be the default avatar with a random background color.
normal user

If the user is a Google user, the avatar will be its Google profile picture.
google user

@Zhen-Guan Zhen-Guan self-assigned this Nov 19, 2021
@Zhen-Guan
Zhen-Guan marked this pull request as ready for review November 20, 2021 13:28

@Yicong-Huang Yicong-Huang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. left some minor comments.

@Xiao-zhen-Liu

Copy link
Copy Markdown
Contributor

Group discussion 1/11: @Yicong-Huang will merge this PR soon

@Yicong-Huang
Yicong-Huang merged commit 363f683 into master Mar 2, 2022
@Yicong-Huang
Yicong-Huang deleted the zhen-user-avatar branch March 2, 2022 09:25
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
This PR creates an Angular component to show the avatar of a Texera user.

The library/component **ngx-avatar** does not support retrieving Google users' avatars by Google ID (HaithemMosbahi/ngx-avatar#51), so I implemented the logic to retrieve Google users' avatars myself in the component. 

In order to send requests to Google People API, a public key is needed to provide. 
Creating a Google API Public Key is easy, please follow this instruction.
https://developers.google.com/maps/documentation/maps-static/get-api-key

Then fill the public key in the **environment.default.ts**
`google: {
    clientID: "",
    publicKey: "",
  },`

Demo: 
If the user is a normal Texera user, the avatar will be the default avatar with a random background color.
![normal user](https://user-images.githubusercontent.com/52941906/142727712-691254e9-d4ae-48f9-b70b-8a46bde91e54.gif)


If the user is a Google user, the avatar will be its Google profile picture. 
![google user](https://user-images.githubusercontent.com/52941906/142727715-3fc6e839-e33c-4405-9813-389cb573a152.gif)

Co-authored-by: Yicong Huang <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 24, 2026
### What changes were proposed in this PR?

Deletes `frontend/src/app/dashboard/type/google-api-response.ts`, a type
file nothing imports. **−43 lines.** There is no behaviour change.

The file exports `GooglePeopleApiResponse` and its nested `Source`,
`Metadata` and `Photo` types. No code, spec, barrel file or path alias
references the file or any of them, and no open PR adds an import.

### History

| | |
| --- | --- |
| **Introduced by** | apache#1373 (2022-03-02), "Implement Texera User Avatars
Featuer", whose user-avatar component called the Google People API |
| **Usage removed by** | apache#2457 (2024-03-07), "Fix Google Avatar
Display". It removed that call and the import |

It has been unused for over two and a half years.

### Any related issues, documentation, discussions?

Closes apache#9085

### How was this PR tested?

No new tests; nothing referenced the file.

From `frontend/`:

- `npx tsc --noEmit -p src/tsconfig.app.json` and `-p
src/tsconfig.spec.json`: clean.
- `yarn format:ci`: clean.
- `npx ng build`: success.

To re-check:

```
git grep -n -i -e GooglePeopleApiResponse -e google-api-response   # no hits
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants