Browse Source

Merge branch 'master' of https://github.com/nocodb/nocodb

pull/917/head
Raju Udava 3 years ago
parent
commit
3a2cd8c6fa
  1. 17
      packages/nc-gui/components/import/templateParsers/ExcelTemplateAdapter.js
  2. 2
      packages/nc-gui/components/project/spreadsheet/components/cell.vue
  3. 124
      packages/noco-docs/content/en/setup-and-usages/user-management.md

17
packages/nc-gui/components/import/templateParsers/ExcelTemplateAdapter.js

@ -33,7 +33,7 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
parse() {
const tableNamePrefixRef = {}
for (let i = 0; i < this.wb.SheetNames.length; i++) {
const columnNamePrefixRef = {}
const columnNamePrefixRef = { id: 0 }
const sheet = this.wb.SheetNames[i]
let tn = sheet
if (tn in tableNamePrefixRef) {
@ -51,18 +51,18 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
// const colLen = Math.max()
for (let col = 0; col < rows[0].length; col++) {
let cn = (rows[0][col] ||
`field${col + 1}`).replace(/\./, '_').trim()
let cn = ((rows[0] && rows[0][col] && rows[0][col].toString().trim()) ||
`field${col + 1}`).replace(/\W/g, '_').trim()
if (cn in columnNamePrefixRef) {
cn = `${cn}${++columnNamePrefixRef[cn]}`
} else {
columnNamePrefixRef[cn] = 0
}
const column = {
cn
}
// const cellId = `${col.toString(26).split('').map(s => (parseInt(s, 26) + 10).toString(36).toUpperCase())}2`;
const cellId = XLSX.utils.encode_cell({
c: range.s.c + col,
@ -86,22 +86,22 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
if (checkboxType.length === 1) {
column.uidt = UITypes.Checkbox
} else {
vals = vals.filter(v => v !== null && v !== undefined)
vals = vals.filter(v => v !== null && v !== undefined).map(v => v.toString().trim())
// check column is multi or single select by comparing unique values
// todo:
if (vals.some(v => v && v.toString().includes(','))) {
const flattenedVals = vals.flatMap(v => v ? v.toString().split(',') : [])
const flattenedVals = vals.flatMap(v => v ? v.toString().trim().split(/\s*,\s*/) : [])
const uniqueVals = new Set(flattenedVals)
if (flattenedVals.length > uniqueVals.size && uniqueVals.size <= Math.ceil(flattenedVals.length / 2)) {
column.uidt = UITypes.MultiSelect
column.dtxp = [...uniqueVals].join(',')
column.dtxp = `'${[...uniqueVals].join("','")}'`
}
} else {
const uniqueVals = new Set(vals)
if (vals.length > uniqueVals.size && uniqueVals.size <= Math.ceil(vals.length / 2)) {
column.uidt = UITypes.SingleSelect
column.dtxp = [...uniqueVals].join(',')
column.dtxp = `'${[...uniqueVals].join("','")}'`
}
}
}
@ -154,7 +154,6 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
}
this.data[sheet].push(rowData)
}
this.project.tables.push(table)
}
}

2
packages/nc-gui/components/project/spreadsheet/components/cell.vue

@ -47,7 +47,7 @@ export default {
<style scoped>
.long-text-cell {
white-space: pre;
white-space: break-spaces;
}
</style>
<!--

124
packages/noco-docs/content/en/setup-and-usages/user-management.md

@ -9,77 +9,87 @@ menuTitle: 'User Management - Team & Auth Roles & Permissions'
## How to Add a User
On the left panel, click on "Team & Auth":
![image](https://user-images.githubusercontent.com/55474996/142497814-c52e12e5-5ab5-41e7-ac48-2b6af5f31fdd.png)
Make sure you are on the "Users Management" tab. Click on "New User":
![image](https://user-images.githubusercontent.com/55474996/142498070-60c5a861-0e8e-49e9-8830-42f54aa1fbf1.png)
Enter the person's email, select their user role, and hit "Invite":
![image](https://user-images.githubusercontent.com/55474996/142498163-032187e4-d375-4542-8211-e986880a2bb0.png)
If you do not have an SMTP sender configured, make sure to copy the invite link and manually send it to your collaborator:
![image](https://user-images.githubusercontent.com/55474996/142498376-ff52276b-92d8-4aca-8c47-fd7efea50ab6.png)
## Explanation of User Role Permissions
> TODO
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Access/view the entire base | . | . | . | . | . |
### Record actions
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Comment on records | . | . | . | . | . |
| Add, delete, modify records | . | . | . | . | . |
### View actions
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Add, delete, modify table views | . | . | . | . | . |
| Lock and unlock table views | . | . | . | . | . |
| Delete other collaborators' personal views | . | . | . | . | . |
### Column actions
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Add, delete, rename and customize columns | . | . | . | . | . |
### Table actions
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Add, delete, and rename tables | . | . | . | . | . |
### Other actions
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Create or remove a view share link | . | . | . | . | . |
| Rename the project | . | . | . | . | . |
| Create or remove a project collaborator invite link | . | . | . | . | . |
### Advanced options & configurations
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
| Audit | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| App Store | :white_check_mark: | :x: | :x: | :x: | :x: |
| Team & Auth | :white_check_mark: | :x: | :x: | :x: | :x: |
| Project Metadata | :white_check_mark: | :x: | :x: | :x: | :x: |
| New user: Add Owner | :white_check_mark: | :x: | :x: | :x: | :x: |
| New user: Add Creator | :white_check_mark: | :x: | :x: | :x: | :x: |
| New user: Add Editor | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| New user: Add Commenter | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| New user: Add Viewer | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| View existing users | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Preview mode | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| SQL Client | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
### Schema options
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
| Add table | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Delete table | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Modify table | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Add column | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Delete column | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Modify column | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
### Record options
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
| Add row | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| Delete row | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| Modify row/ cell | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| Expand row | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| Right click on cell (add/edit row) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| View table data (cell) contents | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
### Comments
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
| View comments from others | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| Add comments | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
### Views
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
| Create new view | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| Share view | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
### Project generals
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
| Created views access | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Filter fields/ Column | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Filter fields/ Query | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Sort fields | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Theme | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Auth token | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Project Info | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Swagger API | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
### Automations
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Create, delete, or duplicate an automation | . | . | . | . | . |
| Configure an automation | . | . | . | . | . |
| Rename an automation | . | . | . | . | . |
| Edit an automation description | . | . | . | . | . |
| View automation configuration | . | . | . | . | . |
| Copy automation URL | . | . | . | . | . |
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |
### App store
| | Owner | Creator | Editor | Commenter | Viewer |
|---|---|---|---|---|---|
| Install an app | . | . | . | . | . |
| Configure an app's settings | . | . | . | . | . |
| Uninstall an app | . | . | . | . | . |
| | &nbsp; &nbsp; Owner &nbsp; &nbsp;| &nbsp; &nbsp; Creator &nbsp; &nbsp; | &nbsp; &nbsp; Editor &nbsp; &nbsp;| Commenter | &nbsp; &nbsp; Viewer &nbsp; &nbsp;|
| :-- | :-: | :-: | :-: | :-: | :-: |

Loading…
Cancel
Save