Remove nickname field, tweak UI, update migrations (#1404)

This commit is contained in:
Leendert de Borst
2025-12-13 11:19:23 +01:00
parent 187ab42ae1
commit aca686e934
38 changed files with 128 additions and 471 deletions
@@ -255,7 +255,6 @@ export async function createAutofillPopup(input: HTMLInputElement, credentials:
Username: result.customUsername,
Password: result.customPassword ?? '',
Alias: {
NickName: result.customUsername ?? '',
BirthDate: '',
Email: result.customEmail ?? ''
}
@@ -293,7 +292,6 @@ export async function createAutofillPopup(input: HTMLInputElement, credentials:
Alias: {
FirstName: identity.firstName,
LastName: identity.lastName,
NickName: identity.nickName,
BirthDate: identity.birthDate.toISOString(),
Gender: identity.gender,
Email: `${identity.emailPrefix}@${domain}`
@@ -17,10 +17,9 @@ const AliasBlock: React.FC<AliasBlockProps> = ({ credential }) => {
const { t } = useTranslation();
const hasFirstName = Boolean(credential.Alias?.FirstName?.trim());
const hasLastName = Boolean(credential.Alias?.LastName?.trim());
const hasNickName = Boolean(credential.Alias?.NickName?.trim());
const hasBirthDate = IdentityHelperUtils.isValidBirthDate(credential.Alias?.BirthDate);
if (!hasFirstName && !hasLastName && !hasNickName && !hasBirthDate) {
if (!hasFirstName && !hasLastName && !hasBirthDate) {
return null;
}
@@ -55,13 +54,6 @@ const AliasBlock: React.FC<AliasBlockProps> = ({ credential }) => {
value={IdentityHelperUtils.normalizeBirthDateForDisplay(credential.Alias?.BirthDate)}
/>
)}
{hasNickName && (
<FormInputCopyToClipboard
id="nickName"
label={t('common.nickname')}
value={credential.Alias?.NickName ?? ''}
/>
)}
</div>
);
};
@@ -1,7 +1,7 @@
import React from 'react';
type FormSectionProps = {
title?: string;
title?: React.ReactNode;
children: React.ReactNode;
actions?: React.ReactNode;
};
@@ -19,7 +19,7 @@ const FormSection: React.FC<FormSectionProps> = ({
<div className="bg-white dark:bg-gray-800 p-4 rounded-lg border border-gray-200 dark:border-gray-700">
{title && (
<h2 className="text-lg font-semibold mb-4 text-gray-900 dark:text-white flex items-center justify-between">
<span>{title}</span>
{typeof title === 'string' ? <span>{title}</span> : title}
{actions && (
<div className="flex items-center gap-2">
{actions}
@@ -12,7 +12,6 @@ type GeneratedAliasData = {
email: string;
firstName: string;
lastName: string;
nickname: string;
gender: string;
birthdate: string;
username: string;
@@ -96,7 +95,6 @@ const useAliasGenerator = (): {
email,
firstName: identity.firstName,
lastName: identity.lastName,
nickname: identity.nickName,
gender: identity.gender,
birthdate: IdentityHelperUtils.normalizeBirthDateForDisplay(identity.birthDate.toISOString()),
username: identity.nickName,
@@ -69,7 +69,6 @@ const CredentialAddEdit: React.FC = () => {
Alias: Yup.object().shape({
FirstName: Yup.string().nullable().optional(),
LastName: Yup.string().nullable().optional(),
NickName: Yup.string().nullable().optional(),
BirthDate: Yup.string()
.nullable()
.optional()
@@ -133,7 +132,6 @@ const CredentialAddEdit: React.FC = () => {
Alias: {
FirstName: "",
LastName: "",
NickName: "",
BirthDate: "",
Gender: undefined,
Email: ""
@@ -437,7 +435,6 @@ const CredentialAddEdit: React.FC = () => {
}
setValue('Alias.FirstName', identity.firstName);
setValue('Alias.LastName', identity.lastName);
setValue('Alias.NickName', identity.nickName);
setValue('Alias.Gender', identity.gender);
setValue('Alias.BirthDate', IdentityHelperUtils.normalizeBirthDateForDisplay(identity.birthDate.toISOString()));
@@ -465,13 +462,12 @@ const CredentialAddEdit: React.FC = () => {
const clearAliasFields = useCallback(() => {
setValue('Alias.FirstName', '');
setValue('Alias.LastName', '');
setValue('Alias.NickName', '');
setValue('Alias.Gender', '');
setValue('Alias.BirthDate', '');
}, [setValue]);
// Check if any alias fields have values.
const hasAliasValues = !!(watch('Alias.FirstName') || watch('Alias.LastName') || watch('Alias.NickName') || watch('Alias.Gender') || watch('Alias.BirthDate'));
const hasAliasValues = !!(watch('Alias.FirstName') || watch('Alias.LastName') || watch('Alias.Gender') || watch('Alias.BirthDate'));
/**
* Handle the generate random alias button press.
@@ -488,13 +484,12 @@ const CredentialAddEdit: React.FC = () => {
try {
const firstName = watch('Alias.FirstName') ?? '';
const lastName = watch('Alias.LastName') ?? '';
const nickName = watch('Alias.NickName') ?? '';
const birthDate = watch('Alias.BirthDate') ?? '';
let username: string;
// If alias fields are empty, generate a completely random username
if (!firstName && !lastName && !nickName && !birthDate) {
if (!firstName && !lastName && !birthDate) {
const { identityGenerator } = await initializeGenerators();
const genderPreference = dbContext.sqliteClient!.getDefaultIdentityGender();
const ageRange = dbContext.sqliteClient!.getDefaultIdentityAgeRange();
@@ -521,7 +516,7 @@ const CredentialAddEdit: React.FC = () => {
const identity: Identity = {
firstName,
lastName,
nickName,
nickName: '', // nickName is auto-generated but no longer stored as a separate alias field
gender,
birthDate: parsedBirthDate,
emailPrefix: watch('Alias.Email') ?? '',
@@ -561,7 +556,6 @@ const CredentialAddEdit: React.FC = () => {
data.Password = watch('Password');
data.Alias.FirstName = watch('Alias.FirstName');
data.Alias.LastName = watch('Alias.LastName');
data.Alias.NickName = watch('Alias.NickName');
data.Alias.BirthDate = watch('Alias.BirthDate');
data.Alias.Gender = watch('Alias.Gender');
data.Alias.Email = watch('Alias.Email');
@@ -949,13 +943,6 @@ const CredentialAddEdit: React.FC = () => {
onChange={(value) => setValue('Alias.LastName', value)}
error={errors.Alias?.LastName?.message}
/>
<FormInput
id="nickName"
label={t('credentials.nickName')}
value={watch('Alias.NickName') ?? ''}
onChange={(value) => setValue('Alias.NickName', value)}
error={errors.Alias?.NickName?.message}
/>
<FormInput
id="gender"
label={t('credentials.gender')}
@@ -208,7 +208,6 @@ const CredentialsList: React.FC = () => {
passesTypeFilter = !!(
(credential.Alias?.FirstName && credential.Alias.FirstName.trim()) ||
(credential.Alias?.LastName && credential.Alias.LastName.trim()) ||
(credential.Alias?.NickName && credential.Alias.NickName.trim()) ||
(credential.Alias?.Gender && credential.Alias.Gender.trim()) ||
(credential.Alias?.BirthDate && credential.Alias.BirthDate.trim())
);
@@ -217,7 +216,6 @@ const CredentialsList: React.FC = () => {
const hasAliasFields = !!(
(credential.Alias?.FirstName && credential.Alias.FirstName.trim()) ||
(credential.Alias?.LastName && credential.Alias.LastName.trim()) ||
(credential.Alias?.NickName && credential.Alias.NickName.trim()) ||
(credential.Alias?.Gender && credential.Alias.Gender.trim()) ||
(credential.Alias?.BirthDate && credential.Alias.BirthDate.trim())
);
@@ -304,7 +304,6 @@ const ItemAddEdit: React.FC = () => {
// Always update alias identity fields
'alias.first_name': generatedData.firstName,
'alias.last_name': generatedData.lastName,
'alias.nickname': generatedData.nickname,
'alias.gender': generatedData.gender,
'alias.birthdate': generatedData.birthdate
};
@@ -612,6 +611,25 @@ const ItemAddEdit: React.FC = () => {
setManuallyAddedFields(prev => new Set(prev).add(fieldKey));
}, []);
/**
* Handle removing an optional system field (e.g., email for Login type).
* Only allowed for fields that were manually added (not shown by default).
*/
const handleRemoveOptionalField = useCallback((fieldKey: string): void => {
// Remove from manually added set
setManuallyAddedFields(prev => {
const newSet = new Set(prev);
newSet.delete(fieldKey);
return newSet;
});
// Clear the field value
setFieldValues(prev => {
const newValues = { ...prev };
delete newValues[fieldKey];
return newValues;
});
}, []);
// Set header buttons
useEffect(() => {
const headerButtonsJSX = (
@@ -640,8 +658,9 @@ const ItemAddEdit: React.FC = () => {
/**
* Render a field input based on field type.
* @param onRemove - Optional callback to render an X button inside the input for removable fields
*/
const renderFieldInput = useCallback((fieldKey: string, label: string, fieldType: FieldType, isHidden: boolean, isMultiValue: boolean): React.ReactNode => {
const renderFieldInput = useCallback((fieldKey: string, label: string, fieldType: FieldType, isHidden: boolean, isMultiValue: boolean, onRemove?: () => void): React.ReactNode => {
const value = fieldValues[fieldKey] || '';
// Handle multi-value fields
@@ -687,9 +706,37 @@ const ItemAddEdit: React.FC = () => {
// Single-value fields
const stringValue = Array.isArray(value) ? value[0] || '' : value;
/**
* Wraps an input element with a remove button overlay for removable fields.
* @param inputElement - The input element to wrap
* @param hasLabel - Whether the input has a label (affects button positioning)
* @returns The wrapped element with remove button, or the original element if not removable
*/
const wrapWithRemoveButton = (inputElement: React.ReactNode, hasLabel: boolean = true): React.ReactNode => {
if (!onRemove) {
return inputElement;
}
return (
<div className="relative">
{inputElement}
<button
type="button"
onClick={onRemove}
className={`absolute right-2 ${hasLabel ? 'top-[38px]' : 'top-1/2'} -translate-y-1/2 w-6 h-6 flex items-center justify-center text-gray-300 hover:text-red-400 dark:text-gray-500 dark:hover:text-red-400 transition-colors`}
title={t('common.delete')}
>
<svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<line x1="18" y1="6" x2="6" y2="18"/>
<line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
);
};
switch (fieldType) {
case FieldTypes.Password:
return (
return wrapWithRemoveButton(
<PasswordField
id={fieldKey}
label={label}
@@ -701,7 +748,7 @@ const ItemAddEdit: React.FC = () => {
);
case FieldTypes.Hidden:
return (
return wrapWithRemoveButton(
<HiddenField
id={fieldKey}
label={label}
@@ -711,7 +758,7 @@ const ItemAddEdit: React.FC = () => {
);
case FieldTypes.TextArea:
return (
return wrapWithRemoveButton(
<div>
<label htmlFor={fieldKey} className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{label}
@@ -721,7 +768,7 @@ const ItemAddEdit: React.FC = () => {
value={stringValue}
onChange={(e) => handleFieldChange(fieldKey, e.target.value)}
rows={4}
className="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white"
className={`w-full px-3 py-2 ${onRemove ? 'pr-10' : ''} border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-primary-500 focus:border-primary-500 dark:bg-gray-700 dark:text-white`}
placeholder={label}
/>
</div>
@@ -734,7 +781,7 @@ const ItemAddEdit: React.FC = () => {
case FieldTypes.Date:
case FieldTypes.Text:
default:
return (
return wrapWithRemoveButton(
<FormInput
id={fieldKey}
label={label}
@@ -746,7 +793,7 @@ const ItemAddEdit: React.FC = () => {
);
}
}, [fieldValues, handleFieldChange, showPassword]);
}, [fieldValues, handleFieldChange, showPassword, t]);
/**
* Handle form submission via Enter key.
@@ -852,45 +899,70 @@ const ItemAddEdit: React.FC = () => {
const categoryFields = groupedSystemFields[category];
// Filter fields to only show those that should be visible
const visibleFields = categoryFields.filter(field => shouldShowField(field));
// Find email field for potential "+ Email" button
const emailField = categoryFields.find(f => f.FieldKey === 'login.email');
// Find email field for potential "+ Email" button (only for Login category)
const emailField = category === 'Login' ? categoryFields.find(f => f.FieldKey === 'login.email') : null;
const showEmailAddButton = emailField && !shouldShowField(emailField);
// Don't render category section if no visible fields
if (visibleFields.length === 0 && !showEmailAddButton) {
// Sort login fields: email first, then username, then password, then others
const sortedVisibleFields = category === 'Login'
? [...visibleFields].sort((a, b) => {
const order: Record<string, number> = {
'login.email': 0,
'login.username': 1,
'login.password': 2
};
const aOrder = order[a.FieldKey] ?? 99;
const bOrder = order[b.FieldKey] ?? 99;
return aOrder - bOrder;
})
: visibleFields;
// Don't render category section if no visible fields and no add button
if (sortedVisibleFields.length === 0 && !showEmailAddButton) {
return null;
}
return (
<FormSection
key={category}
title={getCategoryTitle(category)}
actions={renderSectionActions(category)}
>
{visibleFields.map(field => (
<React.Fragment key={field.FieldKey}>
{renderFieldInput(
field.FieldKey,
t(`fieldLabels.${field.FieldKey}`, { defaultValue: field.FieldKey }),
field.FieldType,
field.IsHidden,
field.IsMultiValue
)}
{/* Show "+ Email" button after username field when email is hidden */}
{field.FieldKey === 'login.username' && showEmailAddButton && (
title={
<div className="flex items-center gap-2">
<span>{getCategoryTitle(category)}</span>
{/* Show "+ Email" pill button next to Credentials header when email is hidden */}
{showEmailAddButton && (
<button
type="button"
onClick={() => handleAddOptionalField('login.email')}
className="mt-1 text-xs text-primary-500 hover:text-primary-600 dark:text-primary-400 dark:hover:text-primary-300 flex items-center gap-1"
className="inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full transition-colors focus:outline-none text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 border border-dashed border-gray-300 dark:border-gray-600 hover:border-primary-400 dark:hover:border-primary-500"
>
<svg className="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
<svg className="w-2.5 h-2.5 -ml-0.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
<line x1="12" y1="5" x2="12" y2="19" />
<line x1="5" y1="12" x2="19" y2="12" />
</svg>
{t('credentials.addEmail')}
<span>{t('common.email')}</span>
</button>
)}
</React.Fragment>
))}
</div>
}
actions={renderSectionActions(category)}
>
{sortedVisibleFields.map(field => {
// Check if this is an optional field that can be removed (manually added, not shown by default)
const canRemoveField = item && manuallyAddedFields.has(field.FieldKey) && !isFieldShownByDefault(field, item.ItemType);
return (
<React.Fragment key={field.FieldKey}>
{renderFieldInput(
field.FieldKey,
t(`fieldLabels.${field.FieldKey}`, { defaultValue: field.FieldKey }),
field.FieldType,
field.IsHidden,
field.IsMultiValue,
canRemoveField ? (): void => handleRemoveOptionalField(field.FieldKey) : undefined
)}
</React.Fragment>
);
})}
</FormSection>
);
})}
@@ -177,7 +177,17 @@ const ItemDetails: React.FC = (): React.ReactElement => {
<h2 className="text-xl font-semibold text-gray-900 dark:text-white">
{t('common.credentials')}
</h2>
{groupedFields.Login.map((field) => (
{/* Sort login fields: email first, then username, then password, then others */}
{[...groupedFields.Login].sort((a, b) => {
const order: Record<string, number> = {
'login.email': 0,
'login.username': 1,
'login.password': 2
};
const aOrder = order[a.FieldKey] ?? 99;
const bOrder = order[b.FieldKey] ?? 99;
return aOrder - bOrder;
}).map((field) => (
<FieldBlock key={field.FieldKey} field={field} itemId={item.Id} />
))}
</div>
@@ -325,7 +325,6 @@ const PasskeyCreate: React.FC = () => {
Alias: {
FirstName: '',
LastName: '',
NickName: '',
BirthDate: '',
Gender: '',
Email: ''
@@ -405,7 +404,6 @@ const PasskeyCreate: React.FC = () => {
Alias: {
FirstName: '',
LastName: '',
NickName: '',
BirthDate: '',
Gender: '',
Email: ''
@@ -90,7 +90,6 @@
"firstName": "First Name",
"lastName": "Last Name",
"birthDate": "Birth Date",
"nickname": "Nickname",
"email": "Email",
"username": "Username",
"password": "Password",
@@ -239,7 +238,6 @@
"addEmail": "+ Email",
"firstName": "First Name",
"lastName": "Last Name",
"nickName": "Nick Name",
"gender": "Gender",
"birthDate": "Birth Date",
"birthDatePlaceholder": "YYYY-MM-DD",
@@ -347,7 +345,6 @@
"login.url": "Website URL",
"alias.first_name": "First Name",
"alias.last_name": "Last Name",
"alias.nickname": "Nickname",
"alias.gender": "Gender",
"alias.birthdate": "Birth Date",
"card.cardholder_name": "Cardholder Name",
@@ -268,7 +268,6 @@ export class SqliteClient {
Alias: {
FirstName: fields[FieldKey.AliasFirstName] || undefined,
LastName: fields[FieldKey.AliasLastName] || undefined,
NickName: fields[FieldKey.AliasNickname] || undefined,
BirthDate: fields[FieldKey.AliasBirthdate] || '',
Gender: fields[FieldKey.AliasGender] || undefined,
Email: fields[FieldKey.LoginEmail] || undefined
@@ -351,7 +350,6 @@ export class SqliteClient {
Alias: {
FirstName: fields[FieldKey.AliasFirstName] || undefined,
LastName: fields[FieldKey.AliasLastName] || undefined,
NickName: fields[FieldKey.AliasNickname] || undefined,
BirthDate: fields[FieldKey.AliasBirthdate] || '',
Gender: fields[FieldKey.AliasGender] || undefined,
Email: fields[FieldKey.LoginEmail] || undefined
@@ -945,7 +943,6 @@ export class SqliteClient {
{ key: FieldKey.LoginNotes, value: credential.Notes ?? null },
{ key: FieldKey.AliasFirstName, value: credential.Alias?.FirstName ?? null },
{ key: FieldKey.AliasLastName, value: credential.Alias?.LastName ?? null },
{ key: FieldKey.AliasNickname, value: credential.Alias?.NickName ?? null },
{ key: FieldKey.AliasBirthdate, value: credential.Alias?.BirthDate ?? null },
{ key: FieldKey.AliasGender, value: credential.Alias?.Gender ?? null },
{ key: FieldKey.LoginEmail, value: credential.Alias?.Email ?? null },
@@ -1381,7 +1378,6 @@ export class SqliteClient {
UPDATE Aliases
SET FirstName = ?,
LastName = ?,
NickName = ?,
BirthDate = ?,
Gender = ?,
Email = ?,
@@ -1405,7 +1401,6 @@ export class SqliteClient {
this.executeUpdate(aliasQuery, [
credential.Alias.FirstName ?? null,
credential.Alias.LastName ?? null,
credential.Alias.NickName ?? null,
birthDate ?? null,
credential.Alias.Gender ?? null,
credential.Alias.Email ?? null,
@@ -81,7 +81,6 @@ type Credential = {
type Alias = {
FirstName?: string;
LastName?: string;
NickName?: string;
BirthDate: string;
Gender?: string;
Email?: string;
@@ -281,11 +280,6 @@ declare const FieldKey: {
* Type: Text
*/
readonly AliasLastName: "alias.last_name";
/**
* Alias nickname field
* Type: Text
*/
readonly AliasNickname: "alias.nickname";
/**
* Alias gender field
* Type: Text
@@ -134,11 +134,6 @@ var FieldKey = {
* Type: Text
*/
AliasLastName: "alias.last_name",
/**
* Alias nickname field
* Type: Text
*/
AliasNickname: "alias.nickname",
/**
* Alias gender field
* Type: Text
@@ -229,7 +224,6 @@ function itemToCredential(item) {
Alias: {
FirstName: getFieldValue(item, FieldKey.AliasFirstName),
LastName: getFieldValue(item, FieldKey.AliasLastName),
NickName: getFieldValue(item, FieldKey.AliasNickname),
BirthDate: getFieldValue(item, FieldKey.AliasBirthdate) || "",
Gender: getFieldValue(item, FieldKey.AliasGender),
Email: getFieldValue(item, FieldKey.LoginEmail)
@@ -326,18 +320,6 @@ var SystemFieldRegistry = {
Category: FieldCategories.Alias,
DefaultDisplayOrder: 30
},
"alias.nickname": {
FieldKey: "alias.nickname",
FieldType: "Text",
IsHidden: false,
IsMultiValue: false,
ApplicableToTypes: {
Alias: { ShowByDefault: true }
},
EnableHistory: false,
Category: FieldCategories.Alias,
DefaultDisplayOrder: 40
},
"alias.gender": {
FieldKey: "alias.gender",
FieldType: "Text",
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -862,7 +862,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1033,23 +1032,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1990,7 +1972,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2161,23 +2142,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -830,7 +830,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1001,23 +1000,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1958,7 +1940,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2129,23 +2110,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -139,11 +139,6 @@ object FieldKey {
*/
const val ALIAS_LAST_NAME = "alias.last_name"
/**
* Type: Text.
*/
const val ALIAS_NICKNAME = "alias.nickname"
/**
* Type: Text.
*/
@@ -85,9 +85,6 @@ public struct FieldKey {
/// Type: Text
public static let aliasLastName = "alias.last_name"
/// Type: Text
public static let aliasNickname = "alias.nickname"
/// Type: Text
public static let aliasGender = "alias.gender"
@@ -81,7 +81,6 @@ type Credential = {
type Alias = {
FirstName?: string;
LastName?: string;
NickName?: string;
BirthDate: string;
Gender?: string;
Email?: string;
@@ -281,11 +280,6 @@ declare const FieldKey: {
* Type: Text
*/
readonly AliasLastName: "alias.last_name";
/**
* Alias nickname field
* Type: Text
*/
readonly AliasNickname: "alias.nickname";
/**
* Alias gender field
* Type: Text
-18
View File
@@ -134,11 +134,6 @@ var FieldKey = {
* Type: Text
*/
AliasLastName: "alias.last_name",
/**
* Alias nickname field
* Type: Text
*/
AliasNickname: "alias.nickname",
/**
* Alias gender field
* Type: Text
@@ -229,7 +224,6 @@ function itemToCredential(item) {
Alias: {
FirstName: getFieldValue(item, FieldKey.AliasFirstName),
LastName: getFieldValue(item, FieldKey.AliasLastName),
NickName: getFieldValue(item, FieldKey.AliasNickname),
BirthDate: getFieldValue(item, FieldKey.AliasBirthdate) || "",
Gender: getFieldValue(item, FieldKey.AliasGender),
Email: getFieldValue(item, FieldKey.LoginEmail)
@@ -326,18 +320,6 @@ var SystemFieldRegistry = {
Category: FieldCategories.Alias,
DefaultDisplayOrder: 30
},
"alias.nickname": {
FieldKey: "alias.nickname",
FieldType: "Text",
IsHidden: false,
IsMultiValue: false,
ApplicableToTypes: {
Alias: { ShowByDefault: true }
},
EnableHistory: false,
Category: FieldCategories.Alias,
DefaultDisplayOrder: 40
},
"alias.gender": {
FieldKey: "alias.gender",
FieldType: "Text",
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-36
View File
@@ -862,7 +862,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1033,23 +1032,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1990,7 +1972,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2161,23 +2142,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
-36
View File
@@ -830,7 +830,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1001,23 +1000,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1958,7 +1940,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2129,23 +2110,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -140,11 +140,6 @@ public static class FieldKey
/// </summary>
public const string AliasLastName = "alias.last_name";
/// <summary>
/// Type: Text
/// </summary>
public const string AliasNickname = "alias.nickname";
/// <summary>
/// Type: Text
/// </summary>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -862,7 +862,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1033,23 +1032,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1990,7 +1972,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2161,23 +2142,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -830,7 +830,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1001,23 +1000,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1958,7 +1940,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2129,23 +2110,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -354,7 +354,7 @@ namespace AliasClientDb.Migrations
// System fields now use FieldKey directly in FieldValues (no FieldDefinitions needed)
// Migrate Items from Credentials
// ItemType is 'Alias' if the credential has identity fields populated (first_name, last_name, nickname, gender, birthdate)
// ItemType is 'Alias' if the credential has identity fields populated (first_name, last_name, gender, birthdate)
// Email alone does not make an item an Alias - it's now a login field
// Note: BirthDate values starting with '0001-' are DateTime.MinValue (empty/unset)
migrationBuilder.Sql(@"
@@ -366,7 +366,6 @@ namespace AliasClientDb.Migrations
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -546,24 +545,6 @@ namespace AliasClientDb.Migrations
WHERE a.LastName IS NOT NULL AND a.LastName != '';
");
// Migrate alias.nickname field (system field using FieldKey)
migrationBuilder.Sql(@"
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
");
// Migrate alias.gender field (system field using FieldKey)
migrationBuilder.Sql(@"
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
@@ -824,7 +824,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -995,23 +994,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -153,7 +153,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -324,23 +323,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
-1
View File
@@ -26,7 +26,6 @@ export type Credential = {
export type Alias = {
FirstName?: string;
LastName?: string;
NickName?: string;
BirthDate: string;
Gender?: string;
Email?: string;
-6
View File
@@ -175,12 +175,6 @@ export const FieldKey = {
*/
AliasLastName: 'alias.last_name',
/**
* Alias nickname field
* Type: Text
*/
AliasNickname: 'alias.nickname',
/**
* Alias gender field
* Type: Text
-1
View File
@@ -93,7 +93,6 @@ export function itemToCredential(item: Item): Credential {
Alias: {
FirstName: getFieldValue(item, FieldKey.AliasFirstName),
LastName: getFieldValue(item, FieldKey.AliasLastName),
NickName: getFieldValue(item, FieldKey.AliasNickname),
BirthDate: getFieldValue(item, FieldKey.AliasBirthdate) || '',
Gender: getFieldValue(item, FieldKey.AliasGender),
Email: getFieldValue(item, FieldKey.LoginEmail)
@@ -143,18 +143,6 @@ export const SystemFieldRegistry: Record<string, SystemFieldDefinition> = {
Category: FieldCategories.Alias,
DefaultDisplayOrder: 30
},
'alias.nickname': {
FieldKey: 'alias.nickname',
FieldType: 'Text',
IsHidden: false,
IsMultiValue: false,
ApplicableToTypes: {
Alias: { ShowByDefault: true }
},
EnableHistory: false,
Category: FieldCategories.Alias,
DefaultDisplayOrder: 40
},
'alias.gender': {
FieldKey: 'alias.gender',
FieldType: 'Text',
-36
View File
@@ -831,7 +831,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -1002,23 +1001,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
@@ -1963,7 +1945,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
WHEN a.Id IS NOT NULL AND (
(a.FirstName IS NOT NULL AND a.FirstName != '') OR
(a.LastName IS NOT NULL AND a.LastName != '') OR
(a.NickName IS NOT NULL AND a.NickName != '') OR
(a.Gender IS NOT NULL AND a.Gender != '') OR
(a.BirthDate IS NOT NULL AND a.BirthDate != '' AND a.BirthDate NOT LIKE '0001-%')
) THEN 'Alias'
@@ -2134,23 +2115,6 @@ CREATE INDEX "IX_Tags_Name" ON "Tags" ("Name");
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,
c.Id AS ItemId,
NULL AS FieldDefinitionId,
'alias.nickname' AS FieldKey,
a.NickName AS Value,
0 AS Weight,
a.UpdatedAt AS CreatedAt,
a.UpdatedAt AS UpdatedAt,
0 AS IsDeleted
FROM Credentials c
INNER JOIN Aliases a ON a.Id = c.AliasId
WHERE a.NickName IS NOT NULL AND a.NickName != '';
INSERT INTO FieldValues (Id, ItemId, FieldDefinitionId, FieldKey, Value, Weight, CreatedAt, UpdatedAt, IsDeleted)
SELECT
lower(hex(randomblob(16))) AS Id,