-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Upload corporate logo #1314
Upload corporate logo #1314
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
/** | ||
* HTTP request to upload a project logo | ||
*/ | ||
export async function uploadProjectLogo(file: File): Promise<AxiosResponse<ProjectLogoResponse>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I am not sure if we should have so many endpoints specific to the project logo
how about creating creating a patch project data endpoint?
We could add the logo here, if no logo is given, we delete existing logos.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept the upload
endpoint, but removed the delete
endpoint.
When we upload the image, it saves to the logos
folder, then returns the path to it. We can see the preview, and if we Save
, the projectLogo
gets updated to the logo path.
apps/client/src/features/app-settings/panel/project-panel/ProjectData.tsx
Show resolved
Hide resolved
@@ -86,6 +120,31 @@ export default function ProjectData() { | |||
{...register('title')} | |||
/> | |||
</label> | |||
<label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use an upload card similar to what we have in the sheets page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apps/server/src/services/project-service/projectServiceUtils.ts
Outdated
Show resolved
Hide resolved
@@ -5,4 +5,5 @@ export type ProjectData = { | |||
publicInfo: string; | |||
backstageUrl: string; | |||
backstageInfo: string; | |||
projectLogo?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: we seem to have some varying approaches here. We define projectLogo as string | undefined
, but use empty string
to signify no logo
Would it be better to have this field be an union string | null
so that the value is more explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to string | null
, but would this break existing projects that do not have that property on the json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for bringing this up. added a test to cover this case
@coderabbitai full review |
✅ Actions performedFull review triggered. |
0364c6f
to
31c59d6
Compare
No description provided.