# By: Riasat Ullah
# This file contains functions that will generate the context of components.

from constants import label_names as lbl
from constants import var_names

resource_maps = {
    lbl.res_actions_you_can_perform: 'https://taskcallapp.com/docs/incidents/v1/incident-actions',
    lbl.res_adding_a_user: 'https://taskcallapp.com/docs/users/v1/adding-removing-users',
    lbl.res_adding_service_integrations: 'https://taskcallapp.com/docs/services/v1/service-integrations',
    lbl.res_advanced_permissions: 'https://taskcallapp.com/docs/users/v1/advanced-permissions',
    lbl.res_api_keys: 'https://taskcallapp.com/docs/api-access/v1/api-keys',
    lbl.res_business_impact_visibility: 'https://taskcallapp.com/docs/services/v1/business-services#impact-visibility',
    lbl.res_business_services: 'https://taskcallapp.com/docs/services/v1/business-services',
    lbl.res_business_service_subscriptions: 'https://taskcallapp.com/docs/services/v1/business-services' +
                                            '#business-subscriptions',
    lbl.res_conditional_routing: 'https://taskcallapp.com/docs/noise-reduction/v1/conditional-routing',
    lbl.res_configuring_escalation_policies: 'https://taskcallapp.com/docs/escalation-policies/v1/escalation-policies',
    lbl.res_contextual_search_and_tagging: "https://taskcallapp.com/docs/incidents/v1/contextual-search-and-tagging",
    lbl.res_creating_custom_status_dashboards: 'https://taskcallapp.com/docs/stakeholder-communication/v1/' +
                                               'status-dashboards#custom-dashboards',
    lbl.res_creating_on_call_routines: 'https://taskcallapp.com/docs/routines/v1/routines',
    lbl.res_creating_services: 'https://taskcallapp.com/docs/services/v1/services',
    lbl.res_creating_teams: 'https://taskcallapp.com/docs/users/v1/teams',
    lbl.res_disabling_a_service: 'https://taskcallapp.com/docs/services/v1/services#enabling-disabling-service',
    lbl.res_editing_routines: 'https://taskcallapp.com/docs/routines/v1/routines-editing-and-overriding',
    lbl.res_editing_team_member_roles: 'https://taskcallapp.com/docs/users/v1/teams#edit-member-roles',
    lbl.res_github_change_events: 'https://taskcallapp.com/docs/change-events/v1/github-changes-integration-guide',
    lbl.res_gitlab_change_events: 'https://taskcallapp.com/docs/change-events/v1/gitlab-changes-integration-guide',
    lbl.res_heartbeat_monitoring: 'https://taskcallapp.com/docs/automation/v1/heartbeat-monitoring',
    lbl.res_how_to_trigger_an_incident: 'https://taskcallapp.com/docs/incidents/v1/incident-triggers',
    lbl.res_incidents_api: 'https://taskcallapp.com/docs/api-access/v1/incidents-api',
    lbl.res_incident_lifecycle: 'https://taskcallapp.com/docs/incidents/v1/what-is-an-incident#lifecycle',
    lbl.res_incident_status: 'https://taskcallapp.com/docs/incidents/v1/what-is-an-incident',
    lbl.res_incident_workflows: 'https://taskcallapp.com/docs/automation/v1/incident-workflows',
    lbl.res_live_call_routing_pricing: 'https://taskcallapp.com/docs/live-call-routing/v1/live-call-routing' +
                                       '#call-routing-pricing',
    lbl.res_mobilize_response: 'https://taskcallapp.com/docs/incidents/v1/response-sets',
    lbl.res_notifications_mechanism: 'https://taskcallapp.com/docs/incidents/v1/notifications-mechanism',
    lbl.res_on_call_schedule_examples: 'https://taskcallapp.com/docs/routines/v1/on-call-schedule-examples',
    lbl.res_overriding_routines: 'https://taskcallapp.com/docs/routines/v1/routines-editing-and-overriding' +
                                 '#routine-override-from-web-app',
    lbl.res_pre_scheduled_alerts: 'https://taskcallapp.com/docs/incidents/v1/pre-scheduled-alerts',
    lbl.res_schedule_service_maintenance: 'https://taskcallapp.com/docs/services/v1/service-maintenances',
    lbl.res_services_list: 'https://taskcallapp.com/docs/services/v1/services-list',
    lbl.res_setting_up_a_conference_bridge: 'https://taskcallapp.com/docs/conference-bridges/v1/conference-bridges',
    lbl.res_setting_up_live_call_routing: 'https://taskcallapp.com/docs/live-call-routing/v1/live-call-routing',
    lbl.res_setting_up_sso: 'https://taskcallapp.com/docs/sso/v1/single-sign-on',
    lbl.res_slack_integration_guide: 'https://taskcallapp.com/docs/integrations/v1/slack-integration-guide',
    lbl.res_special_actions: 'https://taskcallapp.com/docs/incidents/v1/incident-actions#merge',
    lbl.res_stakeholder_communication: 'https://taskcallapp.com/docs/stakeholder-communication/v1/status-dashboards',
    lbl.res_subscription_plans: 'https://taskcallapp.com/pricing',
    lbl.res_team_components: 'https://taskcallapp.com/docs/users/v1/teams#add-team-components',
    lbl.res_transfer_integration: 'https://taskcallapp.com/docs/services/v1/service-integrations' +
                                  '#transferring-integration',
    lbl.res_transfer_ownership: 'https://taskcallapp.com/docs/users/v1/adding-removing-users' +
                                '#transfer-account-ownership',
    lbl.res_user_roles: 'https://taskcallapp.com/docs/users/v1/user-roles',
    lbl.res_webex_integration_guide: 'https://taskcallapp.com/docs/conference-bridges/v1/webex-integration-guide',
    lbl.res_what_are_change_events: 'https://taskcallapp.com/docs/change-events/v1/change-events',
    lbl.res_zoom_integration_guide: 'https://taskcallapp.com/docs/conference-bridges/v1/zoom-integration-guide'
}


def get_resources_content(resources_items, context):
    '''
    Gets the content to show on the flexible part of the dashboard navigation bar.
    :param resources_items: (list) of names of resource items to display
    :param context: (dict) translated context
    :return: (dict) resource list content
    '''
    res_content = []
    for item in resources_items:
        res_content.append({var_names.name: context[item], var_names.url: resource_maps[item]})
    return res_content
