Skip to content
This repository was archived by the owner on Jan 10, 2022. It is now read-only.

Commit d05255a

Browse files
updated docs
1 parent 31c0cb2 commit d05255a

File tree

10 files changed

+178
-36
lines changed

10 files changed

+178
-36
lines changed

uadmin-docs/docs/admin-page/intro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type AdminPage struct {
5656
RegisteredHTTPHandlers bool
5757
NoPermissionToAddNew bool
5858
NoPermissionToEdit bool
59+
PermissionName CustomPermission
5960
}
6061
```
6162
The easiest way to create new admin page for Gorm is:

uadmin-docs/docs/api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ sidebar_position: 2
1919
- [Admin uadmin command](./commands/admin.md)
2020
- [Blueprint uadmin command](./commands/blueprint.md)
2121
- [Content type uadmin command](./commands/contenttype.md)
22+
- [DbShell uadmin command](./commands/dbshell.md)
2223
- [Generate fake data uadmin command](./commands/fake-data.md)
2324
- [Language uadmin command](./commands/language.md)
2425
- [Migrate uadmin command](./commands/migrate.md)
2526
- [OpenAPI uadmin command](./commands/openapi.md)
27+
- [Shell uadmin command](./commands/shell.md)
2628
- [Superuser uadmin command](./commands/superuser.md)
2729
- [Swagger uadmin command](./commands/swagger.md)
2830
- [**Config**](./config/intro.md)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# DbShell uadmin command
2+
3+
Using this command you may open db shell for your database
4+
5+
# Usage
6+
7+
To use it, execute following command:
8+
```bash
9+
./uadmin_binary dbshell
10+
```

uadmin-docs/docs/commands/shell.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Shell uadmin command
2+
3+
Using this command you may open go interactive shell
4+
5+
# Usage
6+
7+
To use it, execute following command:
8+
```bash
9+
./uadmin_binary shell
10+
```

uadmin-docs/docs/config/intro.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ type UadminConfig struct {
2626
InTests bool
2727
// you can use ConfigContent in your blueprint to initialize blueprint specific configs.
2828
ConfigContent []byte
29+
// debug tests mode for database, simplifies test debugging
30+
DebugTests bool
2931
}
3032
```
3133
An example of the config in the configs/sqlite.yml

uadmin-docs/docs/contribution.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
Contributing to Uadmin
6+
========================
7+
8+
Your contributions are more than welcome. Please read the following notes to
9+
know about the process.
10+
11+
Making Changes:
12+
---------------
13+
14+
Before pushing your changes, please make sure the tests and the linters pass:
15+
16+
* make fmt
17+
* make lint
18+
* make test
19+
20+
_Please note, make functional will create local network resources
21+
(bridges, namespaces, ...)_
22+
23+
Once ready push your changes to your Uadmin fork our CI will check your
24+
pull request.
25+
26+
We're much more likely to approve your changes if you:
27+
28+
* Add tests for new functionality.
29+
* Write a good commit message, please see how to write below.
30+
* Maintain backward compatibility.
31+
32+
How To Submit Code
33+
------------------
34+
35+
We use github.com's Pull Request feature to receive code contributions from
36+
external contributors. See
37+
https://help.github.com/articles/creating-a-pull-request/ for details on
38+
how to create a request.
39+
40+
Commit message format
41+
---------------------
42+
43+
The subject line of your commit should be in the following format:
44+
45+
area: summary
46+
47+
area :
48+
Indicates the area of the Uadmin to which the change applies :
49+
50+
* documentation
51+
* admin page inlines
52+
* etc
53+
54+
Feature request or bug report:
55+
------------------------------
56+
57+
Be sure to search for existing bugs before you create another one.
58+
Remember that contributions are always welcome!
59+
60+
https://github.com/sergeyglazyrindev/uadmin/issues
61+
62+
Core contributors:
63+
------------------
64+
65+
* Sergey Glazyrin (sergeyglazyrindev)
66+
67+
Contact
68+
-------
69+
70+
* Slack
71+
* https://gophers.slack.com/archives/C017ULYJHMZ
72+
* Telegram - uadmin_development
73+
* https://t.me/joinchat/VzgmokqjF7s4Nzk0
74+
* Discord
75+
* https://discord.gg/kADzHWatSj
76+
* Stack Overflow
77+
* https://stackoverflow.com/questions/tagged/uadmin

uadmin-docs/docs/databases/intro.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,52 @@ sidebar_position: 1
44

55
# Database support
66

