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

Error message should have given better error message on what is wrong at least if there is any minimum #3737

Closed
5 tasks
boskiv opened this issue Mar 29, 2018 · 3 comments · Fixed by #19895
Closed
5 tasks
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI
Milestone

Comments

@boskiv
Copy link

boskiv commented Mar 29, 2018

Description

Changing mirror interval to 5m , raise non-informal message
Minimum available interval 10m

Screenshots

screen shot 2018-03-29 at 11 23 26

@lafriks lafriks added the topic/ui Change the appearance of the Gitea UI label Mar 30, 2018
@lafriks lafriks added this to the 1.x.x milestone Mar 30, 2018
@stale
Copy link

stale bot commented Feb 4, 2019

This issue 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 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 4, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Feb 7, 2019
@Ryuno-Ki
Copy link
Contributor

Ryuno-Ki commented Jun 5, 2022

The minimum interval is depending on a setting:

interval, err := time.ParseDuration(form.Interval)
if err != nil || (interval != 0 && interval < setting.Mirror.MinInterval) {
ctx.Data["Err_Interval"] = true
ctx.RenderWithErr(ctx.Tr("repo.mirror_interval_invalid"), tplSettingsOptions, &form)
} else {
ctx.Repo.Mirror.EnablePrune = form.EnablePrune
ctx.Repo.Mirror.Interval = interval
ctx.Repo.Mirror.ScheduleNextUpdate()
if err := repo_model.UpdateMirror(ctx, ctx.Repo.Mirror); err != nil {
ctx.Data["Err_Interval"] = true
ctx.RenderWithErr(ctx.Tr("repo.mirror_interval_invalid"), tplSettingsOptions, &form)
return
}
}

and

interval, err := time.ParseDuration(form.PushMirrorInterval)
if err != nil || (interval != 0 && interval < setting.Mirror.MinInterval) {
ctx.Data["Err_PushMirrorInterval"] = true
ctx.RenderWithErr(ctx.Tr("repo.mirror_interval_invalid"), tplSettingsOptions, &form)
return
}

The translation key is "repo.mirror_interval_invalid". See its translation

mirror_interval_invalid = The mirror interval is not valid.

I don't know, how to inject a value (the configured minimum interval) there.

zeripath added a commit to zeripath/gitea that referenced this issue Jun 5, 2022
Expecting users to guess the minimum mirror interval appears a little unkind.
In this PR we simply change the locale string to include the minimum interval.
This will of course be affected by our current localization framework but...
we can fix that else where.

This PR also includes some fixes for error handling on the settings page as
previously the mirror block amongst others would simply disappear on error.

Fix go-gitea#3737

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick added a commit that referenced this issue Jun 7, 2022
* Ensure minimum mirror interval is reported on settings page

Expecting users to guess the minimum mirror interval appears a little unkind.
In this PR we simply change the locale string to include the minimum interval.
This will of course be affected by our current localization framework but...
we can fix that else where.

This PR also includes some fixes for error handling on the settings page as
previously the mirror block amongst others would simply disappear on error.

Fix #3737

Signed-off-by: Andrew Thornton <[email protected]>

* Update options/locale/locale_en-US.ini

Co-authored-by: Gusted <[email protected]>

* placate lint

Signed-off-by: Andrew Thornton <[email protected]>

* Update options/locale/locale_en-US.ini

Co-authored-by: wxiaoguang <[email protected]>

Co-authored-by: Gusted <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@Ryuno-Ki
Copy link
Contributor

Ryuno-Ki commented Jun 7, 2022

Thanks, @zeripath

@delvh delvh modified the milestones: 1.x.x, 1.17.0 Jun 8, 2022
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 24, 2022
…#19895)

* Ensure minimum mirror interval is reported on settings page

Expecting users to guess the minimum mirror interval appears a little unkind.
In this PR we simply change the locale string to include the minimum interval.
This will of course be affected by our current localization framework but...
we can fix that else where.

This PR also includes some fixes for error handling on the settings page as
previously the mirror block amongst others would simply disappear on error.

Fix go-gitea#3737

Signed-off-by: Andrew Thornton <[email protected]>

* Update options/locale/locale_en-US.ini

Co-authored-by: Gusted <[email protected]>

* placate lint

Signed-off-by: Andrew Thornton <[email protected]>

* Update options/locale/locale_en-US.ini

Co-authored-by: wxiaoguang <[email protected]>

Co-authored-by: Gusted <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants