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

Add upload favicon settings section #6638

Merged
merged 4 commits into from
Feb 12, 2025
Merged

Conversation

AdityaHegde
Copy link
Collaborator

@AdityaHegde AdityaHegde commented Feb 11, 2025

closes #6600

Builds on top of #6606 and adds a settings section for favicon upload.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@mindspank
Copy link
Contributor

Looks good to me.

A super super tiny nit is that the default Rill image in the upload section is our logo and actually not the favicon but not even sure that's worth changing

Comment on lines 28 to 29
const assetCreator = createAdminServiceCreateAsset();
const orgUpdater = createAdminServiceUpdateOrganization();
Copy link
Contributor

@ericpgreen2 ericpgreen2 Feb 11, 2025

Choose a reason for hiding this comment

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

Missing loading & error handling on the orgUpdater request

}

async function onSave() {
onCancel();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd expect the onCancel() (or a simple closePopover()) call to happen after the mutation, not before. Then we we can handle loading & error states in the popover itself.

(And the same goes for the onCancel() call in the removeLogo() function.)

void queryClient.invalidateQueries(
getAdminServiceGetOrganizationQueryKey(organization),
);
void invalidateAll();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to invalidateAll() or can we be more precise with invalidate()?

@AdityaHegde AdityaHegde force-pushed the feat/favicon-upload-frontend branch from e84823f to 256ce28 Compare February 12, 2025 05:36
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -23,7 +23,8 @@ import { fixLocalhostRuntimePort } from "@rilldata/web-common/runtime-client/fix
import { runtime } from "@rilldata/web-common/runtime-client/runtime-store";
import { error, redirect, type Page } from "@sveltejs/kit";

export const load = async ({ params, url, route }) => {
export const load = async ({ params, url, route, depends }) => {
depends("init");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we call this "root", just so we don't confuse it with Rill Developer's "init" loader (which is called "init" because it has "initialization" logic that redirects users to the Welcome page)


function onCancel() {
open = false;
url = imageUrl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking – is this needed? I see the reactive statement above ($: url = imageUrl;). Regardless, it's probably worth clarifying with a comment why the url variable is needed in addition to imageUrl.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding a comment to clarify why we need it.

@AdityaHegde AdityaHegde merged commit 41734db into main Feb 12, 2025
8 checks passed
@AdityaHegde AdityaHegde deleted the feat/favicon-upload-frontend branch February 12, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud UI: Support favicon uploads
3 participants