Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added entityName property#762

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
A-Vamshi wants to merge8 commits intostack-auth:dev
base:dev
Choose a base branch
Loading
fromA-Vamshi:addedEntityNameProperty

Conversation

@A-Vamshi
Copy link

@A-VamshiA-Vamshi commentedJul 12, 2025
edited by ellipsis-devbot
Loading

This PR adds the entityName prop to the following components/pages as requested in#655

selected-team-switcher
account-settings
team-creation
team-invitation


Important

AddentityName prop to customize entity name display in team-related components usingpluralize.

  • Behavior:
    • AddsentityName prop toAccountSettings,TeamCreation,TeamInvitation, andSelectedTeamSwitcher components to customize entity name display.
    • Usespluralize library inaccount-settings.tsx andselected-team-switcher.tsx to handle plural forms ofentityName.
  • Components:
    • AccountSettings: UsesentityName to customize team-related titles and IDs.
    • TeamCreation: UsesentityName for form validation messages and UI text.
    • TeamInvitation: UsesentityName for invitation messages and error handling.
    • SelectedTeamSwitcher: UsesentityName for dropdown labels and error messages.
  • Dependencies:
    • Addspluralize topackage.json for handling pluralization.

This description was created byEllipsis for4ba52c3. You cancustomize this summary. It will automatically update as commits are pushed.

greptile-apps[bot] reacted with thumbs up emojiellipsis-dev[bot] reacted with rocket emoji
@vercel
Copy link

vercelbot commentedJul 12, 2025

@A-Vamshi is attempting to deploy a commit to theStack Team onVercel.

A member of the Team first needs toauthorize it.

Copy link
Contributor

@greptile-appsgreptile-appsbot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added configurable entity naming across team-related components, allowing customization of team terminology (e.g., 'Team' to 'Course') throughout the UI.

  • AddedentityName prop to key components (TeamCreation,SelectedTeamSwitcher,TeamInvitation,AccountSettings) with pluralization support
  • Uses a newpluralize package dependency for handling entity name pluralization consistently
  • Inconsistent casing and type handling forentityName prop across components needs standardization
  • Potential prop type mismatches inpackages/template/src/components-page/team-invitation.tsx require attention
  • Consider using aMap instead of plain objects for dynamic string templating to prevent prototype pollution

5 files reviewed, 6 comments
Edit PR Review Bot Settings |Greptile

Comment on lines +84 to +85
constentityName=props.entityName??"Team";
constpluralEntity=pluralize(entityName)
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider caching pluralized value in useMemo to prevent unnecessary recalculations on re-renders

