diff --git a/CHANGELOG.md b/CHANGELOG.md index afa7697114..9f04a26ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ This is a list of high-level changes for each release of AWX. A full list of commits can be found at `https://github.com/ansible/awx/releases/tag/`. ## 15.0.0 (September 30, 2020) +- Added improved support for fetching Ansible collections from private Galaxy content sources (such as https://github.com/ansible/galaxy_ng) - https://github.com/ansible/awx/issues/7813 + **Note:** as part of this change, new Organizations created in the AWX API will _no longer_ automatically synchronize roles and collections from galaxy.ansible.com by default. More details on this change can be found at: https://github.com/ansible/awx/issues/8341#issuecomment-707310633 - AWX now utilizes a version of certifi that auto-discovers certificates in the system certificate store - https://github.com/ansible/awx/pull/8242 - Added support for arbitrary custom inventory plugin configuration: https://github.com/ansible/awx/issues/5150 -- Added improved support for fetching Ansible collections from private Galaxy content sources (such as https://github.com/ansible/galaxy_ng) - https://github.com/ansible/awx/issues/7813 - Added an optional setting to disable the auto-creation of organizations and teams on successful SAML login. - https://github.com/ansible/awx/pull/8069 - Added a number of optimizations to AWX's callback receiver to improve the speed of stdout processing for simultaneous playbooks runs - https://github.com/ansible/awx/pull/8193 https://github.com/ansible/awx/pull/8191 - Added the ability to use `!include` and `!import` constructors when constructing YAML for use with the AWX CLI - https://github.com/ansible/awx/issues/8135 diff --git a/INSTALL.md b/INSTALL.md index 51a4d12acf..6bc3f869d0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -662,6 +662,7 @@ The preferred way to install the AWX CLI is through pip directly from PyPI: To build the docs, spin up a real AWX server, `pip3 install sphinx sphinxcontrib-autoprogram`, and run: + ~ cd awxkit/awxkit/cli/docs ~ TOWER_HOST=https://awx.example.org TOWER_USERNAME=example TOWER_PASSWORD=secret make clean html ~ cd build/html/ && python -m http.server Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) .. diff --git a/awx/api/serializers.py b/awx/api/serializers.py index 2bb25f3de2..2e70d2c8c9 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -3438,6 +3438,12 @@ class WorkflowJobTemplateSerializer(JobTemplateMixin, LabelsListMixin, UnifiedJo res['organization'] = self.reverse('api:organization_detail', kwargs={'pk': obj.organization.pk}) if obj.webhook_credential_id: res['webhook_credential'] = self.reverse('api:credential_detail', kwargs={'pk': obj.webhook_credential_id}) + if obj.inventory_id: + res['inventory'] = self.reverse( + 'api:inventory_detail', kwargs={ + 'pk': obj.inventory_id + } + ) return res def validate_extra_vars(self, value): diff --git a/awx/main/management/commands/inventory_import.py b/awx/main/management/commands/inventory_import.py index 53a1660c4f..f4431b2705 100644 --- a/awx/main/management/commands/inventory_import.py +++ b/awx/main/management/commands/inventory_import.py @@ -874,21 +874,20 @@ class Command(BaseCommand): Load inventory from in-memory groups to the database, overwriting or merging as appropriate. ''' - with advisory_lock('inventory_{}_update'.format(self.inventory.id)): - # FIXME: Attribute changes to superuser? - # Perform __in queries in batches (mainly for unit tests using SQLite). - self._batch_size = 500 - self._build_db_instance_id_map() - self._build_mem_instance_id_map() - if self.overwrite: - self._delete_hosts() - self._delete_groups() - self._delete_group_children_and_hosts() - self._update_inventory() - self._create_update_groups() - self._create_update_hosts() - self._create_update_group_children() - self._create_update_group_hosts() + # FIXME: Attribute changes to superuser? + # Perform __in queries in batches (mainly for unit tests using SQLite). + self._batch_size = 500 + self._build_db_instance_id_map() + self._build_mem_instance_id_map() + if self.overwrite: + self._delete_hosts() + self._delete_groups() + self._delete_group_children_and_hosts() + self._update_inventory() + self._create_update_groups() + self._create_update_hosts() + self._create_update_group_children() + self._create_update_group_hosts() def remote_tower_license_compare(self, local_license_type): # this requires https://github.com/ansible/ansible/pull/52747 @@ -998,143 +997,144 @@ class Command(BaseCommand): raise CommandError('invalid regular expression for --host-filter') begin = time.time() - self.load_inventory_from_database() + with advisory_lock('inventory_{}_update'.format(self.inventory_id)): + self.load_inventory_from_database() - try: - self.check_license() - except CommandError as e: - self.mark_license_failure(save=True) - raise e + try: + self.check_license() + except CommandError as e: + self.mark_license_failure(save=True) + raise e - try: - # Check the per-org host limits - self.check_org_host_limit() - except CommandError as e: - self.mark_org_limits_failure(save=True) - raise e - - status, tb, exc = 'error', '', None - try: - if settings.SQL_DEBUG: - queries_before = len(connection.queries) - - # Update inventory update for this command line invocation. - with ignore_inventory_computed_fields(): - iu = self.inventory_update - if iu.status != 'running': - with transaction.atomic(): - self.inventory_update.status = 'running' - self.inventory_update.save() - - source = self.get_source_absolute_path(self.source) - - data = AnsibleInventoryLoader(source=source, is_custom=self.is_custom, - venv_path=venv_path, verbosity=self.verbosity).load() - - logger.debug('Finished loading from source: %s', source) - logger.info('Processing JSON output...') - inventory = MemInventory( - group_filter_re=self.group_filter_re, host_filter_re=self.host_filter_re) - inventory = dict_to_mem_data(data, inventory=inventory) - - del data # forget dict from import, could be large - - logger.info('Loaded %d groups, %d hosts', len(inventory.all_group.all_groups), - len(inventory.all_group.all_hosts)) - - if self.exclude_empty_groups: - inventory.delete_empty_groups() - - self.all_group = inventory.all_group - - if settings.DEBUG: - # depending on inventory source, this output can be - # *exceedingly* verbose - crawling a deeply nested - # inventory/group data structure and printing metadata about - # each host and its memberships - # - # it's easy for this scale of data to overwhelm pexpect, - # (and it's likely only useful for purposes of debugging the - # actual inventory import code), so only print it if we have to: - # https://github.com/ansible/ansible-tower/issues/7414#issuecomment-321615104 - self.all_group.debug_tree() - - with batch_role_ancestor_rebuilding(): - # If using with transaction.atomic() with try ... catch, - # with transaction.atomic() must be inside the try section of the code as per Django docs - try: - # Ensure that this is managed as an atomic SQL transaction, - # and thus properly rolled back if there is an issue. - with transaction.atomic(): - # Merge/overwrite inventory into database. - if settings.SQL_DEBUG: - logger.warning('loading into database...') - with ignore_inventory_computed_fields(): - if getattr(settings, 'ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC', True): - self.load_into_database() - else: - with disable_activity_stream(): - self.load_into_database() - if settings.SQL_DEBUG: - queries_before2 = len(connection.queries) - self.inventory.update_computed_fields() - if settings.SQL_DEBUG: - logger.warning('update computed fields took %d queries', - len(connection.queries) - queries_before2) - # Check if the license is valid. - # If the license is not valid, a CommandError will be thrown, - # and inventory update will be marked as invalid. - # with transaction.atomic() will roll back the changes. - license_fail = True - self.check_license() - - # Check the per-org host limits - license_fail = False - self.check_org_host_limit() - except CommandError as e: - if license_fail: - self.mark_license_failure() - else: - self.mark_org_limits_failure() - raise e + try: + # Check the per-org host limits + self.check_org_host_limit() + except CommandError as e: + self.mark_org_limits_failure(save=True) + raise e + status, tb, exc = 'error', '', None + try: if settings.SQL_DEBUG: - logger.warning('Inventory import completed for %s in %0.1fs', - self.inventory_source.name, time.time() - begin) + queries_before = len(connection.queries) + + # Update inventory update for this command line invocation. + with ignore_inventory_computed_fields(): + iu = self.inventory_update + if iu.status != 'running': + with transaction.atomic(): + self.inventory_update.status = 'running' + self.inventory_update.save() + + source = self.get_source_absolute_path(self.source) + + data = AnsibleInventoryLoader(source=source, is_custom=self.is_custom, + venv_path=venv_path, verbosity=self.verbosity).load() + + logger.debug('Finished loading from source: %s', source) + logger.info('Processing JSON output...') + inventory = MemInventory( + group_filter_re=self.group_filter_re, host_filter_re=self.host_filter_re) + inventory = dict_to_mem_data(data, inventory=inventory) + + del data # forget dict from import, could be large + + logger.info('Loaded %d groups, %d hosts', len(inventory.all_group.all_groups), + len(inventory.all_group.all_hosts)) + + if self.exclude_empty_groups: + inventory.delete_empty_groups() + + self.all_group = inventory.all_group + + if settings.DEBUG: + # depending on inventory source, this output can be + # *exceedingly* verbose - crawling a deeply nested + # inventory/group data structure and printing metadata about + # each host and its memberships + # + # it's easy for this scale of data to overwhelm pexpect, + # (and it's likely only useful for purposes of debugging the + # actual inventory import code), so only print it if we have to: + # https://github.com/ansible/ansible-tower/issues/7414#issuecomment-321615104 + self.all_group.debug_tree() + + with batch_role_ancestor_rebuilding(): + # If using with transaction.atomic() with try ... catch, + # with transaction.atomic() must be inside the try section of the code as per Django docs + try: + # Ensure that this is managed as an atomic SQL transaction, + # and thus properly rolled back if there is an issue. + with transaction.atomic(): + # Merge/overwrite inventory into database. + if settings.SQL_DEBUG: + logger.warning('loading into database...') + with ignore_inventory_computed_fields(): + if getattr(settings, 'ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC', True): + self.load_into_database() + else: + with disable_activity_stream(): + self.load_into_database() + if settings.SQL_DEBUG: + queries_before2 = len(connection.queries) + self.inventory.update_computed_fields() + if settings.SQL_DEBUG: + logger.warning('update computed fields took %d queries', + len(connection.queries) - queries_before2) + # Check if the license is valid. + # If the license is not valid, a CommandError will be thrown, + # and inventory update will be marked as invalid. + # with transaction.atomic() will roll back the changes. + license_fail = True + self.check_license() + + # Check the per-org host limits + license_fail = False + self.check_org_host_limit() + except CommandError as e: + if license_fail: + self.mark_license_failure() + else: + self.mark_org_limits_failure() + raise e + + if settings.SQL_DEBUG: + logger.warning('Inventory import completed for %s in %0.1fs', + self.inventory_source.name, time.time() - begin) + else: + logger.info('Inventory import completed for %s in %0.1fs', + self.inventory_source.name, time.time() - begin) + status = 'successful' + + # If we're in debug mode, then log the queries and time + # used to do the operation. + if settings.SQL_DEBUG: + queries_this_import = connection.queries[queries_before:] + sqltime = sum(float(x['time']) for x in queries_this_import) + logger.warning('Inventory import required %d queries ' + 'taking %0.3fs', len(queries_this_import), + sqltime) + except Exception as e: + if isinstance(e, KeyboardInterrupt): + status = 'canceled' + exc = e + elif isinstance(e, CommandError): + exc = e else: - logger.info('Inventory import completed for %s in %0.1fs', - self.inventory_source.name, time.time() - begin) - status = 'successful' + tb = traceback.format_exc() + exc = e - # If we're in debug mode, then log the queries and time - # used to do the operation. - if settings.SQL_DEBUG: - queries_this_import = connection.queries[queries_before:] - sqltime = sum(float(x['time']) for x in queries_this_import) - logger.warning('Inventory import required %d queries ' - 'taking %0.3fs', len(queries_this_import), - sqltime) - except Exception as e: - if isinstance(e, KeyboardInterrupt): - status = 'canceled' - exc = e - elif isinstance(e, CommandError): - exc = e - else: - tb = traceback.format_exc() - exc = e + if not self.invoked_from_dispatcher: + with ignore_inventory_computed_fields(): + self.inventory_update = InventoryUpdate.objects.get(pk=self.inventory_update.pk) + self.inventory_update.result_traceback = tb + self.inventory_update.status = status + self.inventory_update.save(update_fields=['status', 'result_traceback']) + self.inventory_source.status = status + self.inventory_source.save(update_fields=['status']) - if not self.invoked_from_dispatcher: - with ignore_inventory_computed_fields(): - self.inventory_update = InventoryUpdate.objects.get(pk=self.inventory_update.pk) - self.inventory_update.result_traceback = tb - self.inventory_update.status = status - self.inventory_update.save(update_fields=['status', 'result_traceback']) - self.inventory_source.status = status - self.inventory_source.save(update_fields=['status']) - - if exc: - logger.error(str(exc)) + if exc: + logger.error(str(exc)) if exc: if isinstance(exc, CommandError): diff --git a/awx/sso/fields.py b/awx/sso/fields.py index 78f750fbbd..e430a0a367 100644 --- a/awx/sso/fields.py +++ b/awx/sso/fields.py @@ -445,6 +445,7 @@ class LDAPGroupTypeField(fields.ChoiceField, DependsOnMixin): default_error_messages = { 'type_error': _('Expected an instance of LDAPGroupType but got {input_type} instead.'), + 'missing_parameters': _('Missing required parameters in {dependency}.') } def __init__(self, choices=None, **kwargs): @@ -479,7 +480,10 @@ class LDAPGroupTypeField(fields.ChoiceField, DependsOnMixin): if attr in params: params_sanitized[attr] = params[attr] - return cls(**params_sanitized) + try: + return cls(**params_sanitized) + except TypeError: + self.fail('missing_parameters', dependency=list(self.depends_on)[0]) class LDAPGroupTypeParamsField(fields.DictField, DependsOnMixin): diff --git a/awx/ui/client/src/about/about.controller.js b/awx/ui/client/src/about/about.controller.js index 868adf01dc..e2ef6e776a 100644 --- a/awx/ui/client/src/about/about.controller.js +++ b/awx/ui/client/src/about/about.controller.js @@ -7,6 +7,7 @@ export default ['$rootScope', '$scope', '$location', 'ConfigService', 'lastPath' $scope.ansible_version = config.ansible_version; $scope.subscription = config.license_info.subscription_name; $scope.speechBubble = createSpeechBubble($rootScope.BRAND_NAME, config.version); + $scope.currentYear = new Date().getFullYear(); $('#about-modal').modal('show'); }); diff --git a/awx/ui/client/src/about/about.partial.html b/awx/ui/client/src/about/about.partial.html index a5faa70e84..2be5f6234b 100644 --- a/awx/ui/client/src/about/about.partial.html +++ b/awx/ui/client/src/about/about.partial.html @@ -29,7 +29,7 @@ Ansible {{ ansible_version }}
- Copyright © 2019 Red Hat, Inc.
+ Copyright © {{ currentYear }} Red Hat, Inc.
Visit Ansible.com for more information.

