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

Remove uploaded app image #448

Open
PanderMusubi opened this issue Nov 1, 2021 · 10 comments
Open

Remove uploaded app image #448

PanderMusubi opened this issue Nov 1, 2021 · 10 comments
Labels
a:feature New feature or request

Comments

@PanderMusubi
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Once an image is added to an app, it cannot be removed

Describe the solution you'd like
A button to remove the uploaded image for an app, so that the default image appears again.

Describe alternatives you've considered
Workaround is finding the original default app image and uploading that but that is too elaborate.

Additional context

@PanderMusubi PanderMusubi added the a:feature New feature or request label Nov 1, 2021
@tessus
Copy link
Contributor

tessus commented May 23, 2023

If somebody takes care of the frontend stuff, I'll create a backend function and API endpoint DELETE /:id/image.

see #568

Update: The endpoint does exist now. If someone could work on the UI that would be great.

I suggest that there is an overlay image (an x) in the bottom right corner of the icon when hovered over the icon in the frontend. Upon click, the API is called. (The onclick js I can most likely do, but no idea how to do the overlay image.)

@ChlAtGitHub
Copy link

Please let me know if jQuery is available and provide an URL to let me test this out directly in the browser console. Then I will post the snippet. Thx, Chris.

@tessus
Copy link
Contributor

tessus commented May 29, 2023

It's typsescript and react - the 2 files that need changing are:

https://github.com/gotify/server/blob/master/ui/src/application/Applications.tsx

and

https://github.com/gotify/server/blob/master/ui/src/application/AppStore.ts (although I can do this one).

@xavier-GitHub76
Copy link

Hello @tessus

I began to update the ui (ui/src/application/Applications.tsx)
I add a bouton (HighlightOffIcon)

image

For the moment, the click just write a trace in log :
image

(I'am a beginner, I have just create a first pull request today (#611))

@tessus
Copy link
Contributor

tessus commented Nov 14, 2023

Ah, nice. Is there a way to not use a separate column and icon, but create an overlay image when the mouse hovers over the icon? I am really bad with css and frontend stuff, but I have seen similar stuff in other UIs.

e.g. when you hover over an icon, the icon you used (or a simple X) is shown as an overlay (the uploade icon is shown a bit faded and the x icon on top - maybe even in the color red).

What do you think?

P.S.: If you give me access to your branch (after you created a PR for this), I can add the call to the API instead of the trace entries.

@jmattheis
Copy link
Member

I prefer the hover behavior @tessus proposed.

@xavier-GitHub76
Copy link

For the moment, I'm not able to make this behavior, I'm a beginner and I don't know how to do.
Sorry.

@tessus
Copy link
Contributor

tessus commented Nov 15, 2023

Hmm, can you point me to the code changes you made to Applications.tsx?

@xavier-GitHub76
Copy link

xavier-GitHub76 commented Nov 17, 2023

Hi,
@tessus, I invite you to collaborate on my fork (I hope it's the good practice on Github)
Regards

@tessus
Copy link
Contributor

tessus commented Nov 19, 2023

@xavier-GitHub76 thx. Yes, this is usually how it is done. Because now I can also add commits to any PRs you create from that specific fork.

However, I have noticed that you added the code changes to the PR that you have already created. It's better to create different PRs for different features/fixes/code_changes.
But it depends on the project and the owner jmattheis.
I thought you might have 2 different branches, while the one with the Applications.tsx changes has not been pushed. Woa, I just saw that you are working off your master branch.

You mentioned you are new to Github. I wrote a forum post for another project once on How to create a Pull Request (PR)
Maybe it could be useful to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request
Development

No branches or pull requests

5 participants