tweaks for mentions, notifications & conditions (#10184)

This commit is contained in:
Azri Kahar
2021-12-01 22:48:50 +08:00
committed by GitHub
parent 648b2d0e36
commit e25043dd96
8 changed files with 44 additions and 24 deletions

View File

@@ -96,7 +96,7 @@ features/options:
An excellent choice for temporal (date/time) data, this Layout allows you to choose between a Month, Week, Day, and List
view. The following options are included:
- Display Layout
- Display Template
- Start Date Field
- End Date Field
@@ -114,7 +114,7 @@ options are available:
1. Navigate to the [Content Module](/app/overview/#_1-module-bar)
2. Navigate to the collection of the items you want to search
3. Type your search query into the input located in the header
3. Type your search query into the input (magnifying glass icon) located in the header
## Filtering Items
@@ -122,7 +122,7 @@ options are available:
1. Navigate to the [Content Module](/app/overview/#_1-module-bar)
2. Navigate to the collection of the items you want to filter
3. Click "Advanced Filter" in the page sidebar
3. Click on Filter (filter icon) located in the header
4. Click the "Add Filter" dropdown and select the field to filter on
5. Adjust the operator (eg: "Contains") as needed by clicking on it
6. Enter a value in the field filter's input(s)

View File

@@ -91,3 +91,8 @@ icon) button located in the header.
4. Click "Comments" in the page sidebar
5. Type your message within the input
6. Click the "Submit" button
### Mentions
You can also mention any user by typing `@` along with their name or email in your comment. They will then receive a
notification which will direct them to your comment.

View File

@@ -20,6 +20,7 @@ The leftmost section of the App is the module bar, which includes the:
- [Insights](/app/insights) — Access to infinitely customizable data dashboards
- [App Guide](/app/overview/) — A tailored, in-app portal for the platform's concepts, guides, and reference
- [Settings](/app/settings) — An admin-only section for configuring the project and system settings
- **Notifications** - Opens a drawer of notifications, such as from [mentions](/app/content-items/#mentions).
- **Current User Menu** — This component displays the authenticated user's name and avatar.
- Sign Out — Hovering over the User Menu exposes the button to log out of the platform.

View File

@@ -36,6 +36,7 @@ by default.
- **Language** — The preferred App language/locale
- **Theme** — Light or Dark mode (or based on system preferences)
- **Multi-Factor Authentication** — Configuration for MFA
- **Email Notifications** - Receive emails for notifications
The sidebar's info component also includes the following readonly details:

View File

@@ -9,13 +9,14 @@
<path d="M69.1875 256L71.1562 258.016H80.0156V268H63.9844V256H69.1875ZM69.9844 253.984H63.9844C62.9062 253.984 62.0156 254.922 62.0156 256V268C62.0156 269.078 62.9062 270.016 63.9844 270.016H80.0156C81.0938 270.016 81.9844 269.078 81.9844 268V258.016C81.9844 256.891 81.0938 256 80.0156 256H72L69.9844 253.984Z" fill="#8196B1"/>
<path d="M71.0156 320.984H72.9844V323H71.0156V320.984ZM71.0156 325.016H72.9844V331.016H71.0156V325.016ZM72 316.016C66.4688 316.016 62.0156 320.469 62.0156 326C62.0156 331.531 66.4688 335.984 72 335.984C77.5312 335.984 81.9844 331.531 81.9844 326C81.9844 320.469 77.5312 316.016 72 316.016ZM72 334.016C67.5938 334.016 63.9844 330.406 63.9844 326C63.9844 321.594 67.5938 317.984 72 317.984C76.4062 317.984 80.0156 321.594 80.0156 326C80.0156 330.406 76.4062 334.016 72 334.016Z" fill="#8196B1"/>
<path d="M79.4531 390.984C79.4531 390.656 79.5 390.328 79.5 390C79.5 389.672 79.4531 389.344 79.4531 389.016L81.5625 387.375C81.75 387.234 81.7969 386.953 81.6562 386.719L79.6406 383.25C79.5469 383.109 79.4062 383.016 79.2188 383.016C79.1719 383.016 79.0781 383.016 79.0312 383.062L76.5469 384.047C76.0312 383.672 75.4688 383.297 74.8594 383.062L74.4844 380.438C74.4375 380.203 74.25 380.016 74.0156 380.016H69.9844C69.75 380.016 69.5625 380.203 69.5156 380.438L69.1406 383.062C68.5312 383.297 67.9688 383.672 67.4531 384.047L64.9688 383.062C64.875 383.016 64.8281 383.016 64.7812 383.016C64.5938 383.016 64.4531 383.109 64.3594 383.25L62.3438 386.719C62.2031 386.953 62.25 387.234 62.4375 387.375L64.5469 389.016C64.5469 389.344 64.5 389.672 64.5 390C64.5 390.328 64.5469 390.656 64.5469 390.984L62.4375 392.625C62.25 392.766 62.2031 393.047 62.3438 393.281L64.3594 396.75C64.4531 396.891 64.5938 396.984 64.7812 396.984C64.8281 396.984 64.9219 396.984 64.9688 396.938L67.4531 395.953C67.9688 396.328 68.5312 396.703 69.1406 396.938L69.5156 399.562C69.5625 399.797 69.75 399.984 69.9844 399.984H74.0156C74.25 399.984 74.4375 399.797 74.4844 399.562L74.8594 396.938C75.4688 396.703 76.0312 396.328 76.5469 395.953L79.0312 396.938C79.125 396.984 79.1719 396.984 79.2188 396.984C79.4062 396.984 79.5469 396.891 79.6406 396.75L81.6562 393.281C81.7969 393.047 81.75 392.766 81.5625 392.625L79.4531 390.984ZM77.4375 389.25C77.4844 389.578 77.4844 389.812 77.4844 390C77.4844 390.188 77.4844 390.422 77.4375 390.75L77.2969 391.875L78.1875 392.578L79.2656 393.422L78.5625 394.594L77.2969 394.078L76.2656 393.703L75.375 394.359C74.9531 394.688 74.5312 394.922 74.1094 395.109L73.0781 395.531L72.8906 396.656L72.7031 398.016H71.2969L71.1094 396.656L70.9688 395.531L69.8906 395.109C69.4688 394.922 69.0469 394.688 68.6719 394.359L67.7344 393.703L66.7031 394.125L65.4375 394.641L64.7344 393.422L65.8125 392.578L66.7031 391.875L66.5625 390.75C66.5156 390.422 66.5156 390.188 66.5156 390C66.5156 389.812 66.5156 389.578 66.5625 389.25L66.7031 388.125L65.8125 387.422L64.7344 386.578L65.4375 385.406L66.7031 385.922L67.7344 386.297L68.625 385.641C69.0469 385.312 69.4688 385.078 69.8906 384.891L70.9219 384.469L71.1094 383.344L71.2969 381.984H72.7031L72.8906 383.344L73.0312 384.469L74.1094 384.891C74.5312 385.078 74.9531 385.312 75.3281 385.641L76.2188 386.297L77.2969 385.875L78.5625 385.359L79.2656 386.578L78.1875 387.422L77.2969 388.125L77.4375 389.25ZM72 386.016C69.7969 386.016 68.0156 387.797 68.0156 390C68.0156 392.203 69.7969 393.984 72 393.984C74.2031 393.984 75.9844 392.203 75.9844 390C75.9844 387.797 74.2031 386.016 72 386.016ZM72 392.016C70.9219 392.016 69.9844 391.078 69.9844 390C69.9844 388.922 70.9219 387.984 72 387.984C73.0781 387.984 74.0156 388.922 74.0156 390C74.0156 391.078 73.0781 392.016 72 392.016Z" fill="#8196B1"/>
<path d="M75.868 451.574v-6c0-1.282-.359-2.344-1.078-3.188-.718-.875-1.687-1.312-2.906-1.312s-2.188.437-2.906 1.312c-.719.844-1.078 1.906-1.078 3.188v6zm2.016-1.032 2.016 2.016v.984H63.868v-.984l2.016-2.016v-4.968c0-1.563.391-2.922 1.172-4.078.812-1.157 1.922-1.907 3.328-2.25v-.704c0-.406.141-.75.422-1.031.281-.312.64-.47 1.078-.47.438 0 .797.158 1.078.47.281.28.422.625.422 1.03v.705c1.406.343 2.5 1.093 3.281 2.25.813 1.156 1.22 2.515 1.22 4.078zm-4.594 5.438a2.01 2.01 0 0 1-1.406.562c-.53 0-1-.187-1.406-.562-.406-.406-.61-.875-.61-1.406H73.9c0 .53-.204 1-.61 1.406z" fill="#8196B1"/>
<path d="M72 508.016C66.4688 508.016 62.0156 512.469 62.0156 518C62.0156 523.531 66.4688 527.984 72 527.984C77.5312 527.984 81.9844 523.531 81.9844 518C81.9844 512.469 77.5312 508.016 72 508.016ZM67.0781 524.281C67.5 523.391 70.125 522.5 72 522.5C73.875 522.5 76.5 523.391 76.9219 524.281C75.5625 525.359 73.875 526.016 72 526.016C70.125 526.016 68.4375 525.359 67.0781 524.281ZM78.375 522.828C76.9219 521.094 73.4531 520.484 72 520.484C70.5469 520.484 67.0781 521.094 65.625 522.828C64.6406 521.469 63.9844 519.828 63.9844 518C63.9844 513.594 67.5938 509.984 72 509.984C76.4062 509.984 80.0156 513.594 80.0156 518C80.0156 519.828 79.3594 521.469 78.375 522.828ZM72 512C70.0781 512 68.4844 513.547 68.4844 515.516C68.4844 517.438 70.0781 518.984 72 518.984C73.9219 518.984 75.5156 517.438 75.5156 515.516C75.5156 513.547 73.9219 512 72 512ZM72 517.016C71.1562 517.016 70.5 516.312 70.5 515.516C70.5 514.672 71.1562 514.016 72 514.016C72.8438 514.016 73.5 514.672 73.5 515.516C73.5 516.312 72.8438 517.016 72 517.016Z" fill="#8196B1"/>
<path d="M689 230H753V486H689V230Z" fill="#F0F4F9"/>
<path d="M689 38H743C748.523 38 753 42.4772 753 48V102H689V38Z" fill="#E4EAF1"/>
<path d="M689 102H753V166H689V102Z" fill="#E4EAF1"/>
<path d="M689 166H753V230H689V166Z" fill="#E4EAF1"/>
<path d="M689 486H753V540C753 545.523 748.523 550 743 550H689V486Z" fill="#E4EAF1"/>
<path d="M724.984 523.016V517.016C724.984 515.734 724.625 514.672 723.906 513.828C723.188 512.953 722.219 512.516 721 512.516C719.781 512.516 718.812 512.953 718.094 513.828C717.375 514.672 717.016 515.734 717.016 517.016V523.016H724.984ZM727 521.984L729.016 524V524.984H712.984V524L715 521.984V517.016C715 515.453 715.391 514.094 716.172 512.938C716.984 511.781 718.094 511.031 719.5 510.688V509.984C719.5 509.578 719.641 509.234 719.922 508.953C720.203 508.641 720.562 508.484 721 508.484C721.438 508.484 721.797 508.641 722.078 508.953C722.359 509.234 722.5 509.578 722.5 509.984V510.688C723.906 511.031 725 511.781 725.781 512.938C726.594 514.094 727 515.453 727 517.016V521.984ZM722.406 527.422C722 527.797 721.531 527.984 721 527.984C720.469 527.984 720 527.797 719.594 527.422C719.188 527.016 718.984 526.547 718.984 526.016H723.016C723.016 526.547 722.812 527.016 722.406 527.422Z" fill="#182B44"/>
<path d="M726 518c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm1.65 7.35-2.15-2.15V520h1v2.79l1.85 1.85zM727 509h-3.18c-.42-1.16-1.52-2-2.82-2-1.3 0-2.4.84-2.82 2H715c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h6.11a6.743 6.743 0 0 1-1.42-2H715v-15h2v3h8v-3h2v5.08c.71.1 1.38.31 2 .6V511c0-1.1-.9-2-2-2Zm-6 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z" fill="#182B44"/>
<path d="M720.016 64.9844H721.984V67H720.016V64.9844ZM720.016 69.0156H721.984V75.0156H720.016V69.0156ZM721 60.0156C715.469 60.0156 711.016 64.4688 711.016 70C711.016 75.5312 715.469 79.9844 721 79.9844C726.531 79.9844 730.984 75.5312 730.984 70C730.984 64.4688 726.531 60.0156 721 60.0156ZM721 78.0156C716.594 78.0156 712.984 74.4062 712.984 70C712.984 65.5938 716.594 61.9844 721 61.9844C725.406 61.9844 729.016 65.5938 729.016 70C729.016 74.4062 725.406 78.0156 721 78.0156Z" fill="#182B44"/>
<path d="M721 140.562L713.641 134.797L712 136.062L721 143.047L730 136.062L728.359 134.797L721 140.562ZM721 137.984L728.359 132.266L730 131L721 124.016L712 131L713.641 132.266L721 137.984ZM721 126.547L726.719 131L721 135.453L715.281 131L721 126.547Z" fill="#182B44"/>
<path d="M715 198.984V197.016H727V198.984H715ZM712 192H730V194.016H712V192ZM718.984 204V201.984H723.016V204H718.984Z" fill="#182B44"/>

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -154,7 +154,6 @@ is highly configurable, with the following field options:
- **Grouping** — Fields can be organized within different nested groups that are created using the normal Creating a
Field flow. Different style groupings are available for different use-cases.
## Creating a Field (Standard)
1. Navigate to **Settings > Data Model > [Collection Name]**
@@ -263,6 +262,7 @@ Each field can have one or more _rules_. Each rule has the following configurati
[Filter Rules](/configuration/filter-rules) spec
- **Readonly**: Whether or not the field is readonly when the condition is matched
- **Hidden**: Whether or not the field is hidden when the condition is matched
- **Required**: Whether or not the field is required when the condition is matched
- **Interface Options**: Any additional configuration for the selected interface
These changes to the field are merged onto the base configuration of the field. This means you can have the field hidden
@@ -276,30 +276,39 @@ The conditions are matched in order. The **last** condition that matches is the
## Creating Translated Multilingual Fields
While you could create individual fields for each translation, such as `title_english`, `title_german`, `title_french`, and so on, this is not easily extensible, and creates a less than ideal form layout. Instead, you can use the Directus _relational_ [Translations O2M](/configuration/relationships/#translations-o2m) interface. This uses a separate collection to store an endless number of translations, and a separate collection of languages that can easily be added to without having to change the schema.
While you could create individual fields for each translation, such as `title_english`, `title_german`, `title_french`,
and so on, this is not easily extensible, and creates a less than ideal form layout. Instead, you can use the Directus
_relational_ [Translations O2M](/configuration/relationships/#translations-o2m) interface. This uses a separate
collection to store an endless number of translations, and a separate collection of languages that can easily be added
to without having to change the schema.
Let's take a look at a basic example for "Articles":
* **`articles` Collection**
* `id` — (Primary Key)
* `author` — Field that is not translated
* `date_published` — Field that is not translated
* `translations` — A O2M relational field to `article_translations`
* **`article_translations` Collection**
* `id` — (Primary Key)
* `article` — The key of the article this belongs to
* `language` — The language key of this translation
* `title` — The translated Article Title
* `text` — The translated Article Text
* **`languages` Collection**
* `language_code` — (Primary Key) eg: "en-US"
* `name` — The language name, eg: "English"
- **`articles` Collection**
- `id` — (Primary Key)
- `author` — Field that is not translated
- `date_published` — Field that is not translated
- `translations` — A O2M relational field to `article_translations`
- **`article_translations` Collection**
- `id` — (Primary Key)
- `article` — The key of the article this belongs to
- `language` — The language key of this translation
- `title` — The translated Article Title
- `text` — The translated Article Text
- **`languages` Collection**
- `language_code` — (Primary Key) eg: "en-US"
- `name` — The language name, eg: "English"
As you can see above, you add **non-translated** fields, such as the `author` and `publish_date`, to the parent collection. Any **multilingual** fields, such as Title or Text, should be added directly to the Translation Collection. You can not simply drag or shift fields from the parent to translations, they must be _created_ in the correct collection.
As you can see above, you add **non-translated** fields, such as the `author` and `publish_date`, to the parent
collection. Any **multilingual** fields, such as Title or Text, should be added directly to the Translation Collection.
You can not simply drag or shift fields from the parent to translations, they must be _created_ in the correct
collection.
::: tip Translating Parent Fields
To make an existing parent field translatable, you can choose "Duplicate Field" from its context menu, move it to the translation collection, and then delete the parent field. However, be aware that this does **not** maintain any existing field values in the process.
To make an existing parent field translatable, you can choose "Duplicate Field" from its context menu, move it to the
translation collection, and then delete the parent field. However, be aware that this does **not** maintain any existing
field values in the process.
:::

View File

@@ -8,7 +8,7 @@
## Syntax
- **Field** — Any valid root field, [relational field](#relational), or [logical operator](#logical-operators)
- **Operator** — Any valid [API operator](#supported-operators) prefaced with an underscore
- **Operator** — Any valid [filter operator](#filter-operators)
- **Value** — Any valid static value, or [dynamic variable](#dynamic-variables)
```
@@ -81,7 +81,7 @@ The following operators are **only available in validation permissions**:
| `_submitted` | Field has to be submitted |
| `_regex` <sup>[2]</sup> | Field has to match regex |
<sup>[1]</sup> Only available on Geometry types\
<sup>[1]</sup> Only available on Geometry types.\
<sup>[2]</sup> JavaScript "flavor" regex. Make sure to escape backslashes.
## Relational

View File

@@ -66,6 +66,9 @@ One of `auto`, `light`, `dark`.
`tfa_secret` **string**\
When TFA is enabled, this holds the secret key for it.
`email_notifications` **boolean**\
When this is enabled, the user will receive emails for notifications.
</div>
</div>
<div class="right">