Comment on lines 73 to 77
exportfunctionTeamInvitation(props:{
fullPage?:boolean,
searchParams:Record<string,string>
entityName:string,
}){
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Type mismatch between TeamInvitation and TeamInvitationInner components. entityName is required here but optional in TeamInvitationInner.

Suggested change
exportfunctionTeamInvitation(props:{
fullPage?:boolean,
searchParams:Record<string,string>
entityName:string,
}){
exportfunctionTeamInvitation(props:{
fullPage?:boolean,
searchParams:Record<string,string>
entityName?:string,
}){

Comment on lines 92 to 94
<MessageCardtitle={t('Expired{entity} Invitation Link',{entity:entityName})}fullPage={fullPage}>
<Typography>{t('Your team invitation link has expired. Please request a new{entity} invitation link ',{entity:entityName.toLowerCase()})}</Typography>
</MessageCard>
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Inconsistent string: 'team' is hardcoded here while entityName is used for the title

Suggested change
<MessageCardtitle={t('Expired {entity} Invitation Link',{entity:entityName})}fullPage={fullPage}>
<Typography>{t('Yourteam invitation link has expired. Please request a new {entity} invitation link ',{entity:entityName.toLowerCase()})}</Typography>
</MessageCard>
<MessageCardtitle={t('Expired {entity} Invitation Link',{entity:entityName})}fullPage={fullPage}>
<Typography>{t('Your{entity} invitation link has expired. Please request a new {entity} invitation link ',{entity:entityName.toLowerCase()})}</Typography>
</MessageCard>

</div>,
type:'item',
id:`team-${team.id}`,
id:`${entityName.toLowerCase()}-${team.id}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Keep team-related IDs consistent. Other IDs like 'team-creation' still use hardcoded 'team-' prefix while this line uses dynamic entityName

exportfunctionTeamInvitation(props:{
fullPage?:boolean,
searchParams:Record<string,string>
entityName:string,

Choose a reason for hiding this comment

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

Breaking change in TeamInvitation component's props interface - 'entityName' is marked as required but existing usages in stack-handler.tsx and potentially other places don't provide this prop. This will cause TypeScript compilation errors and potential runtime issues if not provided. The props should maintain backward compatibility by making entityName optional with a default value of 'Team'.


React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)

@recurseml
Copy link

😱 Found 1 issue. Time to roll up your sleeves! 😱

🗒️ View all ignored comments in this repo
  • The constraint 'TokenStoreType extends string' is too restrictive. It should likely be 'TokenStoreType extends string | object' to match the condition check in line 113 where TokenStoreType is checked against {}
  • Return type mismatch - the interface declares useUsers() returning ServerUser[] but the Team interface that this extends declares useUsers() returning TeamUser[]
  • There is a syntax error in the super constructor call due to the ellipsis operator used incorrectly. Objects aren't being merged correctly. This syntax usage can lead to runtime errors when trying to pass the merged object to 'super()'. Verify that the intended alterations to the object occur before or outside of the super() call if needed.
  • Throwing an error when no active span is found is too aggressive. The log function should gracefully fallback to console.log or another logging mechanism when there's no active span, since not all execution contexts will have an active span. This makes the code less resilient and could break functionality in non-traced environments.

📚Relevant Docs

  • Function sets backendContext with a new configuration but doesn't pass 'defaultProjectKeys'. Since defaultProjectKeys is required in the type definition and cannot be updated (throws error if tried to set), this will cause a type error.
  • The schema is using array syntax for pick() which is incorrect for Yup schemas. The pick() method in Yup expects individual arguments, not an array. Should be changed to: emailConfigSchema.pick('type', 'host', 'port', 'username', 'sender_name', 'sender_email')

📚Relevant Docs

  • Creating a refresh token with current timestamp as expiration means it expires immediately. Should set a future date for token expiration.
  • The 'tools' object is initialized as an empty object, even though 'tools' is presumably expected to contain tool definitions. This could cause the server capabilities to lack necessary tool configurations, thus potentially impacting functionalities that depend on certain tool setups.

📚Relevant Docs

  • 'STACK_SECRET_SERVER_KEY' is potentially being included in every request header without checking its existence again here. Although it's checked during initialization, this could lead to security issues as it's exposed in all communications where the header is logged or captured.

📚Relevant Docs

  • When adding 'use client' directive at the beginning, it doesn't check if file.text already contains the 'use client' directive. This could lead to duplicate 'use client' directives if the file already has one.

📚Relevant Docs

Need help? Join our Discord for support!
https://discord.gg/qEjHQk64Z9

team=teams?.find(team=>team.id===value)||null;
if(!team){
thrownewStackAssertionError('Team not found, this should not happen');
thrownewStackAssertionError('{entity} not found, this should not happen',{entity:entityName});
Copy link
Contributor

Choose a reason for hiding this comment

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

The error message in the StackAssertionError contains spaces and is not machine‐readable. Consider using a unique, identifier-like string (e.g. "selected-team-not-found") as the first argument.

Suggested change
thrownewStackAssertionError('{entity}notfound, this should not happen',{entity:entityName});
thrownewStackAssertionError('selected-team-not-found',{entity:entityName});

This comment was generated because it violated a code review rule:mrule_dFi2eJA7OgSpYeiv.

@patched-codes
Copy link

Documentation Changes Required

1. docs/templates/components/account-settings.mdx

  1. Add newentityName prop to the PropTable section with description and default value.
  2. Update example code to demonstrate usage of the newentityName prop to show how Organizations would appear instead of Teams.

2. docs/templates/sdk/types/project.mdx

Update the description ofclientTeamCreationEnabled property:

  • Old: "Determines if client-side team creation is permitted within the project."
  • New: "Determines if client-side entity creation (teams or custom entities) is permitted within the project."

3. docs/templates/components/selected-team-switcher.mdx

  1. Add new props to the PropTable:

    • entityName (string, optional, default: "Team")
    • allowNull (boolean, optional, default: false)
    • nullLabel (string, optional, default: "No [entity]")
    • onChange (function, optional)
  2. Update the example to demonstrate usage of the newentityName prop:

<SelectedTeamSwitcherurlMap={(team)=>`/team/${team.id}`}selectedTeam={currentTeam}noUpdateSelectedTeam={false}entityName="Organization"/>

Please ensure these changes are reflected in the relevant documentation files.

@N2D4N2D4 changed the titleAdded entiyName propertyAdded entityName propertyJul 21, 2025
@fomalhautbfomalhautb removed their assignmentAug 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ellipsis-devellipsis-dev[bot]ellipsis-dev[bot] left review comments

@fomalhautbfomalhautbAwaiting requested review from fomalhautb

+2 more reviewers

@greptile-appsgreptile-apps[bot]greptile-apps[bot] left review comments

@recursemlrecurseml[bot]recurseml[bot] left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@A-Vamshi@fomalhautb@N2D4

[8]ページ先頭

©2009-2025 Movatter.jp