mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Mind review findings
This commit is contained in:
@@ -70,8 +70,7 @@ const ImportRepositoryFromUrl: FC<Props> = ({ url, setImportPending }) => {
|
||||
.post(url, repo, "application/vnd.scmm-repository+json;v=2")
|
||||
.then(response => {
|
||||
const location = response.headers.get("Location");
|
||||
// @ts-ignore Location is always set if the repository import was successful
|
||||
return apiClient.get(location);
|
||||
return apiClient.get(location!);
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(repo => {
|
||||
|
||||
@@ -25,11 +25,10 @@
|
||||
import { validation } from "@scm-manager/ui-components";
|
||||
|
||||
const nameRegex = /(?!^\.\.$)(?!^\.$)(?!.*[.]git$)(?!.*[\\\[\]])^[A-Za-z0-9\.][A-Za-z0-9\.\-_]*$/;
|
||||
const namespaceExceptionsRegexCreate = /^(([0-9]{1,3})|(create))$/;
|
||||
const namespaceExceptionsRegexImport = /^(([0-9]{1,3})|(import))$/;
|
||||
const namespaceExceptionsRegex = /^(([0-9]{1,3})|(create)|(import))$/;
|
||||
|
||||
export const isNamespaceValid = (name: string) => {
|
||||
return nameRegex.test(name) && !namespaceExceptionsRegexCreate.test(name) && !namespaceExceptionsRegexImport.test(name);
|
||||
return nameRegex.test(name) && !namespaceExceptionsRegex.test(name);
|
||||
};
|
||||
|
||||
export const isNameValid = (name: string) => {
|
||||
|
||||
Reference in New Issue
Block a user