<commit_before>/*************************************************
 * Copyright (c) 2015 Ansible, Inc.
 *
 * All Rights Reserved
 *************************************************/

 /**
 * @ngdoc function
 * @name forms.function:Groups
 * @description This form is for adding/editing a Group on the inventory page
*/

export default ['NotificationsList', 'i18n', function(NotificationsList, i18n){

    var notifications_object = {
        name: 'notifications',
        index: false,
        basePath: "notifications",
        include: "NotificationsList",
        title: i18n._('Notifications'),
        iterator: 'notification',
        ngIf: "!(inventory_source_obj.source === undefined || inventory_source_obj.source === '')",
        generateList: true,
        ngClick: "$state.go('inventories.edit.inventory_sources.edit.notifications')"
        // search: {
        //     "or__job__inventory": ''
        // }
    };
    let clone = _.clone(NotificationsList);
    notifications_object = angular.extend(clone, notifications_object);
return {
    addTitle: i18n._('CREATE SOURCE'),
    editTitle: '{{ name }}',
    showTitle: true,
    name: 'inventory_source',
    basePath: 'inventory_sources',
    parent: 'inventories.edit.sources',
    // the parent node this generated state definition tree expects to attach to
    stateTree: 'inventories',
    tabs: true,
    // form generator inspects the current state name to determine whether or not to set an active (.is-selected) class on a form tab
    // this setting is optional on most forms, except where the form's edit state name is not parentStateName.edit
    activeEditState: 'inventories.edit.inventory_sources.edit',
    detailsClick: "$state.go('inventories.edit.inventory_sources.edit')",
    well: false,
    subFormTitles: {
        sourceSubForm: i18n._('Source Details'),
    },
    fields: {
        name: {
            label: i18n._('Name'),
            type: 'text',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            required: true,
            tab: 'properties'
        },
        description: {
            label: i18n._('Description'),
            type: 'text',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            tab: 'properties'
        },
        source: {
            label: i18n._('Source'),
            type: 'select',
            required: true,
            ngOptions: 'source.label for source in source_type_options track by source.value',
            ngChange: 'sourceChange(source)',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            ngModel: 'source',
            hasSubForm: true
        },
        credential: {
            label: i18n._('Credential'),
            type: 'lookup',
            list: 'CredentialList',
            basePath: 'credentials',
            ngShow: "source && source.value !== '' && source.value !== 'custom'",
            sourceModel: 'credential',
            sourceField: 'name',
            ngClick: 'lookupCredential()',
            awRequiredWhen: {
                reqExpression: "cloudCredentialRequired",
                init: "false"
            },
            subForm: 'sourceSubForm',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            watchBasePath: "credentialBasePath"<commit_msg>Show credential lookup when source is 'custom'<commit_after>/*************************************************
 * Copyright (c) 2015 Ansible, Inc.
 *
 * All Rights Reserved
 *************************************************/

 /**
 * @ngdoc function
 * @name forms.function:Groups
 * @description This form is for adding/editing a Group on the inventory page
*/

export default ['NotificationsList', 'i18n', function(NotificationsList, i18n){

    var notifications_object = {
        name: 'notifications',
        index: false,
        basePath: "notifications",
        include: "NotificationsList",
        title: i18n._('Notifications'),
        iterator: 'notification',
        ngIf: "!(inventory_source_obj.source === undefined || inventory_source_obj.source === '')",
        generateList: true,
        ngClick: "$state.go('inventories.edit.inventory_sources.edit.notifications')"
        // search: {
        //     "or__job__inventory": ''
        // }
    };
    let clone = _.clone(NotificationsList);
    notifications_object = angular.extend(clone, notifications_object);
return {
    addTitle: i18n._('CREATE SOURCE'),
    editTitle: '{{ name }}',
    showTitle: true,
    name: 'inventory_source',
    basePath: 'inventory_sources',
    parent: 'inventories.edit.sources',
    // the parent node this generated state definition tree expects to attach to
    stateTree: 'inventories',
    tabs: true,
    // form generator inspects the current state name to determine whether or not to set an active (.is-selected) class on a form tab
    // this setting is optional on most forms, except where the form's edit state name is not parentStateName.edit
    activeEditState: 'inventories.edit.inventory_sources.edit',
    detailsClick: "$state.go('inventories.edit.inventory_sources.edit')",
    well: false,
    subFormTitles: {
        sourceSubForm: i18n._('Source Details'),
    },
    fields: {
        name: {
            label: i18n._('Name'),
            type: 'text',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            required: true,
            tab: 'properties'
        },
        description: {
            label: i18n._('Description'),
            type: 'text',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            tab: 'properties'
        },
        source: {
            label: i18n._('Source'),
            type: 'select',
            required: true,
            ngOptions: 'source.label for source in source_type_options track by source.value',
            ngChange: 'sourceChange(source)',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            ngModel: 'source',
            hasSubForm: true
        },
        credential: {
            label: i18n._('Credential'),
            type: 'lookup',
            list: 'CredentialList',
            basePath: 'credentials',
            ngShow: "source && source.value !== ''",
            sourceModel: 'credential',
            sourceField: 'name',
            ngClick: 'lookupCredential()',
            awRequiredWhen: {
                reqExpression: "cloudCredentialRequired",
                init: "false"
            },
            subForm: 'sourceSubForm',
            ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
            watchBasePath: "credentialBasePath"
{'fraction_non_alphanumeric': 0.14430306535569692, 'fraction_numerical': 0.006362058993637941, 'mean_word_length': 2.5111675126903554, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '536669', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1833, 'n_words': 443}