Skip to content

Commit

Permalink
tweaks for mentions, notifications & conditions (#10184)
Browse files Browse the repository at this point in the history
  • Loading branch information
azrikahar authored and rijkvanzanten committed Dec 1, 2021
1 parent 66f36c1 commit 9b50e4f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
6 changes: 3 additions & 3 deletions docs/app/content-collections.md
Expand Up @@ -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

Expand All @@ -114,15 +114,15 @@ 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

**[Learn more about Filtering](/configuration/filter-rules/).**

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)
Expand Down
5 changes: 5 additions & 0 deletions docs/app/content-items.md
Expand Up @@ -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.
1 change: 1 addition & 0 deletions docs/app/overview.md
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions docs/app/user-directory.md
Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion docs/assets/app-overview.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 28 additions & 19 deletions docs/configuration/data-model.md
Expand Up @@ -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]**
Expand Down Expand Up @@ -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
Expand All @@ -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"

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.
- **`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.

::: 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.

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/filter-rules.md
Expand Up @@ -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)

```
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/system/users.md
Expand Up @@ -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">
Expand Down

0 comments on commit 9b50e4f

Please sign in to comment.