第 2 レベルのカードのヘッダーラベルを変更する

  • リリースバージョン: Washingtondc
  • 更新日 2024年02月01日
  • 読む4読むのに数分
  • [概要] セクションで第 1 レベルのドーナツ領域を選択したときに表示される第 2 レベルのカードのヘッダーラベルを変更します。

    始める前に

    必要なロール:admin

    このタスクについて

    [概要] セクションで第 1 レベルのカードのドーナツ領域を選択するたびに、第 2 レベルのカードのヘッダーラベルが変更され、そのドーナツ領域のデータに対応します。

    手順

    1. [すべて] メニューで、[sys_ux_client_script_include.list] に移動します。
    2. 階層 1 のランディングページで次の手順を実行します。
      1. [UX クライアントスクリプトインクルード] リストから、[SowIncidentLandingPageUtils] スクリプトインクルード定義を選択します。
      2. [UX クライアントスクリプトインクルード] フォームで、[スクリプト] フィールドの [labelMap] 値を編集します。必ずクラス SowIncidentLandingPageUtils の内側にコードを追加してください。

        インシデントの例を示します。

        {     
        const labelMap = { 
        
                'incident': { 
        
                    'state': { 
        
                        '1': 'New incidents assigned to me', 
        
                        '2': 'In Progress incidents assigned to me', 
        
                        '3': 'On Hold incidents assigned to me', 
        
                        '6': 'Resolved incidents assigned to me' 
        
                    }, 
        
                    'priority': { 
        
                        '1': 'P1 unassigned incidents', 
        
                        '2': 'P2 unassigned incidents', 
        
                        '3': 'P3 unassigned incidents', 
        
                        '4': 'P4 unassigned incidents', 
        
                        '5': 'P5 unassigned incidents' 
        
                    } 
        
                }, 
        
                'sc_task': { 
        
                    'state': { 
        
                        '-5': 'Pending catalog tasks assigned to me', 
        
                        '1': 'Open catalog tasks assigned to me', 
        
                        '2': 'Work in progress catalog tasks assigned to me' 
        
                    } 
        
                } 
        
            }; 
      3. [更新] を選択します。
    3. 階層 2 のランディングページで次の手順を実行します。
      1. [UX クライアントスクリプトインクルード] リストから、[SOWLandingPageTier2Utils] スクリプトインクルード定義を選択します。
      2. [UX クライアントスクリプトインクルード] フォームで、[スクリプト] フィールドの [labelMap] 値を編集します。必ずクラス SOWLandingPageTier2Utils の内側にコードを追加してください。
        例を示します。
        const labelMap = {
                'incident': {
                    '1': 'New incidents',
                    '2': 'In Progress incidents',
                    '3': 'On Hold incidents',
                    '6': 'Resolved incidents'
                },
                'change_request': {
                    '0': 'In Review changes',
                    '-1': 'Implement changes',
                    '-2': 'Scheduled changes',
                    '-3': 'Authorize changes',
                    '-4': 'Assess changes',
                    '-5': 'New changes'
                },
                'problem': {
                    '101': 'New problems',
                    '102': 'Assess problems',
                    '106': 'Resolved problems',
                    '104': 'Fix in Progress problems',
                    '103': 'Root Cause Analysis problems'
                },
                'task': {
                    'incident_task': 'Incident tasks',
                    'problem_task': 'Problem tasks',
                    'change_task': 'Change tasks',
                    'sc_task': 'Catalog tasks',
                }
            };
        
                static async fetchTitle(table, nameValueMap, groupMode = false) {
                    if(table === "task") {
                        return this.getLabelMaps(table, nameValueMap['sys_class_name'], groupMode);
                    }
                    return this.getLabelMaps(table, nameValueMap['state'], groupMode);
                }
        
                static getLabelMaps(table, selectedField, groupMode = false) {
                    if (groupMode)
                        return labelMap[table][selectedField] + ' assigned to my team';
                    return labelMap[table][selectedField] + ' assigned to me';
                }
      3. [更新] を選択します。