Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize documentation for the "how-tos" section #614

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/customize/metadata/custom_fields/records.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ RDM_CUSTOM_FIELDS_UI = [

You should add the `my_template.html` file in the `my-site/templates` folder in your instance. In your custom template, the following variables are injected and can be used:

- `field_value`: the value of the field, as it is stored in the record after the UI serialization i.e. what is returned from the `ui_field` method when you [define your custom field](../../../develop/howtos/custom_fields.md).
- `field_value`: the value of the field, as it is stored in the record after the UI serialization i.e. what is returned from the `ui_field` method when you [define your custom field](../../../howtos/custom_fields.md).
- `field_cfg`: the UI configuration for that specific field as it is defined in the `RDM_CUSTOM_FIELDS_UI` config.

See the example in the [How-to](../../../develop/howtos/custom_fields.md#define-the-template-for-the-record-landing-page).
See the example in the [How-to](../../../howtos/custom_fields.md#define-the-template-for-the-record-landing-page).

### Search

Expand Down
2 changes: 1 addition & 1 deletion docs/customize/other-pids/urns.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ XMETADISS_TYPE_DCTERMS_DCMITYPE = "openaire_type"
```

In order to fully implement xMetaDissPlus with all mandatory fields, the metadata definition has to be expanded by [custom
fields](../../develop/howtos/custom_fields.md).
fields](../../howtos/custom_fields.md).
At first add the file `thesis_types.yaml` to `/app_data/vocabularies` (you will find the content [here](https://raw.githubusercontent.com/ulbmuenster/invenio-dnb-urn/main/thesis_types.yaml)):

```yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/develop/best-practices/commits.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ When making your pull request, please keep the following in mind:
- Add tests and don't decrease test coverage.
- Add documentation.
- Follow our best practices:
- [Data migrations](../howtos/alembic.md)
- [Translation strings](../howtos/i18n.md)
- [Data migrations](../../howtos/alembic.md)
- [Translation strings](../../howtos/i18n.md)
- [CSS/JS](css-js.md) and [React](react.md)
- [Web accessibility](accessibility.md)
- [User interface](ui.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/best-practices/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ render() {

### On Overridable

See the [How to override UI React components](../howtos/override_components.md) how-to for detailed explanations on the library itself.
See the [How to override UI React components](../../howtos/override_components.md) how-to for detailed explanations on the library itself.

The library allows developers to mark components that can be overridden. While it is very easy to use, it can also lead to subtle errors.

Expand Down
12 changes: 2 additions & 10 deletions docs/develop/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Development guidelines for specific areas of development.
- [Commits, pull requests and reviews](best-practices/commits.md)
- [CSS/JavaScript](best-practices/css-js.md)
- [React](best-practices/react.md)
- [Translation (i18n)](howtos/i18n.md)
- [Translation (i18n)](../howtos/i18n.md)
- [User interface](best-practices/ui.md)

## Topics
Expand All @@ -44,15 +44,7 @@ Developer introductions to specific parts of the InvenioRDM source code:

Step-by-step guides on how to perform certain tasks:

- [Create a new custom field](howtos/custom_fields.md)
- [Create custom code and views](howtos/custom_code.md)
- [Add JavaScript](howtos/add_javascript.md)
- [Override UI React components](howtos/override_components.md)
- [Create search terms mappings](howtos/search_terms_migration.md)
- [Create a database migration](howtos/alembic.md)
- [Fix a vulnerability](howtos/security-fix.md)
- [Test emails locally](howtos/dev_email.md)
- [Migrate legacy routes](howtos/route_migration.md)
- [How to guides section](../howtos/index.md)

## Architecture

Expand Down
File renamed without changes.
59 changes: 59 additions & 0 deletions docs/howtos/administration/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Accessing the Administration Panel

The following detailing the administration panel setup, how to add users and its interface and usage.

## Prerequisites

To access the Administration Panel, users must be logged in with an administrator role. The admin role is key to performing administrative tasks and is assigned from the instance's owners.

## Setup

Setting up access to the Administration Panel involves configuring the instance, creating roles, allowing these roles, and assigning them to users by instance's owners.

### Configuration

Firstly, ensure that the Administration Panel is enabled in your instance by adding the following configuration in `invendio.cfg`:

```python
USERS_RESOURCES_ADMINISTRATION_ENABLED = True
```

### Creating and Allowing Roles

Execute the following commands to create the necessary roles and permissions:

```shell
# Create and allow the roles once (usually done in the instance setup)
invenio roles create administration-moderation
invenio roles create administration

invenio access allow administration-moderation role administration-moderation
invenio access allow administration-access role administration
invenio access allow superuser-access role administration
```

### Assigning Roles to Users

To grant a user access to the Administration Panel, assign the administration role:

```shell
# allow the user to access the administration panel
invenio roles add user@demo.org administration
```

You can assign the moderation role to a admin if you want to allow access the users moderation panel:

```shell
# allow the user to access the moderation tab
invenio roles add user@demo.org administration-moderation
```

replace `user@demo.org` with the email of the user you want to give access to the administration panel.

## More Information

You can find more information about the Administration Panel in the following sections:

- [Architecture](../../develop/topics/administration_panel.md/#administration-panel)

- [References](../../reference/administration_reference.md/#administration-reference-guide)
3 changes: 3 additions & 0 deletions docs/howtos/administration/interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Administration Interface

The administration interface is a powerful tool that allows you to manage your InvenioRDM instance. It is accessible to users with the role of administrator.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*Introduced in InvenioRDM v10*

This guide describes how to create your own custom field. If you have not done it yet, please read first about configuring [records custom fields](../../customize/metadata/custom_fields/records.md).
This guide describes how to create your own custom field. If you have not done it yet, please read first about configuring [records custom fields](../customize/metadata/custom_fields/records.md).
The new custom field in this example will extend the use case described in the records custom field documentation:

_When uploading a research preprint at CERN, I want to record the title and the research program of the related CERN experiments._
Expand Down Expand Up @@ -143,7 +143,7 @@ export class Experiments extends Component {
}
```

Since we added a new Javascript file, we need to [rebuild our assets](../../customize/look-and-feel/theme.md#automatic-re-build):
Since we added a new Javascript file, we need to [rebuild our assets](../customize/look-and-feel/theme.md#automatic-re-build):

```bash
$ invenio-cli assets build
Expand Down Expand Up @@ -214,10 +214,10 @@ $ pipenv run invenio rdm-records custom-fields init -f experiments

The new field will be displayed at the bottom of the upload form:

![Experiments field upload form](../img/new_custom_field_upload_form.png)
![Experiments field upload form](img/new_custom_field_upload_form.png)

### Record landing page

The new field will be displayed in the record landing page:

![Experiments field record landing page](../img/new_custom_field_landing_page.png)
![Experiments field record landing page](img/new_custom_field_landing_page.png)
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions docs/howtos/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# How-to Guides

Step-by-step guides on how to perform certain tasks:

## User Guides

Check out the [User Guides](https://help.zenodo.org/docs/) section on Zenodo.org.

## Instance Administrators

- [Accessing the Administration Panel](administration/index.md)
- [Moderate users](administration/interface.md)

## Development and Customization

- [Create a new custom field](custom_fields.md)
- [Create custom code and views](custom_code.md)
- [Add JavaScript](add_javascript.md)
- [Override UI React components](override_components.md)
- [Create search terms mappings](search_terms_migration.md)
- [Create a database migration](alembic.md)
- [Fix a vulnerability](security-fix.md)
- [Test emails locally](dev_email.md)
- [Migrate legacy routes](route_migration.md)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For this guide, we assume that you are familiar with React and JavaScript.
**Use it at your own risk!**

The UI of InvenioRDM is composed of classic HTML web pages for mostly static content, and React web apps for very dynamic content to enhance the user experience.
While a [dedicated guide](../../customize/look-and-feel/templates.md) describes how to override HTML web pages (Jinja templates), this guide focus on how to override React components.
While a [dedicated guide](../customize/look-and-feel/templates.md) describes how to override HTML web pages (Jinja templates), this guide focus on how to override React components.

InvenioRDM uses the React library [`react-overridable`](https://github.com/indico/react-overridable). The library provides a mechanism to mark React components as "overridable" by id.
Developers can define a map `{ id: Overridden React component }`, which is then applied when each React component is rendered: the overridden component is rendered instead of the default one.
Expand All @@ -35,7 +35,7 @@ At the moment, the easiest way to understand how to identify if the component th

You can then find the component in the InvenioRDM modules source code, searching it in your local development environment or using the search feature in GitHub in the [inveniosoftware organization](https://github.com/search?q=org%3Ainveniosoftware+FileUploaderToolbar&type=code).

You can always [ask for help](../../develop/getting-started/help.md)!
You can always [ask for help](../develop/getting-started/help.md)!

### Find the React Overridable ID

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ to determine the CVE score and select
## Step 5 - Identify supported versions

Next, identify all supported versions of the module using the
[branch management](../../maintenance/branch-management.md) and take note of which branch(es)
[branch management](../maintenance/branch-management.md) and take note of which branch(es)
you have to apply the fix to.

## Step 6 - Create a private temporary fork
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ designed to be compatible with the [COUNTER Code of Practice Release 4](https://
All information related to statistics (i.e. the raw events and aggregations) are stored
exclusively in search indices and not in the database, which makes search engine backups
much more relevant.
Some recommendations are given in the [how-to section](../develop/howtos/backup_search_indices.md).
Some recommendations are given in the [how-to section](../howtos/backup_search_indices.md).

## Inner workings

Expand Down
2 changes: 1 addition & 1 deletion docs/releases/upgrading/upgrade-v11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ You can see how to update your data in the [Funders vocabulary section](../../cu
### Update `my-site` folder

With InvenioRDM v11, the template to generate a new instance has been updated, adding more files and folders.
It is now easier to add [translations](../../contribute/translators-guide.md) and [custom code](../../develop/howtos/custom_code.md).
It is now easier to add [translations](../../contribute/translators-guide.md) and [custom code](../../howtos/custom_code.md).

To upgrade your running instance and have the same new files, the easiest way is to:

Expand Down
2 changes: 1 addition & 1 deletion docs/releases/versions/version-v10.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In addition to the many bugs fixed, this release introduces custom fields both f

You can now add custom fields to [bibliographic records](https://inveniordm.docs.cern.ch/customize/metadata/custom_fields/records/) and [communities](https://inveniordm.docs.cern.ch/customize/metadata/custom_fields/communities/) data models. InvenioRDM supports a wide variety of field types and UI widgets: you can find the full list in the [custom fields](https://inveniordm.docs.cern.ch/customize/custom_fields/records/#reference) and the [UI widgets](https://inveniordm.docs.cern.ch/reference/widgets/) documentation pages.

You can also extend the default components or implement your owns. To get more information, refer to the [custom fields development section](../../develop/howtos/custom_fields.md) in the documentation.
You can also extend the default components or implement your owns. To get more information, refer to the [custom fields development section](../../howtos/custom_fields.md) in the documentation.

#### Fields in the upload form

Expand Down
6 changes: 3 additions & 3 deletions docs/releases/versions/version-v11.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can try this feature out by changing the configuration variable `COMMUNITIES
With InvenioRDM v11, you can now add your own custom code and views directly to your instance,
without creating extra modules and adding them to the list of dependencies.

Discover how by reading the dedicated [How-to](../../develop/howtos/custom_code.md).
Discover how by reading the dedicated [How-to](../../howtos/custom_code.md).

### Override landing page template

Expand All @@ -57,13 +57,13 @@ You can read more on how to customize template in the [dedicated guide](../../cu
InvenioRDM now includes a redirector module. It allows an instance to define a mapping of URLs to redirect via a configuration variable.
This is particularly useful when migrating from an old instance to InvenioRDM.

See instructions on how to configure URL redirection in its [How-to](../../develop/howtos/route_migration.md).
See instructions on how to configure URL redirection in its [How-to](../../howtos/route_migration.md).

### Search query parser

Search fields and parameters may change overtime. You can now map legacy search terms into newer terms.

See instruction on how to add search terms mappings in its [How-to](../../develop/howtos/search_terms_migration.md).
See instruction on how to add search terms mappings in its [How-to](../../howtos/search_terms_migration.md).

### User visibility

Expand Down
29 changes: 17 additions & 12 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,6 @@ nav:
- Sanitize input data: develop/topics/validation.md
- Theming: develop/topics/theming.md
- Administration panel: develop/topics/administration_panel.md
- How-to guides:
- Translation (i18n): develop/howtos/i18n.md
- Create a new custom field: develop/howtos/custom_fields.md
- Create custom code and views: develop/howtos/custom_code.md
- Add JavaScript: "develop/howtos/add_javascript.md"
- Override UI React components: develop/howtos/override_components.md
- Create search terms mappings: develop/howtos/search_terms_migration.md
- Create a database migration: develop/howtos/alembic.md
- Fix a vulnerability: develop/howtos/security-fix.md
- Test emails locally: develop/howtos/dev_email.md
- Migrate legacy routes: develop/howtos/route_migration.md
- Back up search indices: develop/howtos/backup_search_indices.md
- Architecture:
- Introduction: develop/architecture/index.md
- Infrastructure: develop/architecture/infrastructure.md
Expand All @@ -135,6 +123,23 @@ nav:
- Optimistic concurrency control: develop/concepts/concurrency-control.md
- Database transaction management: develop/concepts/transactions.md
- Deploy: deploy/index.md
- How-tos:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 On L111 there is the "How-to guides" section already. On L110 there is the "Topic guides/Administration Panel". So those could go in either of them. There is something to be said about future overall doc organization though because of the span of things we want to cover and how they are not necessarily apparent to someone coming to the docs for answers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, you are right. The current guides, though useful, tend to fly under the radar for newcomers. My aim is to make it more visible to replicate Zenodo's approach while adding what Slint has mentioned on Discord,
Do you think it's feasible to move all guides up to consolidate all guides into this new section location, and maybe categorize them under regular users and administrators/developers, to enhance visibility and accessibility,
Otherwise, we keep the old section and nest the new recipes under it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's feasible to move all guides up to consolidate all guides into this new section location, and maybe categorize them under regular users and administrators/developers,

👍 I think that makes sense. @kpsherva suggested something in a similar vein here: #543 where the target audience is a bigger driver in the organization of the docs. I am not settled yet on what should be the top-level split: by features first and then audience or by audience first (which is sort of what we have but in verb form). Some experimentation here to be done for sure.

- How Tos: "howtos/index.md"
- Administration:
- Setup: "howtos/administration/index.md"
- Interface: "howtos/administration/interface.md"
- Development:
- Translation (i18n): howtos/i18n.md
- Create a new custom field: howtos/custom_fields.md
- Create custom code and views: howtos/custom_code.md
- Add JavaScript: "howtos/add_javascript.md"
- Override UI React components: howtos/override_components.md
- Create search terms mappings: howtos/search_terms_migration.md
- Create a database migration: howtos/alembic.md
- Fix a vulnerability: howtos/security-fix.md
- Test emails locally: howtos/dev_email.md
- Migrate legacy routes: howtos/route_migration.md
- Back up search indices: howtos/backup_search_indices.md
- Reference:
- Overview: reference/index.md
- CLI: reference/cli.md
Expand Down
Loading