diff --git a/awx/ui/package-lock.json b/awx/ui/package-lock.json index 9f6c2322e1..c3dd1a9fd4 100644 --- a/awx/ui/package-lock.json +++ b/awx/ui/package-lock.json @@ -171,9 +171,9 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, "angular": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/angular/-/angular-1.7.9.tgz", - "integrity": "sha512-5se7ZpcOtu0MBFlzGv5dsM1quQDoDeUTwZrWjGtTNA7O88cD8TEk5IEKCTDa3uECV9XnvKREVUr7du1ACiWGFQ==" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/angular/-/angular-1.8.1.tgz", + "integrity": "sha512-eiasF4uFXsmKD8qYpkKEi9rKVxMv0nIDZXsYrwzSbPIbjmTV05bx+18VDbRmMx7p+gL84T9Qw2NCpVe8w1QKHQ==" }, "angular-breadcrumb": { "version": "git+https://git@github.com/ansible/angular-breadcrumb.git#6c2b1ad45ad5fbe7adf39af1ef3b294ca8e207a9", @@ -2797,11 +2797,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "complex.js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.0.4.tgz", - "integrity": "sha512-Syl95HpxUTS0QjwNxencZsKukgh1zdS9uXeXX2Us0pHaqBR6kiZZi0AkZ9VpZFwHJyVIUVzI4EumjWdXP3fy6w==" - }, "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -3456,11 +3451,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "decimal.js": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-9.0.1.tgz", - "integrity": "sha512-2h0iKbJwnImBk4TGk7CG1xadoA0g3LDPlQhQzbZ221zvG0p2YVUedbKIPsOZXKZGx6YmZMJKYOalpCMxSdDqTQ==" - }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", @@ -4137,11 +4127,6 @@ "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", "dev": true }, - "escape-latex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.1.0.tgz", - "integrity": "sha512-7k372jNDrL8uW7P/Sw8IkF+QcaeGoyjzrLx4pJj/CSIe02CvxL1wUJ+qMVVHsna/jNZ6PD6aCo7iEeRnXTzvdw==" - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -5493,11 +5478,6 @@ "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", "dev": true }, - "fraction.js": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.4.tgz", - "integrity": "sha512-aK/oGatyYLTtXRHjfEsytX5fieeR5H4s8sLorzcT12taFS+dbMZejnvm9gRa8mZAPwci24ucjq9epDyaq5u8Iw==" - }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -8070,11 +8050,6 @@ "resolved": "https://registry.npmjs.org/javascript-detect-element-resize/-/javascript-detect-element-resize-0.5.3.tgz", "integrity": "sha1-GnHNUd/lZZB/KZAS/nOilBBAJd4=" }, - "javascript-natural-sort": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", - "integrity": "sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=" - }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", @@ -9186,21 +9161,6 @@ "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", "dev": true }, - "mathjs": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-3.20.2.tgz", - "integrity": "sha512-3f6/+uf1cUtIz1rYFz775wekl/UEDSQ3mU6xdxW7qzpvvhc2v28i3UtLsGTRB+u8OqDWoSX6Dz8gehaGFs6tCA==", - "requires": { - "complex.js": "2.0.4", - "decimal.js": "9.0.1", - "escape-latex": "^1.0.0", - "fraction.js": "4.0.4", - "javascript-natural-sort": "0.7.1", - "seed-random": "2.2.0", - "tiny-emitter": "2.0.2", - "typed-function": "0.10.7" - } - }, "md5.js": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", @@ -12266,11 +12226,6 @@ "ajv": "^5.0.0" } }, - "seed-random": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", - "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" - }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -13505,11 +13460,6 @@ "version": "github:ansible/timezone-js#6937de14ce0c193961538bb5b3b12b7ef62a358f", "from": "github:ansible/timezone-js#0.4.14" }, - "tiny-emitter": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", - "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==" - }, "titlecase": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/titlecase/-/titlecase-1.1.2.tgz", @@ -13654,11 +13604,6 @@ "mime-types": "~2.1.18" } }, - "typed-function": { - "version": "0.10.7", - "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-0.10.7.tgz", - "integrity": "sha512-3mlZ5AwRMbLvUKkc8a1TI4RUJUS2H27pmD5q0lHRObgsoWzhDAX01yg82kwSP1FUw922/4Y9ZliIEh0qJZcz+g==" - }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", diff --git a/awx/ui/package.json b/awx/ui/package.json index e546bfc891..698a7b5b6a 100644 --- a/awx/ui/package.json +++ b/awx/ui/package.json @@ -97,7 +97,7 @@ }, "dependencies": { "@uirouter/angularjs": "1.0.18", - "angular": "^1.7.9", + "angular": "^1.8.1", "angular-breadcrumb": "git+https://git@github.com/ansible/angular-breadcrumb#0.4.1", "angular-codemirror": "git+https://git@github.com/ansible/angular-codemirror.git#v1.2.1", "angular-cookies": "^1.7.9", @@ -128,7 +128,6 @@ "legacy-loader": "0.0.2", "lodash": "^4.17.15", "lr-infinite-scroll": "git+https://git@github.com/lorenzofox3/lrInfiniteScroll", - "mathjs": "^3.15.0", "moment": "^2.19.4", "ng-toast": "git+https://git@github.com/ansible/ngToast.git#v2.2.1", "nvd3": "^1.8.6", diff --git a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx index ca4c4a40b6..f48e554317 100644 --- a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx +++ b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx @@ -48,7 +48,12 @@ function AddDropDownButton({ dropdownItems, i18n }) { isPlain isOpen={isOpen} position={DropdownPosition.right} - toggle={ setIsOpen(!isOpen)} />} + toggle={ + setIsOpen(!isOpen)} + /> + } dropdownItems={dropdownItems.map(item => ( + ); diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx b/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx index ad5bde5bd4..682ce46177 100644 --- a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx +++ b/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx @@ -18,4 +18,13 @@ describe('', () => { expect(link).toHaveLength(1); expect(link.prop('to')).toBe('/foo'); }); + + test('should render link with toggle icon', () => { + const wrapper = mountWithContexts( + + ); + const link = wrapper.find('Link'); + expect(link).toHaveLength(1); + expect(link.prop('to')).toBe('/foo'); + }); }); diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx index 1974827032..6d18102d40 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx @@ -10,6 +10,7 @@ import { DataListItemRow, Label, Tooltip, + Badge as PFBadge, } from '@patternfly/react-core'; import { PencilAltIcon } from '@patternfly/react-icons'; import { t } from '@lingui/macro'; @@ -29,6 +30,15 @@ const DataListAction = styled(_DataListAction)` grid-template-columns: repeat(2, 40px); `; +const Badge = styled(PFBadge)` + margin-left: 8px; +`; + +const ListGroup = styled.div` + margin-left: 8px; + display: inline-block; +`; + function InventoryListItem({ inventory, isSelected, @@ -102,6 +112,20 @@ function InventoryListItem({ ? i18n._(t`Smart Inventory`) : i18n._(t`Inventory`)} , + + + {i18n._(t`Groups`)} + {inventory.total_groups} + + + {i18n._(t`Hosts`)} + {inventory.total_hosts} + + + {i18n._(t`Sources`)} + {inventory.total_inventory_sources} + + , inventory.pending_deletion && ( diff --git a/awx/ui_next/src/screens/User/UserDetail/UserDetail.jsx b/awx/ui_next/src/screens/User/UserDetail/UserDetail.jsx index e4c0a1adfd..83d8ea77b0 100644 --- a/awx/ui_next/src/screens/User/UserDetail/UserDetail.jsx +++ b/awx/ui_next/src/screens/User/UserDetail/UserDetail.jsx @@ -3,7 +3,7 @@ import { Link, useHistory } from 'react-router-dom'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; -import { Button } from '@patternfly/react-core'; +import { Button, Label } from '@patternfly/react-core'; import AlertModal from '../../../components/AlertModal'; import { CardBody, CardActionsRow } from '../../../components/Card'; import DeleteButton from '../../../components/DeleteButton'; @@ -46,6 +46,13 @@ function UserDetail({ user, i18n }) { user_type = i18n._(t`Normal User`); } + let userAuthType; + if (user.ldap_dn) { + userAuthType = i18n._(t`LDAP`); + } else if (user.auth.length > 0) { + userAuthType = i18n._(t`SOCIAL`); + } + return ( @@ -58,6 +65,14 @@ function UserDetail({ user, i18n }) { + {userAuthType && ( + {userAuthType} + } + /> + )} {last_login && ( ', () => { - test('initially renders succesfully', () => { + test('initially renders successfully', () => { mountWithContexts(); }); @@ -22,6 +22,7 @@ describe('', () => { expect(wrapper.find(`Detail[label="${label}"] dt`).text()).toBe(label); expect(wrapper.find(`Detail[label="${label}"] dd`).text()).toBe(value); } + assertDetail('Username', mockDetails.username); assertDetail('Email', mockDetails.email); assertDetail('First Name', mockDetails.first_name); @@ -29,6 +30,7 @@ describe('', () => { assertDetail('User Type', 'System Administrator'); assertDetail('Last Login', `11/4/2019, 11:12:36 PM`); assertDetail('Created', `10/28/2019, 3:01:07 PM`); + assertDetail('Type', `SOCIAL`); }); test('User Type Detail should render expected strings', async () => { diff --git a/awx/ui_next/src/screens/User/UserList/UserListItem.jsx b/awx/ui_next/src/screens/User/UserList/UserListItem.jsx index b772a47566..9015b1675d 100644 --- a/awx/ui_next/src/screens/User/UserList/UserListItem.jsx +++ b/awx/ui_next/src/screens/User/UserList/UserListItem.jsx @@ -10,6 +10,7 @@ import { DataListItem, DataListItemCells, DataListItemRow, + Label, Tooltip, } from '@patternfly/react-core'; @@ -31,6 +32,9 @@ function UserListItem({ user, isSelected, onSelect, detailUrl, i18n }) { user_type = i18n._(t`Normal User`); } + const ldapUser = user.ldap_dn; + const socialAuthUser = user.auth.length > 0; + return ( @@ -43,9 +47,25 @@ function UserListItem({ user, isSelected, onSelect, detailUrl, i18n }) { - - {user.username} - + + + {user.username} + + + {ldapUser && ( + + + + )} + {socialAuthUser && ( + + + + )} , { expect(wrapper.find('PencilAltIcon').exists()).toBeTruthy(); }); - test('should display user type', () => { + test('should display user data', () => { expect( wrapper.find('DataListCell[aria-label="user type"]').prop('children') ).toEqual('System Administrator'); + expect( + wrapper.find('Label[aria-label="social login"]').prop('children') + ).toEqual('SOCIAL'); }); }); diff --git a/awx/ui_next/src/screens/User/data.user.json b/awx/ui_next/src/screens/User/data.user.json index fc71d1f128..c9d598f47c 100644 --- a/awx/ui_next/src/screens/User/data.user.json +++ b/awx/ui_next/src/screens/User/data.user.json @@ -30,6 +30,10 @@ "is_system_auditor": false, "ldap_dn": "", "last_login": "2019-11-04T23:12:36.777783Z", - "external_account": null, - "auth": [] + "external_account": "social", + "auth": [ + { + "provider": "github-org", + "uid": "9053044" + }] } \ No newline at end of file diff --git a/awx/ui_next/src/screens/User/shared/UserForm.jsx b/awx/ui_next/src/screens/User/shared/UserForm.jsx index 144f514c29..dbadf2d17a 100644 --- a/awx/ui_next/src/screens/User/shared/UserForm.jsx +++ b/awx/ui_next/src/screens/User/shared/UserForm.jsx @@ -18,6 +18,10 @@ function UserFormFields({ user, i18n }) { const [organization, setOrganization] = useState(null); const { setFieldValue } = useFormikContext(); + const ldapUser = user.ldap_dn; + const socialAuthUser = user.auth?.length > 0; + const externalAccount = user.external_account; + const userTypeOptions = [ { value: 'normal', @@ -63,8 +67,12 @@ function UserFormFields({ user, i18n }) { label={i18n._(t`Username`)} name="username" type="text" - validate={required(null, i18n)} - isRequired + validate={ + !ldapUser && externalAccount === null + ? required(null, i18n) + : () => undefined + } + isRequired={!ldapUser && externalAccount === null} /> - undefined - } - isRequired={!user.id} - /> - undefined - } - isRequired={!user.id} - /> + {!ldapUser && !(socialAuthUser && externalAccount) && ( + <> + undefined + } + isRequired={!user.id} + /> + undefined + } + isRequired={!user.id} + /> + + )} ', () => { await act(async () => { wrapper = mountWithContexts( @@ -125,6 +125,22 @@ describe('', () => { expect(passwordFields.at(1).prop('isRequired')).toBe(false); }); + test('password fields are not displayed for social/ldap login', async () => { + await act(async () => { + wrapper = mountWithContexts( + + ); + }); + + const passwordFields = wrapper.find('PasswordField'); + + expect(passwordFields.length).toBe(0); + }); + test('should call handleSubmit when Submit button is clicked', async () => { const handleSubmit = jest.fn(); await act(async () => { diff --git a/awx_collection/plugins/module_utils/tower_api.py b/awx_collection/plugins/module_utils/tower_api.py index d41c32b772..50ca95cea7 100644 --- a/awx_collection/plugins/module_utils/tower_api.py +++ b/awx_collection/plugins/module_utils/tower_api.py @@ -393,7 +393,7 @@ class TowerAPIModule(TowerModule): if response['status_code'] == 204: self.json_output['changed'] = True else: - self.fail_json(msg="Failed to disassociate item {0}".format(response['json']['detail'])) + self.fail_json(msg="Failed to disassociate item {0}".format(response['json'].get('detail', response['json']))) # Associate anything that is in new_association_list but not in `association` for an_id in list(set(new_association_list) - set(existing_associated_ids)): @@ -401,7 +401,7 @@ class TowerAPIModule(TowerModule): if response['status_code'] == 204: self.json_output['changed'] = True else: - self.fail_json(msg="Failed to associate item {0}".format(response['json']['detail'])) + self.fail_json(msg="Failed to associate item {0}".format(response['json'].get('detail', response['json']))) def create_if_needed(self, existing_item, new_item, endpoint, on_create=None, item_type='unknown', associations=None): diff --git a/awx_collection/plugins/modules/tower_inventory_source_update.py b/awx_collection/plugins/modules/tower_inventory_source_update.py index c4cb27be7c..945cd304b5 100644 --- a/awx_collection/plugins/modules/tower_inventory_source_update.py +++ b/awx_collection/plugins/modules/tower_inventory_source_update.py @@ -107,17 +107,16 @@ def main(): interval = module.params.get('interval') timeout = module.params.get('timeout') - lookup_data = {'name': inventory} + lookup_data = {} if organization: lookup_data['organization'] = module.resolve_name_to_id('organizations', organization) - inventory_object = module.get_one('inventories', data=lookup_data) + inventory_object = module.get_one('inventories', name_or_id=inventory, data=lookup_data) if not inventory_object: module.fail_json(msg='The specified inventory, {0}, was not found.'.format(lookup_data)) - inventory_source_object = module.get_one('inventory_sources', **{ + inventory_source_object = module.get_one('inventory_sources', name_or_id=inventory_source, **{ 'data': { - 'name': inventory_source, 'inventory': inventory_object['id'], } }) diff --git a/awx_collection/plugins/modules/tower_job_template.py b/awx_collection/plugins/modules/tower_job_template.py index 8b5f2cef8f..c99eb73118 100644 --- a/awx_collection/plugins/modules/tower_job_template.py +++ b/awx_collection/plugins/modules/tower_job_template.py @@ -436,7 +436,7 @@ def main(): 'become_enabled', 'diff_mode', 'allow_simultaneous', 'custom_virtualenv', 'job_slice_count', 'webhook_service', ): field_val = module.params.get(field_name) - if field_val: + if field_val is not None: new_fields[field_name] = field_val # Special treatment of extra_vars parameter diff --git a/awx_collection/test/awx/test_job_template.py b/awx_collection/test/awx/test_job_template.py index 4b480ed45d..80b3cd9529 100644 --- a/awx_collection/test/awx/test_job_template.py +++ b/awx_collection/test/awx/test_job_template.py @@ -35,6 +35,51 @@ def test_create_job_template(run_module, admin_user, project, inventory): assert jt.inventory_id == inventory.id +@pytest.mark.django_db +def test_resets_job_template_values(run_module, admin_user, project, inventory): + + module_args = { + 'name': 'foo', 'playbook': 'helloworld.yml', + 'project': project.name, 'inventory': inventory.name, + 'extra_vars': {'foo': 'bar'}, + 'job_type': 'run', + 'state': 'present', + 'forks': 20, + 'timeout': 50, + 'allow_simultaneous': True, + 'ask_limit_on_launch': True, + } + + result = run_module('tower_job_template', module_args, admin_user) + + jt = JobTemplate.objects.get(name='foo') + assert jt.forks == 20 + assert jt.timeout == 50 + assert jt.allow_simultaneous + assert jt.ask_limit_on_launch + + module_args = { + 'name': 'foo', 'playbook': 'helloworld.yml', + 'project': project.name, 'inventory': inventory.name, + 'extra_vars': {'foo': 'bar'}, + 'job_type': 'run', + 'state': 'present', + 'forks': 0, + 'timeout': 0, + 'allow_simultaneous': False, + 'ask_limit_on_launch': False, + } + + result = run_module('tower_job_template', module_args, admin_user) + assert result['changed'] + + jt = JobTemplate.objects.get(name='foo') + assert jt.forks == 0 + assert jt.timeout == 0 + assert not jt.allow_simultaneous + assert not jt.ask_limit_on_launch + + @pytest.mark.django_db def test_job_launch_with_prompting(run_module, admin_user, project, inventory, machine_credential): JobTemplate.objects.create( diff --git a/awxkit/awxkit/api/pages/api.py b/awxkit/awxkit/api/pages/api.py index 664c0c18cf..a8759d1896 100644 --- a/awxkit/awxkit/api/pages/api.py +++ b/awxkit/awxkit/api/pages/api.py @@ -72,10 +72,21 @@ class ApiV2(base.Base): } for key in post_fields: - if key not in _page.related: - continue + if key in _page.related: + related = _page.related[key] + else: + if post_fields[key]['type'] == 'id' and _page.json.get(key) is not None: + log.warning("Related link %r missing from %s, attempting to reconstruct endpoint.", + key, _page.endpoint) + resource = getattr(self, key, None) + if resource is None: + log.error("Unable to infer endpoint for %r on %s.", key, _page.endpoint) + continue + related = self._filtered_list(resource, _page.json[key]).results[0] + else: + continue - rel_endpoint = self._cache.get_page(_page.related[key]) + rel_endpoint = self._cache.get_page(related) if rel_endpoint is None: # This foreign key is unreadable if post_fields[key].get('required'): log.error("Foreign key %r export failed for object %s.", key, _page.endpoint) diff --git a/awxkit/awxkit/cli/options.py b/awxkit/awxkit/cli/options.py index 8b33a0d086..4d292f3611 100644 --- a/awxkit/awxkit/cli/options.py +++ b/awxkit/awxkit/cli/options.py @@ -178,6 +178,9 @@ class ResourceOptionsParser(object): except Exception: raise argparse.ArgumentTypeError("{} is not valid JSON or YAML".format(v)) + if not isinstance(parsed, dict): + raise argparse.ArgumentTypeError("{} is not valid JSON or YAML".format(v)) + for k, v in parsed.items(): # add support for file reading at top-level JSON keys # (to make things like SSH key data easier to work with) diff --git a/docs/licenses/ui/complex.js.txt b/docs/licenses/ui/complex.js.txt deleted file mode 100644 index 6b5c324a32..0000000000 --- a/docs/licenses/ui/complex.js.txt +++ /dev/null @@ -1,7 +0,0 @@ - -MIT -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/docs/licenses/ui/decimal.js.txt b/docs/licenses/ui/decimal.js.txt deleted file mode 100644 index 86e03102ef..0000000000 --- a/docs/licenses/ui/decimal.js.txt +++ /dev/null @@ -1,7 +0,0 @@ - -MIT -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/licenses/ui/escape-latex.txt b/docs/licenses/ui/escape-latex.txt deleted file mode 100644 index 6e54effe25..0000000000 --- a/docs/licenses/ui/escape-latex.txt +++ /dev/null @@ -1,18 +0,0 @@ -Copyright (c) 2012 Dang Mai - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/licenses/ui/fraction.js.txt b/docs/licenses/ui/fraction.js.txt deleted file mode 100644 index 49057d3c5e..0000000000 --- a/docs/licenses/ui/fraction.js.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Robert Eisele - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/docs/licenses/ui/javascript-natural-sort.txt b/docs/licenses/ui/javascript-natural-sort.txt deleted file mode 100644 index 86e03102ef..0000000000 --- a/docs/licenses/ui/javascript-natural-sort.txt +++ /dev/null @@ -1,7 +0,0 @@ - -MIT -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/licenses/ui/mathjs.txt b/docs/licenses/ui/mathjs.txt deleted file mode 100644 index ea2712c09f..0000000000 --- a/docs/licenses/ui/mathjs.txt +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/docs/licenses/ui/seed-random.txt b/docs/licenses/ui/seed-random.txt deleted file mode 100644 index c50dbfceeb..0000000000 --- a/docs/licenses/ui/seed-random.txt +++ /dev/null @@ -1,50 +0,0 @@ -LICENSE for modifications of JavaScript Library by Forbes Lindesay (MIT): - -Copyright (c) 2013 Forbes Lindesay - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -LICENSE for original seedrandom javascript file (BSD): - -Copyright 2013 David Bau, all rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of this module nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \ No newline at end of file diff --git a/docs/licenses/ui/tiny-emitter.txt b/docs/licenses/ui/tiny-emitter.txt deleted file mode 100644 index 829683e372..0000000000 --- a/docs/licenses/ui/tiny-emitter.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Scott Corgan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/docs/licenses/ui/typed-function.txt b/docs/licenses/ui/typed-function.txt deleted file mode 100644 index eaed10c10c..0000000000 --- a/docs/licenses/ui/typed-function.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015 Jos de Jong - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.