test: add openapi spec, move menu button

This commit is contained in:
Barış Soner Uşaklı
2024-11-06 12:03:22 -05:00
parent 0c551fa240
commit 4b5cb613e5
8 changed files with 36 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
"delete-content": "Delete User(s) <strong>Content</strong>",
"purge": "Delete <strong>User(s)</strong> and <strong>Content</strong>",
"download-csv": "Download CSV",
"custom-user-fields": "Custom User Fields",
"manage-groups": "Manage Groups",
"set-reputation": "Set Reputation",
"add-group": "Add Group",

View File

@@ -12,7 +12,6 @@
"manage/privileges": "Privileges",
"manage/tags": "Tags",
"manage/users": "Users",
"manage/custom-user-fields": "Custom User Fields",
"manage/admins-mods": "Admins & Mods",
"manage/registration": "Registration Queue",
"manage/flagged-content": "Flagged Content",

View File

@@ -106,6 +106,8 @@ paths:
$ref: 'read/admin/manage/tags.yaml'
/api/admin/manage/users:
$ref: 'read/admin/manage/users.yaml'
/api/admin/manage/users/custom-fields:
$ref: 'read/admin/manage/users/custom-fields.yaml'
/api/admin/manage/registration:
$ref: 'read/admin/manage/registration.yaml'
/api/admin/manage/admins-mods:

View File

@@ -0,0 +1,27 @@
get:
tags:
- admin
summary: Manage custom fields for users
responses:
"200":
description: ""
content:
application/json:
schema:
allOf:
- type: object
properties:
fields:
type: array
items:
type: object
properties:
key:
type: string
name:
type: string
select-options:
type: string
type:
type: string
- $ref: ../../../../components/schemas/CommonProps.yaml#/CommonProps

View File

@@ -31,6 +31,8 @@ get:
type: string
allowCoverPicture:
type: boolean
customUserFields:
type: array
selectedGroup:
type: array
items:

View File

@@ -66,6 +66,8 @@ get:
type: number
title:
type: string
customUserFields:
type: array
editButtons:
type: array
items:

View File

@@ -81,6 +81,8 @@
<li><a class="dropdown-item rounded-1" href="#" data-action="create" role="menuitem">[[admin/manage/users:create]]</a></li>
{{{ if showInviteButton }}}<li><a class="dropdown-item rounded-1" href="#" component="user/invite" role="menuitem">[[admin/manage/users:invite]]</a></li>{{{ end }}}
<li><a target="_blank" href="#" class="dropdown-item rounded-1 export-csv" role="menuitem">[[admin/manage/users:download-csv]]</a></li>
<li><a class="dropdown-item rounded-1" href="{relative_path}/admin/manage/users/custom-fields">[[admin/manage/users:custom-user-fields]]</a>
</li>
</ul>
</div>
</div>

View File

@@ -38,7 +38,6 @@
{{{ end }}}
{{{ if user.privileges.admin:users }}}
<a class="btn btn-ghost btn-sm text-start" id="manage-users" href="{relative_path}/admin/manage/users">[[admin/menu:manage/users]]</a>
<a class="btn btn-ghost btn-sm text-start" id="manage-custom-user-fields" href="{relative_path}/admin/manage/users/custom-fields">[[admin/menu:manage/custom-user-fields]]</a>
{{{ end }}}
{{{ if user.privileges.admin:groups }}}
<a class="btn btn-ghost btn-sm text-start" href="{relative_path}/admin/manage/groups">[[admin/menu:manage/groups]]</a>