Updated via schema editor on 2025-09-02 18:42
This commit is contained in:
parent
c850aaacbd
commit
4e4e6063a0
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,8 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
*/node_modules/
|
*/node_modules/
|
||||||
*/build/
|
*/build/
|
||||||
|
|
||||||
|
**/node_modules/
|
||||||
|
**/build/
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
File diff suppressed because one or more lines are too long
@ -34,6 +34,7 @@ module.exports = class UsersDBApi {
|
|||||||
passwordResetTokenExpiresAt:
|
passwordResetTokenExpiresAt:
|
||||||
data.data.passwordResetTokenExpiresAt || null,
|
data.data.passwordResetTokenExpiresAt || null,
|
||||||
provider: data.data.provider || null,
|
provider: data.data.provider || null,
|
||||||
|
teams: data.data.teams || null,
|
||||||
importHash: data.data.importHash || null,
|
importHash: data.data.importHash || null,
|
||||||
createdById: currentUser.id,
|
createdById: currentUser.id,
|
||||||
updatedById: currentUser.id,
|
updatedById: currentUser.id,
|
||||||
@ -100,6 +101,7 @@ module.exports = class UsersDBApi {
|
|||||||
passwordResetToken: item.passwordResetToken || null,
|
passwordResetToken: item.passwordResetToken || null,
|
||||||
passwordResetTokenExpiresAt: item.passwordResetTokenExpiresAt || null,
|
passwordResetTokenExpiresAt: item.passwordResetTokenExpiresAt || null,
|
||||||
provider: item.provider || null,
|
provider: item.provider || null,
|
||||||
|
teams: item.teams || null,
|
||||||
importHash: item.importHash || null,
|
importHash: item.importHash || null,
|
||||||
createdById: currentUser.id,
|
createdById: currentUser.id,
|
||||||
updatedById: currentUser.id,
|
updatedById: currentUser.id,
|
||||||
@ -182,6 +184,8 @@ module.exports = class UsersDBApi {
|
|||||||
|
|
||||||
if (data.provider !== undefined) updatePayload.provider = data.provider;
|
if (data.provider !== undefined) updatePayload.provider = data.provider;
|
||||||
|
|
||||||
|
if (data.teams !== undefined) updatePayload.teams = data.teams;
|
||||||
|
|
||||||
updatePayload.updatedById = currentUser.id;
|
updatePayload.updatedById = currentUser.id;
|
||||||
|
|
||||||
await users.update(updatePayload, { transaction });
|
await users.update(updatePayload, { transaction });
|
||||||
@ -445,6 +449,13 @@ module.exports = class UsersDBApi {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filter.teams) {
|
||||||
|
where = {
|
||||||
|
...where,
|
||||||
|
[Op.and]: Utils.ilike('users', 'teams', filter.teams),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (filter.emailVerificationTokenExpiresAtRange) {
|
if (filter.emailVerificationTokenExpiresAtRange) {
|
||||||
const [start, end] = filter.emailVerificationTokenExpiresAtRange;
|
const [start, end] = filter.emailVerificationTokenExpiresAtRange;
|
||||||
|
|
||||||
|
|||||||
47
backend/src/db/migrations/1756837709519.js
Normal file
47
backend/src/db/migrations/1756837709519.js
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
module.exports = {
|
||||||
|
/**
|
||||||
|
* @param {QueryInterface} queryInterface
|
||||||
|
* @param {Sequelize} Sequelize
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
async up(queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* @type {Transaction}
|
||||||
|
*/
|
||||||
|
const transaction = await queryInterface.sequelize.transaction();
|
||||||
|
try {
|
||||||
|
await queryInterface.addColumn(
|
||||||
|
'users',
|
||||||
|
'teams',
|
||||||
|
{
|
||||||
|
type: Sequelize.DataTypes.TEXT,
|
||||||
|
},
|
||||||
|
{ transaction },
|
||||||
|
);
|
||||||
|
|
||||||
|
await transaction.commit();
|
||||||
|
} catch (err) {
|
||||||
|
await transaction.rollback();
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @param {QueryInterface} queryInterface
|
||||||
|
* @param {Sequelize} Sequelize
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
async down(queryInterface, Sequelize) {
|
||||||
|
/**
|
||||||
|
* @type {Transaction}
|
||||||
|
*/
|
||||||
|
const transaction = await queryInterface.sequelize.transaction();
|
||||||
|
try {
|
||||||
|
await queryInterface.removeColumn('users', 'teams', { transaction });
|
||||||
|
|
||||||
|
await transaction.commit();
|
||||||
|
} catch (err) {
|
||||||
|
await transaction.rollback();
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -68,6 +68,10 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
type: DataTypes.TEXT,
|
type: DataTypes.TEXT,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
teams: {
|
||||||
|
type: DataTypes.TEXT,
|
||||||
|
},
|
||||||
|
|
||||||
importHash: {
|
importHash: {
|
||||||
type: DataTypes.STRING(255),
|
type: DataTypes.STRING(255),
|
||||||
allowNull: true,
|
allowNull: true,
|
||||||
|
|||||||
@ -34,6 +34,9 @@ router.use(checkCrudPermissions('users'));
|
|||||||
* email:
|
* email:
|
||||||
* type: string
|
* type: string
|
||||||
* default: email
|
* default: email
|
||||||
|
* teams:
|
||||||
|
* type: string
|
||||||
|
* default: teams
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -314,7 +317,14 @@ router.get(
|
|||||||
currentUser,
|
currentUser,
|
||||||
});
|
});
|
||||||
if (filetype && filetype === 'csv') {
|
if (filetype && filetype === 'csv') {
|
||||||
const fields = ['id', 'firstName', 'lastName', 'phoneNumber', 'email'];
|
const fields = [
|
||||||
|
'id',
|
||||||
|
'firstName',
|
||||||
|
'lastName',
|
||||||
|
'phoneNumber',
|
||||||
|
'email',
|
||||||
|
'teams',
|
||||||
|
];
|
||||||
const opts = { fields };
|
const opts = { fields };
|
||||||
try {
|
try {
|
||||||
const csv = parse(payload.rows, opts);
|
const csv = parse(payload.rows, opts);
|
||||||
|
|||||||
@ -41,7 +41,7 @@ module.exports = class SearchService {
|
|||||||
throw new ValidationError('iam.errors.searchQueryRequired');
|
throw new ValidationError('iam.errors.searchQueryRequired');
|
||||||
}
|
}
|
||||||
const tableColumns = {
|
const tableColumns = {
|
||||||
users: ['firstName', 'lastName', 'phoneNumber', 'email'],
|
users: ['firstName', 'lastName', 'phoneNumber', 'email', 'teams'],
|
||||||
|
|
||||||
players: ['first_name', 'last_name'],
|
players: ['first_name', 'last_name'],
|
||||||
|
|
||||||
|
|||||||
1
frontend/json/runtimeError.json
Normal file
1
frontend/json/runtimeError.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@ -184,6 +184,13 @@ const CardUsers = ({
|
|||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className='flex justify-between gap-x-4 py-3'>
|
||||||
|
<dt className=' text-gray-500 dark:text-dark-600'>Teams</dt>
|
||||||
|
<dd className='flex items-start gap-x-2'>
|
||||||
|
<div className='font-medium line-clamp-4'>{item.teams}</div>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -120,6 +120,11 @@ const ListUsers = ({
|
|||||||
{dataFormatter.leaguesOneListFormatter(item.leagues)}
|
{dataFormatter.leaguesOneListFormatter(item.leagues)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={'flex-1 px-3'}>
|
||||||
|
<p className={'text-xs text-gray-500 '}>Teams</p>
|
||||||
|
<p className={'line-clamp-2'}>{item.teams}</p>
|
||||||
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<ListActionsPopover
|
<ListActionsPopover
|
||||||
onDelete={onDelete}
|
onDelete={onDelete}
|
||||||
|
|||||||
@ -179,6 +179,18 @@ export const loadColumns = async (
|
|||||||
params?.value?.id ?? params?.value,
|
params?.value?.id ?? params?.value,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'teams',
|
||||||
|
headerName: 'Teams',
|
||||||
|
flex: 1,
|
||||||
|
minWidth: 120,
|
||||||
|
filterable: false,
|
||||||
|
headerClassName: 'datagrid--header',
|
||||||
|
cellClassName: 'datagrid--cell',
|
||||||
|
|
||||||
|
editable: hasUpdatePermission,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'actions',
|
field: 'actions',
|
||||||
type: 'actions',
|
type: 'actions',
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export default function WebSiteFooter({ projectName }: WebSiteFooterProps) {
|
|||||||
|
|
||||||
const style = FooterStyle.WITH_PROJECT_NAME;
|
const style = FooterStyle.WITH_PROJECT_NAME;
|
||||||
|
|
||||||
const design = FooterDesigns.DEFAULT_DESIGN;
|
const design = FooterDesigns.DESIGN_DIVERSITY;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export default function WebSiteHeader({ projectName }: WebSiteHeaderProps) {
|
|||||||
const websiteHeder = useAppSelector((state) => state.style.websiteHeder);
|
const websiteHeder = useAppSelector((state) => state.style.websiteHeder);
|
||||||
const borders = useAppSelector((state) => state.style.borders);
|
const borders = useAppSelector((state) => state.style.borders);
|
||||||
|
|
||||||
const style = HeaderStyle.PAGES_LEFT;
|
const style = HeaderStyle.PAGES_RIGHT;
|
||||||
|
|
||||||
const design = HeaderDesigns.DEFAULT_DESIGN;
|
const design = HeaderDesigns.DEFAULT_DESIGN;
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -143,7 +143,7 @@ export default function WebSite() {
|
|||||||
<FeaturesSection
|
<FeaturesSection
|
||||||
projectName={'LeagueMule'}
|
projectName={'LeagueMule'}
|
||||||
image={['Icons representing league features']}
|
image={['Icons representing league features']}
|
||||||
withBg={1}
|
withBg={0}
|
||||||
features={features_points}
|
features={features_points}
|
||||||
mainText={`Unleash the Power of ${projectName}`}
|
mainText={`Unleash the Power of ${projectName}`}
|
||||||
subTitle={`Explore the innovative features of ${projectName} that make league management a breeze. Simplify your tasks and enhance your league experience.`}
|
subTitle={`Explore the innovative features of ${projectName} that make league management a breeze. Simplify your tasks and enhance your league experience.`}
|
||||||
|
|||||||
@ -82,6 +82,8 @@ const LeaguesView = () => {
|
|||||||
<th>E-Mail</th>
|
<th>E-Mail</th>
|
||||||
|
|
||||||
<th>Disabled</th>
|
<th>Disabled</th>
|
||||||
|
|
||||||
|
<th>Teams</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -105,6 +107,8 @@ const LeaguesView = () => {
|
|||||||
<td data-label='disabled'>
|
<td data-label='disabled'>
|
||||||
{dataFormatter.booleanFormatter(item.disabled)}
|
{dataFormatter.booleanFormatter(item.disabled)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td data-label='teams'>{item.teams}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -127,6 +127,8 @@ const RolesView = () => {
|
|||||||
<th>E-Mail</th>
|
<th>E-Mail</th>
|
||||||
|
|
||||||
<th>Disabled</th>
|
<th>Disabled</th>
|
||||||
|
|
||||||
|
<th>Teams</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -150,6 +152,8 @@ const RolesView = () => {
|
|||||||
<td data-label='disabled'>
|
<td data-label='disabled'>
|
||||||
{dataFormatter.booleanFormatter(item.disabled)}
|
{dataFormatter.booleanFormatter(item.disabled)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td data-label='teams'>{item.teams}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -95,6 +95,8 @@ const TeamsView = () => {
|
|||||||
|
|
||||||
<th>Disabled</th>
|
<th>Disabled</th>
|
||||||
|
|
||||||
|
<th>Teams</th>
|
||||||
|
|
||||||
<th>FirstName</th>
|
<th>FirstName</th>
|
||||||
|
|
||||||
<th>LastName</th>
|
<th>LastName</th>
|
||||||
@ -126,6 +128,8 @@ const TeamsView = () => {
|
|||||||
{dataFormatter.booleanFormatter(item.disabled)}
|
{dataFormatter.booleanFormatter(item.disabled)}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<td data-label='teams'>{item.teams}</td>
|
||||||
|
|
||||||
<td data-label='first_name'>{item.first_name}</td>
|
<td data-label='first_name'>{item.first_name}</td>
|
||||||
|
|
||||||
<td data-label='last_name'>{item.last_name}</td>
|
<td data-label='last_name'>{item.last_name}</td>
|
||||||
|
|||||||
@ -56,6 +56,8 @@ const EditUsers = () => {
|
|||||||
|
|
||||||
leagues: null,
|
leagues: null,
|
||||||
|
|
||||||
|
teams: '',
|
||||||
|
|
||||||
password: '',
|
password: '',
|
||||||
};
|
};
|
||||||
const [initialValues, setInitialValues] = useState(initVals);
|
const [initialValues, setInitialValues] = useState(initVals);
|
||||||
@ -187,6 +189,10 @@ const EditUsers = () => {
|
|||||||
></Field>
|
></Field>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
|
<FormField label='Teams'>
|
||||||
|
<Field name='teams' placeholder='Teams' />
|
||||||
|
</FormField>
|
||||||
|
|
||||||
<FormField label='Password'>
|
<FormField label='Password'>
|
||||||
<Field name='password' placeholder='password' />
|
<Field name='password' placeholder='password' />
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|||||||
@ -56,6 +56,8 @@ const EditUsersPage = () => {
|
|||||||
|
|
||||||
leagues: null,
|
leagues: null,
|
||||||
|
|
||||||
|
teams: '',
|
||||||
|
|
||||||
password: '',
|
password: '',
|
||||||
};
|
};
|
||||||
const [initialValues, setInitialValues] = useState(initVals);
|
const [initialValues, setInitialValues] = useState(initVals);
|
||||||
@ -185,6 +187,10 @@ const EditUsersPage = () => {
|
|||||||
></Field>
|
></Field>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
|
<FormField label='Teams'>
|
||||||
|
<Field name='teams' placeholder='Teams' />
|
||||||
|
</FormField>
|
||||||
|
|
||||||
<FormField label='Password'>
|
<FormField label='Password'>
|
||||||
<Field name='password' placeholder='password' />
|
<Field name='password' placeholder='password' />
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|||||||
@ -33,6 +33,7 @@ const UsersTablesPage = () => {
|
|||||||
{ label: 'Last Name', title: 'lastName' },
|
{ label: 'Last Name', title: 'lastName' },
|
||||||
{ label: 'Phone Number', title: 'phoneNumber' },
|
{ label: 'Phone Number', title: 'phoneNumber' },
|
||||||
{ label: 'E-Mail', title: 'email' },
|
{ label: 'E-Mail', title: 'email' },
|
||||||
|
{ label: 'Teams', title: 'teams' },
|
||||||
|
|
||||||
{ label: 'App Role', title: 'app_role' },
|
{ label: 'App Role', title: 'app_role' },
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,8 @@ const initialValues = {
|
|||||||
custom_permissions: [],
|
custom_permissions: [],
|
||||||
|
|
||||||
leagues: '',
|
leagues: '',
|
||||||
|
|
||||||
|
teams: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
const UsersNew = () => {
|
const UsersNew = () => {
|
||||||
@ -152,6 +154,10 @@ const UsersNew = () => {
|
|||||||
></Field>
|
></Field>
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|
||||||
|
<FormField label='Teams'>
|
||||||
|
<Field name='teams' placeholder='Teams' />
|
||||||
|
</FormField>
|
||||||
|
|
||||||
<BaseDivider />
|
<BaseDivider />
|
||||||
<BaseButtons>
|
<BaseButtons>
|
||||||
<BaseButton type='submit' color='info' label='Submit' />
|
<BaseButton type='submit' color='info' label='Submit' />
|
||||||
|
|||||||
@ -33,6 +33,7 @@ const UsersTablesPage = () => {
|
|||||||
{ label: 'Last Name', title: 'lastName' },
|
{ label: 'Last Name', title: 'lastName' },
|
||||||
{ label: 'Phone Number', title: 'phoneNumber' },
|
{ label: 'Phone Number', title: 'phoneNumber' },
|
||||||
{ label: 'E-Mail', title: 'email' },
|
{ label: 'E-Mail', title: 'email' },
|
||||||
|
{ label: 'Teams', title: 'teams' },
|
||||||
|
|
||||||
{ label: 'App Role', title: 'app_role' },
|
{ label: 'App Role', title: 'app_role' },
|
||||||
|
|
||||||
|
|||||||
@ -148,6 +148,11 @@ const UsersView = () => {
|
|||||||
<p>{users?.leagues?.name ?? 'No data'}</p>
|
<p>{users?.leagues?.name ?? 'No data'}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={'mb-4'}>
|
||||||
|
<p className={'block font-bold mb-2'}>Teams</p>
|
||||||
|
<p>{users?.teams}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<>
|
<>
|
||||||
<p className={'block font-bold mb-2'}>Teams Captain</p>
|
<p className={'block font-bold mb-2'}>Teams Captain</p>
|
||||||
<CardBox
|
<CardBox
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user