Denys Vuika 2854c17cd9
[ADF-5183] Upgrade to Angular 10 (#1506)
* upgrade preparation fixes

* remove fdescribe

* update browserlist config

* ng8

* ngrx 8

* ng9

* ngrx 9

* remove entryComponents

* unit tests

* ng 10

* latest ADF

* fix unit tests

* fix lint

* update deps and travis

* code fixes

* upgrade webdriver

* cleanup libs

* fix test

* update test

* Use browserTarget as target for lite-serve

* Use the update webdriver with CI condition

* Use version console.log('load', path

* Fix path sh

* Try to use remote env

* Add the . to export variabled

* Use hardcoded chrome version

* Remove the run remote

* Avoid to use the escape

* Skip flaky e2e and raise issue ACA-3615

* SKip failing e2e

* Skip flaky e2e and raise issue ACA-3615

* Fix close app toolbar menu and preconditions + tests of  mark-favorite.test.ts  Personal Files section

* Fix mark-favorite tests

* Fix ext-header test

* Fix new-menu tests

* Fix lint

* no message

* Fix viewer tests

Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
Co-authored-by: Cristina Jalba <cristina.jalba@ness.com>
2020-07-09 09:37:06 +01:00

5.0 KiB

Title, nav
Title nav
ナビゲーション ja

ナビゲーション

Alfresco Content Application は、次のナビゲーションリンクを提供します:

  • 個人用ファイル
  • ファイルライブラリ
  • 共有
  • 最近使用したファイル
  • お気に入り
  • ゴミ箱

サイドナビゲーションは、app.config.json を編集してリンクの外観をカスタマイズするサポートを提供します。

カスタマイズ

ナビゲーション設定は、スキーマのような配列とオブジェクトをサポートします。オブジェクトを定義すると、ナビゲーションがリンクの異なるグループ間の視覚的な区切り文字をレンダリングするのに役立ちます。

{
  "navigation": {
     "main": [
      ...
     ],
   "secondary": [
     ...
    ]
  }
}

{
  "navigation": [
    { ... },
    { ... },
    ...
  ]
}

アイコンとテキストをカスタマイズする

icon - サポートされる値は、Material Design アイコンライブラリの任意のものです。定義されていない場合、リンクはラベルの値のみをレンダリングします。

title - 指定された値でネイティブブラウザのツールチップをレンダリングするようにリンクに指示します。文字列または国際化定義の参照が可能です。定義されていない場合、リンクにはツールチップが表示されません。

label - リンクの視覚的な名前を表します。文字列または国際化定義の参照が可能です。

注意: "route": { "url": "/..." } の値を変更すると、これらはアプリケーションルーティングシステムにマッピングされるため、ナビゲーションに影響します。

カスタムテキスト (i18n)

ナビゲーションリンクの titlelabel を変更するには、/src/assets/i18n/en.json にある BROWSE エントリの下の値を編集します

"APP" : {
  ...
  "BROWSE": {
    "PERSONAL": {
    "TITLE": "Personal Files",
    "SIDENAV_LINK": {
        "LABEL": "Personal Files",
        "TOOLTIP": "View your Personal Files"
      }
    },
    ...
  }
}

国際化の詳細については、国際化 (i18n) セクションを参照してください。

ユーザー定義のナビゲーション

アプリケーションにカスタムナビゲーションリンクを追加するには、最初にコンポーネントを作成する必要があります。

src/app/components/custom-page/custom-page.component.ts

import { Component } from '@angular/core';

@Component({
template: `
    <h4>{{ title }}</h4>
    `
})
export class CustomPage {
    title = 'My Custom Page'
}

コンポーネントを app.module.ts に登録します


  ...
  import { CustomPage } from './components/custom-page/custom-page.component';

  @NgModule({
    ...
    declarations: [
        ...,
        CustomPage
    ],
    ...
})

app.config.json で、カスタムページを指すリンクエントリを定義します

{
  ...,
  "navigation": [
      "main": [ ... ],
      "secondary": [ ... ],
      "custom": [
        {
          "icon": "work",
          "label": "Link",
          "title": "My custom link",
          "route": {
              "url": "/custom-route"
          }
        }
      ]
  ]
}

これは ngrx ストアアクションを使用して宣言することもできます:

{
  ...,
  "navigation": [
      "main": [ ... ],
      "secondary": [ ... ],
      "custom": [
        {
          "icon": "work",
          "label": "Link",
          "title": "My custom link",
          "click": {
              "action": "NAVIGATE_ROUTE",
              "payload": "custom-route"
          }
        }
      ]
  ]
}

app.routes.ts/custom-routeLayoutComponent 定義の子としてマッピングします。


  import { CustomPage } from './components/custom-page/custom-page.component.ts';

  ...
  {
    path: '',
    component: LayoutComponent,
    children: [
     ...,
     {
        path: 'custom-route',
        component: CustomPage
      }
    ]
  }
  ...,

カスタムコンポーネントのレンダリング

ナビゲーション定義は、動的にレンダリングされるカスタムコンポーネントもサポートします。このスキーマは次のとおりです:

"navbar": [
  {
      "id": "app.navbar.primary",
      "items": [
            ...

          {
              "id": "custom-component",
              "component": "custom-menu-item"
          }

          ...
      ]
  }
]

カスタムページのコンテンツの詳細については、ドキュメントリストのレイアウト セクションを参照してください。