import * as Core from "../../../../../../Core";
import * as Language from "../../../../../../Language";
import { ExcludedPackageData } from "./Data";
+import DomUtil from "../../../../../../Dom/Util";
class ExcludedPackages<
TPackageData extends ExcludedPackageData = ExcludedPackageData
protected validateInput(): boolean {
return super.validateInput() && this.validateVersion(this.version);
}
+
+ protected validateVersion(versionElement: HTMLInputElement): boolean {
+ const version = versionElement.value;
+
+ if (version === "") {
+ DomUtil.innerError(versionElement, Language.get("wcf.global.form.error.empty"));
+
+ return false;
+ } else if (version !== "*") {
+ return super.validateVersion(versionElement);
+ }
+
+ return true;
+ }
}
Core.enableLegacyInheritance(ExcludedPackages);
* @see module:WoltLabSuite/Core/Acp/Form/Builder/Field/Devtools/Project/AbstractPackageList
* @since 5.2
*/
-define(["require", "exports", "tslib", "./AbstractPackageList", "../../../../../../Core", "../../../../../../Language"], function (require, exports, tslib_1, AbstractPackageList_1, Core, Language) {
+define(["require", "exports", "tslib", "./AbstractPackageList", "../../../../../../Core", "../../../../../../Language", "../../../../../../Dom/Util"], function (require, exports, tslib_1, AbstractPackageList_1, Core, Language, Util_1) {
"use strict";
AbstractPackageList_1 = tslib_1.__importDefault(AbstractPackageList_1);
Core = tslib_1.__importStar(Core);
Language = tslib_1.__importStar(Language);
+ Util_1 = tslib_1.__importDefault(Util_1);
class ExcludedPackages extends AbstractPackageList_1.default {
constructor(formFieldId, existingPackages) {
super(formFieldId, existingPackages);
validateInput() {
return super.validateInput() && this.validateVersion(this.version);
}
+ validateVersion(versionElement) {
+ const version = versionElement.value;
+ if (version === "") {
+ Util_1.default.innerError(versionElement, Language.get("wcf.global.form.error.empty"));
+ return false;
+ }
+ else if (version !== "*") {
+ return super.validateVersion(versionElement);
+ }
+ return true;
+ }
}
Core.enableLegacyInheritance(ExcludedPackages);
return ExcludedPackages;