Repository contact information is editable

The RepositoryForm is called within the creation and editing of a repository. It contains a validator, which is supposed to check, among other things, whether the namespace and name were specified when the repository is created. This information is missing in the edit mode. I therefore initially set valid.namespaceAndName to true. It is changed to false again before the creation mask becomes active.
This commit is contained in:
Florian Scholdei
2021-01-28 11:31:16 +01:00
committed by GitHub
parent 4fb42de0ca
commit a35c227a55
2 changed files with 4 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Add explicit provider setup for bouncy castle ([#1500](https://github.com/scm-manager/scm-manager/pull/1500))
- Repository contact information is editable ([#1508](https://github.com/scm-manager/scm-manager/pull/1508))
## [2.12.0] - 2020-12-17
### Added

View File

@@ -78,7 +78,7 @@ const RepositoryForm: FC<Props> = ({
});
const [initRepository, setInitRepository] = useState(false);
const [contextEntries, setContextEntries] = useState({});
const [valid, setValid] = useState({ namespaceAndName: false, contact: true });
const [valid, setValid] = useState({ namespaceAndName: true, contact: true });
const [t] = useTranslation("repos");
useEffect(() => {
@@ -178,12 +178,12 @@ const RepositoryForm: FC<Props> = ({
};
const submitButton = () => {
if (disabled) {
if (!isModifiable() && isEditMode()) {
return null;
}
return (
<Level
right={<SubmitButton disabled={!isValid()} loading={loading} label={t("repositoryForm.submitCreate")} />}
right={<SubmitButton disabled={!isValid() || loading} loading={loading} label={t("repositoryForm.submitCreate")} />}
/>
);
};