in src/app/devices/addDevice/components/addDevice.tsx [232:302]
name: t(ResourceKeys.deviceLists.commands.close),
onClick: navigateToDeviceList
},
]}
/>
);
};
const changeDeviceId = (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => {
const deviceIdError = getDeviceIdValidationMessage(newValue);
setDevice({
error: deviceIdError,
id: newValue
});
};
const changeAuthenticationType = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, option?: IChoiceGroupOption) => {
setAuthenticationType(option.key as DeviceAuthenticationType);
};
const changeDeviceStatus = (event: React.MouseEvent<HTMLElement>, checked?: boolean) => setDeviceStatus(checked ? DeviceStatus.Enabled : DeviceStatus.Disabled);
const changeAutoGenerateKeys = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) => {
setautoGenerateKeys(checked);
if (checked) {
setPrimaryKey(initialKeyValue);
setSecondaryKey(initialKeyValue);
}
};
const changePrimaryKey = (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => {
const primaryKeyError = getSymmetricKeyValidationMessage(newValue);
setPrimaryKey({
...primaryKey,
error: primaryKeyError,
value: newValue
});
};
const changeSecondaryKey = (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => {
const secondaryKeyError = getSymmetricKeyValidationMessage(newValue);
setSecondaryKey({
...secondaryKey,
error: secondaryKeyError,
value: newValue
});
};
const changePrimaryThumbprint = (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => {
const primaryThumbprintError = getThumbprintValidationMessage(newValue);
setPrimaryKey({
...primaryKey,
thumbprint: newValue,
thumbprintError: primaryThumbprintError
});
};
const changeSecondaryThumbprint = (event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => {
const secondaryThumbprintError = getThumbprintValidationMessage(newValue);
setSecondaryKey({
...secondaryKey,
thumbprint: newValue,
thumbprintError: secondaryThumbprintError
});
};
// tslint:disable-next-line:cyclomatic-complexity
const disableSaveButton = () => {
if (!device.id || !validateDeviceId(device.id)) { return true; }
if (authenticationType === DeviceAuthenticationType.SymmetricKey) {
if (!autoGenerateKeys) {