7-
Right now uadmin supports only sqlite database, but it's easy to provide adapters for another databases, we just need to write implementation of the interface
7+
Right now uadmin supports only sqlite, postgres databases, but it's easy to provide adapters for another databases, we just need to write implementation of the interface
88
```go
99
type IDbAdapter interface {
1010
Equals(name interface{}, args ...interface{})
1111
GetDb(alias string, dryRun bool) (*gorm.DB, error)
1212
GetStringToExtractYearFromField(filterOptionField string) string
1313
GetStringToExtractMonthFromField(filterOptionField string) string
14-
Exact(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
15-
IExact(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
16-
Contains(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
17-
IContains(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
18-
In(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
19-
Gt(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
20-
Gte(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
21-
Lt(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
22-
Lte(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
23-
StartsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
24-
IStartsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
25-
EndsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
26-
IEndsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
27-
Range(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
28-
Date(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
29-
Year(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
30-
Month(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
31-
Day(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
32-
Week(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
33-
WeekDay(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
34-
Quarter(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
35-
Time(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
36-
Hour(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
37-
Minute(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
38-
Second(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
39-
IsNull(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
40-
Regex(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
41-
IRegex(operatorContext *GormOperatorContext, field *Field, value interface{}, forSearching bool)
14+
Exact(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
15+
IExact(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
16+
Contains(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
17+
IContains(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
18+
In(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
19+
Gt(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
20+
Gte(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
21+
Lt(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
22+
Lte(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
23+
StartsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
24+
IStartsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
25+
EndsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
26+
IEndsWith(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
27+
Range(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
28+
Date(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
29+
Year(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
30+
Month(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
31+
Day(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
32+
Week(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
33+
WeekDay(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
34+
Quarter(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
35+
Time(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
36+
Hour(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
37+
Minute(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
38+
Second(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
39+
IsNull(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
40+
Regex(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
41+
IRegex(operatorContext *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder)
4242
BuildDeleteString(table string, cond string, values ...interface{}) *DeleteRowStructure
43+
SetIsolationLevelForTests(db *gorm.DB)
44+
Close(db *gorm.DB)
45+
ClearTestDatabase()
46+
SetTimeZone(db *gorm.DB, timezone string)
47+
InitializeDatabaseForTests(databaseSettings *DBSettings)
48+
StartDBShell(databaseSettings *DBSettings) error
4349
}
4450
```
45-
and don't forget to handle this database type in the core.NewDbAdapter function.
51+
Please also create ci-cd job for new database type you are adding to the framework.
52+
And don't forget to handle this database type in the core.NewDbAdapter function.
4653
You can get instance of the uadminDatabase using function:
4754
```go
4855
type UadminDatabase struct {

uadmin-docs/docs/object-query-builder/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Mostly it's used to filter records in admin panel.
88
Each operator has to implement following interface:
99
```go
1010
type IGormOperator interface {
11-
Build(adapter IDbAdapter, context *GormOperatorContext, field *Field, value interface{}, forSearching bool) *GormOperatorContext
11+
Build(adapter IDbAdapter, context *GormOperatorContext, field *Field, value interface{}, SQLConditionBuilder *SQLConditionBuilder) *GormOperatorContext
1212
GetName() string
1313
RegisterDbHandlers(registerDbHandler IRegisterDbHandler) error
1414
TransformValue(value string) interface{}

uadmin-docs/docusaurus.config.js

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
55
/** @type {import('@docusaurus/types').DocusaurusConfig} */
66
(module.exports = {
77
title: 'Uadmin',
8-
tagline: 'Build projects in Go easily',
8+
tagline: 'Build projects in Go easily. Clean code. SOLID. Patterns.',
99
url: 'https://uadmindocs.sergeyg.me',
1010
baseUrl: '/',
1111
onBrokenLinks: 'throw',
@@ -65,11 +65,32 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6565
position: 'left',
6666
label: 'Api',
6767
},
68+
{
69+
type: 'doc',
70+
docId: 'contribution',
71+
position: 'left',
72+
label: 'Contributing',
73+
},
6874
{
6975
href: 'https://github.com/sergeyglazyrindev/uadmin',
7076
label: 'GitHub',
7177
position: 'right',
7278
},
79+
{
80+
href: 'https://gophers.slack.com/archives/C017ULYJHMZ',
81+
label: 'Slack',
82+
position: 'right',
83+
},
84+
{
85+
href: 'https://t.me/joinchat/VzgmokqjF7s4Nzk0',
86+
label: 'Telegram - uadmin_development',
87+
position: 'right',
88+
},
89+
{
90+
href: 'https://discord.gg/kADzHWatSj',
91+
label: 'Discord',
92+
position: 'right',
93+
},
7394
],
7495
},
7596
footer: {
@@ -82,14 +103,22 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
82103
label: 'Tutorial',
83104
to: '/docs/intro',
84105
},
106+
{
107+
label: 'API',
108+
to: '/docs/api',
109+
},
85110
],
86111
},
87112
{
88113
title: 'Community',
89114
items: [
90115
{
91-
label: 'Stack Overflow',
92-
href: 'https://stackoverflow.com/questions/tagged/uadmin',
116+
label: 'Slack',
117+
href: 'https://gophers.slack.com/archives/C017ULYJHMZ',
118+
},
119+
{
120+
label: 'Telegram - uadmin_development',
121+
href: 'https://t.me/joinchat/VzgmokqjF7s4Nzk0',
93122
},
94123
{
95124
label: 'Discord',
@@ -104,6 +133,10 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
104133
label: 'GitHub',
105134
href: 'https://github.com/sergeyglazyrindev/uadmin',
106135
},
136+
{
137+
label: 'Stack Overflow',
138+
href: 'https://stackoverflow.com/questions/tagged/uadmin',
139+
},
107140
],
108141
},
109142
],

uadmin-docs/src/components/HomepageFeatures.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const FeatureList = [
99
description: (
1010
<>
1111
Uadmin has been designed to simplify project development in Go. Almost everything needed for development integrated
12-
into the uadmin. You shouldn't worry about data migrations, uadmin provides you flexible migration system.
12+
into the uadmin. You shouldn't worry about data migrations, uadmin provides for you flexible migration system.
1313
</>
1414
),
1515
},
@@ -19,7 +19,7 @@ const FeatureList = [
1919
description: (
2020
<>
2121
Uadmin fully powered by blueprint methodology. Everything related to one domain system has to be written in one module called
22-
<a href="https://en.wikipedia.org/wiki/Software_blueprint" target="_blank">blueprint</a>.
22+
&nbsp;<a href="https://en.wikipedia.org/wiki/Software_blueprint" target="_blank">blueprint</a>.
2323
</>
2424
),
2525
},

0 commit comments

Comments
 (0)