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

Added auto-save whitespace behavior if it changed manually #15566

Merged
merged 9 commits into from
Feb 8, 2022

Conversation

POPSuL
Copy link
Contributor

@POPSuL POPSuL commented Apr 21, 2021

Fix #13758, #9272

Works like "split/unified view" option, stores in database only for authenticated users when they changes that option.

@POPSuL POPSuL changed the title Added auto-save whitespace behavior if it changed manually when watching diff Added auto-save whitespace behavior if it changed manually Apr 21, 2021
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Apr 21, 2021
models/migrations/v180.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 21, 2021
@POPSuL
Copy link
Contributor Author

POPSuL commented Apr 22, 2021

Idk how to fix it. Database scheme for integration tests is obsolete.
At least https://github.com/go-gitea/gitea/blob/master/integrations/migration-test/gitea-v1.7.0.postgres.sql.gz is obsolete. That dump have no at least 3 columns.

  1. why pg testing only on arm64? why not amd64 or else?
  2. how i can solve that issue?

@POPSuL POPSuL force-pushed the f/save-whitespace-behavior branch from c2c9129 to d9898c3 Compare April 30, 2021 03:43
Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I'm adding a blocking review as I believe there was a proposal in a separate issue to add a KV table for user settings (or repo settings?) as then that would keep us from having to add a column to tables for each setting, and I think that should be the path we proceed with.

@POPSuL
Copy link
Contributor Author

POPSuL commented Apr 30, 2021

@techknowlogick Its good idea! But, maybe not KV (like user_id|property|value), but json like user_id|ALL_PROPS_IN_JSON?
Its more flexible and faster. Take one row with all user options is faster than fetch all possible rows.

@silverwind
Copy link
Member

silverwind commented May 19, 2021

A simple JSON object in the db for ui-related user settings would be awesome, yes. We could easily expose it on window.config once JS needs access to it too.

@stale
Copy link

stale bot commented Jul 21, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions.

@stale stale bot added the issue/stale label Jul 21, 2021
@wxiaoguang
Copy link
Contributor

The user setting table is ready. We can continue without adding columns to user table now. 😊

@POPSuL do you have time to work on it? Thank you for your contribution!

@stale stale bot removed the issue/stale label Jan 20, 2022
@POPSuL
Copy link
Contributor Author

POPSuL commented Jan 21, 2022

@wxiaoguang yes, i can. I will do it next week.

@POPSuL
Copy link
Contributor Author

POPSuL commented Jan 25, 2022

Rewritten to store in user_settings

@wxiaoguang
Copy link
Contributor

I did some refactoring, make it more simple and clear

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 25, 2022
@codecov-commenter

This comment has been minimized.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 26, 2022
@lunny lunny added this to the 1.17.0 milestone Jan 27, 2022
@wxiaoguang wxiaoguang merged commit 4d93984 into go-gitea:main Feb 8, 2022
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 8, 2022
* giteaofficial/main: (28 commits)
  Added auto-save whitespace behavior if it changed manually (go-gitea#15566)
  Support custom ACME provider (go-gitea#18340)
  Refactor i18n, use Locale to provide i18n/translation related functions (go-gitea#18648)
  Only request write when necessary (go-gitea#18657)
  [skip ci] Updated translations via Crowdin
  Add separate SSH_USER config option (go-gitea#17584)
  Be more lenient with label colors (go-gitea#17752)
  remove redundant call to UpdateRepoStats during migration (go-gitea#18591)
  more repo dump/restore tests, including pull requests (go-gitea#18621)
  No longer show the db-downgrade SQL in production (go-gitea#18653)
  Fix the missing i18n key for update checker (go-gitea#18646)
  Update gitea-vet (go-gitea#18640)
  Future proof for 1.18 (go-gitea#18644)
  Add `contrib/upgrade.sh` (go-gitea#18286)
  If rendering has failed due to a net.OpError stop rendering (go-gitea#18642)
  Delete old git.NewCommand() and use it as git.NewCommandContext() (go-gitea#18552)
  Update JS dependencies (go-gitea#18636)
  fix commits_list_small.tmpl (go-gitea#18641)
  Fix `make fmt` and `make fmt-check` (go-gitea#18633)
  Frontport of changelog for v1.16.1 (go-gitea#18615)
  ...
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The button cannot remember the previous options
8 participants