Skip to content

Commit ecc5b72

Browse files
committed
revert the changes for the submit button to allow a common method to handle it
1 parent d6de786 commit ecc5b72

File tree

5 files changed

+5
-31
lines changed

5 files changed

+5
-31
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2842,10 +2842,9 @@ settings.repoadminchangeteam = Repository admin can add and remove access for te
28422842
settings.visibility = Visibility
28432843
settings.change_visibility = Change Visibility
28442844
settings.invalid_visibility = The new visibility is not valid.
2845-
settings.change_visibility_notices_1 = This operation <strong>CANNOT</strong> be undone.
2845+
settings.change_visibility_notices_1 = If the organization is converted to private, the repository stars will be removed and cannot be restored.
28462846
settings.change_visibility_notices_2 = Non-members will lose access to the organization’s repositories if visibility is changed to private.
28472847
settings.change_visibility_no_change = You did not make any changes to visibility.
2848-
settings.change_visibility_failed = Failed to change the visibility of %s due to an internal error.
28492848
settings.change_visibility_success = The visibility of organization %s has been successfully changed.
28502849
settings.visibility_desc = Change who can view the organization and its repositories.
28512850
settings.visibility.public = Public

routers/web/org/setting.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ func SettingsChangeVisibilityPost(ctx *context.Context) {
246246

247247
if err := org_service.ChangeOrganizationVisibility(ctx, ctx.Org.Organization, visibility); err != nil {
248248
log.Error("ChangeOrganizationVisibility: %v", err)
249-
ctx.JSONError(util.Iif(ctx.Doer.IsAdmin, err.Error(), string(ctx.Tr("org.settings.change_visibility_failed", ctx.Org.Organization.Name))))
249+
ctx.JSON(http.StatusInternalServerError, map[string]any{
250+
"err": http.StatusText(http.StatusInternalServerError),
251+
})
250252
return
251253
}
252254

templates/org/settings/options_dangerzone.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
<div class="actions">
6969
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
70-
<button id="change-visibility-submit" class="ui red button" disabled>{{ctx.Locale.Tr "org.settings.change_visibility"}}</button>
70+
<button class="ui red button">{{ctx.Locale.Tr "org.settings.change_visibility"}}</button>
7171
</div>
7272
</form>
7373
</div>

web_src/js/features/org-settings.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

web_src/js/index-domready.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {initRepoActivityTopAuthorsChart, initRepoArchiveLinks} from './features/
3333
import {initRepoMigrationStatusChecker} from './features/repo-migrate.ts';
3434
import {initRepoDiffView} from './features/repo-diff.ts';
3535
import {initOrgTeam} from './features/org-team.ts';
36-
import {initOrgSettings} from './features/org-settings.ts';
3736
import {initUserAuthWebAuthn, initUserAuthWebAuthnRegister} from './features/user-auth-webauthn.ts';
3837
import {initRepoRelease, initRepoReleaseNew} from './features/repo-release.ts';
3938
import {initRepoEditor} from './features/repo-editor.ts';
@@ -121,7 +120,6 @@ const initPerformanceTracer = callInitFunctions([
121120
initNotificationsTable,
122121

123122
initOrgTeam,
124-
initOrgSettings,
125123

126124
initRepoActivityTopAuthorsChart,
127125
initRepoArchiveLinks,

0 commit comments

Comments
 (0)