mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
Fix repo config for user without permission
Disable fields and remove submit buttons when user has not permission, aka no config links.
This commit is contained in:
@@ -112,6 +112,12 @@ class RepositoryConfig extends React.Component<Props, State> {
|
||||
);
|
||||
}
|
||||
|
||||
const submitButton = disabled? null: <SubmitButton
|
||||
label={t("scm-git-plugin.repo-config.submit")}
|
||||
loading={submitPending}
|
||||
disabled={!this.state.selectedBranchName}
|
||||
/>;
|
||||
|
||||
if (!(loadingBranches || loadingDefaultBranch)) {
|
||||
return (
|
||||
<>
|
||||
@@ -125,11 +131,7 @@ class RepositoryConfig extends React.Component<Props, State> {
|
||||
selectedBranch={this.state.selectedBranchName}
|
||||
disabled={disabled}
|
||||
/>
|
||||
<SubmitButton
|
||||
label={t("scm-git-plugin.repo-config.submit")}
|
||||
loading={submitPending}
|
||||
disabled={!this.state.selectedBranchName || disabled}
|
||||
/>
|
||||
{ submitButton }
|
||||
</form>
|
||||
<hr />
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user