├── .code-style-intellij ├── codeStyleConfig.xml ├── inspection-profile.xml └── udc-code-style.xml ├── .editorconfig ├── .githooks ├── pre-commit-check └── secrets-check ├── .gitignore ├── .secretlintrc.json ├── .travis.yml ├── LICENSE ├── README.md ├── angular.json ├── e2e ├── app │ ├── base │ │ ├── base.e2e.ts │ │ └── base.po.ts │ ├── category │ │ ├── categories.e2e-spec.ts │ │ ├── categories.po.ts │ │ └── operations │ │ │ ├── data.ts │ │ │ ├── dbScripts.ts │ │ │ └── operations.ts │ ├── data-entity │ │ ├── columns │ │ │ ├── columns.e2e-spec.ts │ │ │ ├── columns.po.ts │ │ │ └── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ ├── documentschema │ │ │ ├── documentschema.e2e-spec.ts │ │ │ ├── documentschema.po.ts │ │ │ └── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ ├── list │ │ │ ├── data-entity-list.e2e-spec.ts │ │ │ ├── data-entity-list.po.ts │ │ │ └── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ ├── overview │ │ │ ├── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ │ ├── overview.e2e-spec.ts │ │ │ └── overview.po.ts │ │ ├── sampledata │ │ │ ├── sampledata.e2e-spec.ts │ │ │ └── sampledata.po.ts │ │ └── sme │ │ │ ├── operations │ │ │ ├── data.ts │ │ │ └── operations.ts │ │ │ ├── sme.e2e-spec.ts │ │ │ └── sme.po.ts │ ├── data-objects │ │ ├── detail │ │ │ ├── base-detail.ts │ │ │ ├── data-object-detail.e2e-spec.ts │ │ │ ├── data-object-detail.po.ts │ │ │ ├── lineage │ │ │ │ ├── bdata-lineage-history.e2e-spec.ts │ │ │ │ └── operations │ │ │ │ │ ├── data.ts │ │ │ │ │ └── operations.ts │ │ │ ├── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ │ └── storage-units │ │ │ │ ├── bdata-storage-units.e2e-spec.ts │ │ │ │ └── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ └── list │ │ │ ├── data-objects-list.e2e-spec.ts │ │ │ ├── data-objects-list.po.ts │ │ │ └── operations │ │ │ ├── data.ts │ │ │ └── operations.ts │ ├── format │ │ ├── externalinterfaces │ │ │ ├── externalinterfaces.e2e-spec.ts │ │ │ ├── externalinterfaces.po.ts │ │ │ └── operations │ │ │ │ ├── data.ts │ │ │ │ └── operations.ts │ │ ├── format.e2e-spec.ts │ │ ├── format.po.ts │ │ └── operations │ │ │ ├── data.ts │ │ │ └── operations.ts │ ├── home │ │ ├── home.e2e-spec.ts │ │ ├── home.po.ts │ │ └── operations │ │ │ ├── data.ts │ │ │ └── operations.ts │ ├── login │ │ └── login.po.ts │ ├── search │ │ ├── operations │ │ │ ├── data.ts │ │ │ └── operations.ts │ │ ├── search.e2e-spec.ts │ │ └── search.po.ts │ └── smoke │ │ └── smoke.e2e-spec.ts ├── config │ ├── README.md │ └── conf.e2e.json ├── tsconfig.e2e.json └── util │ ├── DataManager.ts │ ├── JsonSchema.ts │ ├── S3Manager.ts │ ├── database │ └── queries.ts │ └── utils.ts ├── herd-ui-dist-package ├── README.md ├── distDeploy.sh └── package.json ├── karma.conf.ci.js ├── karma.conf.js ├── license-check.js ├── package.json ├── protractor.conf.ci.js ├── protractor.conf.js ├── run-in-saucelab.sh ├── setmeup.sh ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── categories │ │ ├── categories-routing.module.ts │ │ ├── categories.module.ts │ │ ├── components │ │ │ └── category-detail │ │ │ │ ├── category-detail.component.html │ │ │ │ ├── category-detail.component.scss │ │ │ │ ├── category-detail.component.spec.ts │ │ │ │ └── category-detail.component.ts │ │ └── services │ │ │ ├── categories-detail-resolver.spec.ts │ │ │ └── categories-detail-resolver.ts │ ├── core │ │ ├── components │ │ │ ├── alerts │ │ │ │ ├── alerts.component.html │ │ │ │ ├── alerts.component.scss │ │ │ │ ├── alerts.component.spec.ts │ │ │ │ └── alerts.component.ts │ │ │ ├── back-track │ │ │ │ ├── back-track.component.html │ │ │ │ ├── back-track.component.scss │ │ │ │ ├── back-track.component.spec.ts │ │ │ │ └── back-track.component.ts │ │ │ ├── header │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.scss │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.html │ │ │ │ ├── home.component.scss │ │ │ │ ├── home.component.spec.ts │ │ │ │ └── home.component.ts │ │ │ └── login │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.scss │ │ │ │ ├── login.component.spec.ts │ │ │ │ └── login.component.ts │ │ ├── core.module.ts │ │ └── services │ │ │ ├── alert.service.spec.ts │ │ │ ├── alert.service.ts │ │ │ ├── auth-guard.service.spec.ts │ │ │ ├── auth-guard.service.ts │ │ │ ├── custom-location.service.spec.ts │ │ │ ├── custom-location.service.ts │ │ │ ├── custom-route-reuse-strategy.service.spec.ts │ │ │ ├── custom-route-reuse-strategy.service.ts │ │ │ ├── http-intercept.service.spec.ts │ │ │ ├── http-intercept.service.ts │ │ │ ├── no-auth-guard.service.ts │ │ │ ├── user.service.spec.ts │ │ │ └── user.service.ts │ ├── data-entities │ │ ├── components │ │ │ ├── contacts │ │ │ │ ├── contacts.component.html │ │ │ │ ├── contacts.component.scss │ │ │ │ ├── contacts.component.spec.ts │ │ │ │ └── contacts.component.ts │ │ │ ├── data-entity-detail │ │ │ │ ├── data-entity-detail.component.html │ │ │ │ ├── data-entity-detail.component.scss │ │ │ │ ├── data-entity-detail.component.spec.ts │ │ │ │ └── data-entity-detail.component.ts │ │ │ ├── data-entity-list │ │ │ │ ├── data-entity-list.component.html │ │ │ │ ├── data-entity-list.component.scss │ │ │ │ ├── data-entity-list.component.spec.ts │ │ │ │ └── data-entity-list.component.ts │ │ │ ├── suggestions │ │ │ │ ├── suggestions.component.html │ │ │ │ ├── suggestions.component.scss │ │ │ │ ├── suggestions.component.spec.ts │ │ │ │ └── suggestions.component.ts │ │ │ └── tags │ │ │ │ ├── tags.component.html │ │ │ │ ├── tags.component.scss │ │ │ │ ├── tags.component.spec.ts │ │ │ │ └── tags.component.ts │ │ ├── data-entities-routing.module.ts │ │ ├── data-entities.module.ts │ │ └── services │ │ │ ├── data-entity-detail-resolver.spec.ts │ │ │ ├── data-entity-detail-resolver.ts │ │ │ ├── data-entity-list-resolver.spec.ts │ │ │ └── data-entity-list-resolver.ts │ ├── data-objects │ │ ├── components │ │ │ ├── attribute-filter │ │ │ │ ├── attribute-filter.component.html │ │ │ │ ├── attribute-filter.component.scss │ │ │ │ ├── attribute-filter.component.spec.ts │ │ │ │ └── attribute-filter.component.ts │ │ │ ├── data-object-detail │ │ │ │ ├── data-object-detail.component.html │ │ │ │ ├── data-object-detail.component.scss │ │ │ │ ├── data-object-detail.component.spec.ts │ │ │ │ └── data-object-detail.component.ts │ │ │ ├── data-object-list-filters │ │ │ │ ├── data-object-list-filters.component.html │ │ │ │ ├── data-object-list-filters.component.scss │ │ │ │ ├── data-object-list-filters.component.spec.ts │ │ │ │ └── data-object-list-filters.component.ts │ │ │ ├── data-object-list │ │ │ │ ├── data-object-list.component.html │ │ │ │ ├── data-object-list.component.scss │ │ │ │ ├── data-object-list.component.spec.ts │ │ │ │ └── data-object-list.component.ts │ │ │ ├── filter-template │ │ │ │ ├── filter-template.component.html │ │ │ │ ├── filter-template.component.scss │ │ │ │ ├── filter-template.component.spec.ts │ │ │ │ └── filter-template.component.ts │ │ │ ├── latest-valid-version-filter │ │ │ │ ├── latest-valid-version-filter.component.html │ │ │ │ ├── latest-valid-version-filter.component.scss │ │ │ │ ├── latest-valid-version-filter.component.spec.ts │ │ │ │ └── latest-valid-version-filter.component.ts │ │ │ ├── lineage │ │ │ │ ├── lineage.component.html │ │ │ │ ├── lineage.component.scss │ │ │ │ ├── lineage.component.spec.ts │ │ │ │ └── lineage.component.ts │ │ │ ├── partition-filter │ │ │ │ ├── partition-filter.component.html │ │ │ │ ├── partition-filter.component.scss │ │ │ │ ├── partition-filter.component.spec.ts │ │ │ │ └── partition-filter.component.ts │ │ │ ├── registration-date-range-filter │ │ │ │ ├── registration-date-range-filter.component.html │ │ │ │ ├── registration-date-range-filter.component.scss │ │ │ │ ├── registration-date-range-filter.component.spec.ts │ │ │ │ └── registration-date-range-filter.component.ts │ │ │ └── storage-units │ │ │ │ ├── storage-units.component.html │ │ │ │ ├── storage-units.component.scss │ │ │ │ ├── storage-units.component.spec.ts │ │ │ │ └── storage-units.component.ts │ │ ├── data-objects-routing.module.ts │ │ ├── data-objects.module.ts │ │ └── services │ │ │ ├── data-object-detail-resolver.service.spec.ts │ │ │ ├── data-object-detail-resolver.service.ts │ │ │ ├── data-objects-resolver.service.spec.ts │ │ │ └── data-objects-resolver.service.ts │ ├── formats │ │ ├── components │ │ │ ├── attribute-definitions │ │ │ │ ├── attribute-definitions.component.html │ │ │ │ ├── attribute-definitions.component.scss │ │ │ │ ├── attribute-definitions.component.spec.ts │ │ │ │ └── attribute-definitions.component.ts │ │ │ ├── format-detail │ │ │ │ ├── format-detail.component.html │ │ │ │ ├── format-detail.component.scss │ │ │ │ ├── format-detail.component.spec.ts │ │ │ │ └── format-detail.component.ts │ │ │ └── schema-columns │ │ │ │ ├── schema-columns.component.html │ │ │ │ ├── schema-columns.component.scss │ │ │ │ ├── schema-columns.component.spec.ts │ │ │ │ └── schema-columns.component.ts │ │ ├── format-resolver.service.spec.ts │ │ ├── format-resolver.service.ts │ │ ├── formats-routing.module.ts │ │ └── formats.module.ts │ ├── search │ │ ├── components │ │ │ └── search │ │ │ │ ├── search.component.html │ │ │ │ ├── search.component.scss │ │ │ │ ├── search.component.spec.ts │ │ │ │ └── search.component.ts │ │ ├── search-routing.module.ts │ │ ├── search.module.ts │ │ └── services │ │ │ ├── search-resolve.service.spec.ts │ │ │ └── search-resolver.service.ts │ ├── shared │ │ ├── components │ │ │ ├── attributes │ │ │ │ ├── attributes.component.html │ │ │ │ ├── attributes.component.scss │ │ │ │ ├── attributes.component.spec.ts │ │ │ │ └── attributes.component.ts │ │ │ ├── edit │ │ │ │ ├── edit.component.html │ │ │ │ ├── edit.component.scss │ │ │ │ ├── edit.component.spec.ts │ │ │ │ └── edit.component.ts │ │ │ ├── ellipsis-overflow │ │ │ │ ├── ellipsis-overflow.component.html │ │ │ │ ├── ellipsis-overflow.component.scss │ │ │ │ ├── ellipsis-overflow.component.spec.ts │ │ │ │ └── ellipsis-overflow.component.ts │ │ │ ├── facet │ │ │ │ ├── facet.component.html │ │ │ │ ├── facet.component.scss │ │ │ │ ├── facet.component.spec.ts │ │ │ │ └── facet.component.ts │ │ │ ├── generic-view │ │ │ │ ├── generic-view.component.html │ │ │ │ ├── generic-view.component.scss │ │ │ │ ├── generic-view.component.spec.ts │ │ │ │ └── generic-view.component.ts │ │ │ ├── global-search │ │ │ │ ├── global-search.component.html │ │ │ │ ├── global-search.component.scss │ │ │ │ ├── global-search.component.spec.ts │ │ │ │ └── global-search.component.ts │ │ │ ├── side-action │ │ │ │ ├── side-action.component.html │ │ │ │ ├── side-action.component.scss │ │ │ │ ├── side-action.component.spec.ts │ │ │ │ └── side-action.component.ts │ │ │ ├── side-actions │ │ │ │ ├── side-actions.component.html │ │ │ │ ├── side-actions.component.scss │ │ │ │ ├── side-actions.component.spec.ts │ │ │ │ └── side-actions.component.ts │ │ │ ├── spinner │ │ │ │ ├── spinner.component.html │ │ │ │ ├── spinner.component.scss │ │ │ │ ├── spinner.component.spec.ts │ │ │ │ └── spinner.component.ts │ │ │ ├── tri-state │ │ │ │ ├── tri-state.component.html │ │ │ │ ├── tri-state.component.scss │ │ │ │ ├── tri-state.component.spec.ts │ │ │ │ └── tri-state.component.ts │ │ │ └── truncated-content │ │ │ │ ├── truncated-content.component.html │ │ │ │ ├── truncated-content.component.scss │ │ │ │ ├── truncated-content.component.spec.ts │ │ │ │ └── truncated-content.component.ts │ │ ├── directive │ │ │ ├── authorized │ │ │ │ ├── authorized.directive.spec.ts │ │ │ │ └── authorized.directive.ts │ │ │ └── file-downloader │ │ │ │ ├── file-downloader.directive.spec.ts │ │ │ │ └── file-downloader.directive.ts │ │ ├── pipes │ │ │ ├── safe-html.pipe.spec.ts │ │ │ └── safe-html.pipe.ts │ │ ├── read-more │ │ │ ├── read-more.component.html │ │ │ ├── read-more.component.scss │ │ │ ├── read-more.component.spec.ts │ │ │ └── read-more.component.ts │ │ ├── services │ │ │ ├── beast-actions.enum.ts │ │ │ ├── beast-components.enum.ts │ │ │ ├── beast.service.spec.ts │ │ │ ├── beast.service.ts │ │ │ ├── encryption.service.spec.ts │ │ │ ├── encryption.service.ts │ │ │ ├── facet-tri-state.enum.ts │ │ │ ├── highlight-display-mapping.ts │ │ │ ├── search.service.spec.ts │ │ │ ├── search.service.ts │ │ │ └── tri-state-enum.enum.ts │ │ ├── shared.module.ts │ │ ├── styles │ │ │ └── shared.scss │ │ └── utils │ │ │ ├── app-icons.ts │ │ │ └── click-helper.ts │ └── utils │ │ └── utils.ts ├── assets │ └── svg │ │ ├── LOGO.svg │ │ ├── maze.svg │ │ └── testing-image.svg ├── ckset.ts ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.scss ├── test.ts ├── testing │ ├── IndexSearchMockData.ts │ ├── RelatedDataEntities.ts │ ├── mock-ckeditor.component.ts │ ├── mockFormat.ts │ ├── router-stubs.ts │ └── testing-utils.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json └── tslint.json /.code-style-intellij/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 21 | 22 | -------------------------------------------------------------------------------- /.code-style-intellij/inspection-profile.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Copyright 2018 herd-ui contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Editor configuration, see http://editorconfig.org 16 | root = true 17 | 18 | [*] 19 | charset = utf-8 20 | indent_style = space 21 | indent_size = 2 22 | insert_final_newline = true 23 | trim_trailing_whitespace = true 24 | 25 | [*.md] 26 | max_line_length = off 27 | trim_trailing_whitespace = false 28 | -------------------------------------------------------------------------------- /.githooks/pre-commit-check: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright 2018 herd-ui contributors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # shellcheck disable=SC2039 18 | declare -a illegalPatterns=("\bOATS" "[^: .col-9 > .sub-header-label')); 23 | public documentSchemaUrlTxtContainer = element(by.css('.tab-contents > .col-9 p')); 24 | private _container = element(by.id('ngb-tab-2')); 25 | 26 | get documentSchemaFormatTab(): ElementFinder { 27 | return this._tabs.all(by.tagName('li')).get(3).element(by.tagName('a')); 28 | } 29 | 30 | get documentSchemaTab(): ElementFinder { 31 | return this._tabs.all(by.tagName('li')).get(2).element(by.tagName('a')); 32 | } 33 | 34 | get allTabs(): ElementArrayFinder { 35 | return this._tabs.all(by.tagName('li')); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /e2e/app/data-entity/list/data-entity-list.po.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { by, element, ElementArrayFinder, ElementFinder } from 'protractor'; 17 | import { BasePo } from '../../base/base.po'; 18 | 19 | 20 | export class DataEntityListPage extends BasePo { 21 | 22 | 23 | public contentHeader: ElementFinder = element(by.className('content-header')); 24 | public heading: ElementFinder = this.contentHeader.element(by.tagName('h1')); 25 | public subHeading: ElementFinder = this.contentHeader.element(by.tagName('h4')); 26 | 27 | public dataEntityRow: ElementArrayFinder = element.all(by.className('data-entity-row')); 28 | public name: ElementFinder = this.dataEntityRow.get(0).element(by.tagName('h4')); 29 | public namespaceContainer: ElementFinder = this.dataEntityRow.get(0).element(by.tagName('h6')); 30 | 31 | public namespaceLabel: ElementFinder = this.namespaceContainer.all(by.tagName('span')).get(0); 32 | public namespace: ElementFinder = this.namespaceContainer.all(by.tagName('span')).get(1); 33 | 34 | public link: ElementFinder = this.dataEntityRow.get(0).element(by.tagName('a')); 35 | 36 | public searchBox = element(by.tagName('input')); 37 | } 38 | -------------------------------------------------------------------------------- /e2e/app/data-entity/list/operations/data.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import utils from '../../../../util/utils'; 18 | 19 | const uniqueId = utils.uniqueId(); 20 | 21 | export class Data { 22 | 23 | description = 'Sample description text for testing purpose. Used for all description fields'; 24 | defaultDataProvider = 'BDEF_LIST_TEST_PROV' + uniqueId; 25 | defaultNamespace = 'BDEF_LIST_TEST_NS' + uniqueId; 26 | defaultBdefName = 'BDEF_LIST_TEST' + uniqueId; 27 | 28 | defaultBdef() { 29 | return { 30 | 'namespace': this.defaultNamespace, 31 | 'dataProviderName': this.defaultDataProvider, 32 | 'businessObjectDefinitionName': this.defaultBdefName 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /e2e/app/data-entity/sampledata/sampledata.po.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { by, element, ElementArrayFinder, ElementFinder } from 'protractor'; 17 | import { BasePo } from '../../base/base.po'; 18 | 19 | export class SampleDataPage extends BasePo { 20 | sideActions: ElementArrayFinder = element.all(by.tagName('sd-side-action')); 21 | activeIconColor = 'rgba(255, 255, 255, 1)'; 22 | inactiveIconColor = 'rgba(99, 181, 242, 1)'; 23 | sampleDataButton: ElementFinder = this.sideActions.get(3).element(by.tagName('div')); 24 | sampleDataButtonColor: ElementFinder = this.sampleDataButton.element(by.tagName('i')); 25 | watchButton: ElementFinder = this.sideActions.get(2).element(by.tagName('div')); 26 | watchButtonColor: ElementFinder = this.watchButton.element(by.tagName('i')); 27 | } 28 | -------------------------------------------------------------------------------- /e2e/app/data-entity/sme/operations/data.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import utils from '../../../../util/utils'; 18 | 19 | const uniqueId = utils.uniqueId(); 20 | 21 | export class Data { 22 | conf = require('./../../../../config/conf.e2e.json'); 23 | 24 | description = 'Sample description text for testing purpose. Used for all description fields'; 25 | defaultDataProvider = 'HERD_UI_SME_PROV' + uniqueId; 26 | defaultNamespace = 'HERD_UI_SME_NS' + uniqueId; 27 | userId1 = this.conf.smes[0].userId; 28 | userId2 = this.conf.smes[1].userId; 29 | 30 | defaultBdef() { 31 | return { 32 | 'namespace': this.defaultNamespace, 33 | 'dataProviderName': this.defaultDataProvider, 34 | 'businessObjectDefinitionName': 'HERD_UI_SME_TEST' 35 | }; 36 | } 37 | 38 | badBdef() { 39 | return { 40 | 'namespace': this.defaultNamespace, 41 | 'dataProviderName': this.defaultDataProvider, 42 | 'businessObjectDefinitionName': 'HERD_UI_SME_BAD' 43 | }; 44 | } 45 | 46 | emptyBdef() { 47 | return { 48 | 'namespace': this.defaultNamespace, 49 | 'dataProviderName': this.defaultDataProvider, 50 | 'businessObjectDefinitionName': 'HERD_UI_SME_NONE' 51 | }; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /e2e/app/data-objects/detail/base-detail.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { browser } from 'protractor'; 17 | 18 | export class BaseDetail { 19 | private constants = require('../../../config/conf.e2e.json'); 20 | 21 | public async initiateBrowser(bdata, delimiter?, version?, dataObjectrow?) { 22 | // await browser.get(this.dataObjectListUrl(bdata)); 23 | // await this.page.dataObjectPage(dataObjectrow).click(); 24 | await browser.get(this.replaceUrlParams(bdata, delimiter, version)); 25 | } 26 | 27 | public dataObjectListUrl(bdata) { 28 | return this.constants.bdataListPath 29 | .replace('{namespace}', bdata.namespace) 30 | .replace('{definitionName}', bdata.businessObjectDefinitionName) 31 | .replace('{usage}', bdata.businessObjectFormatUsage) 32 | .replace('{fileType}', bdata.businessObjectFormatFileType) 33 | .replace('{formatVersion}', bdata.businessObjectFormatVersion); 34 | } 35 | 36 | // http://localhost:4200/data-objects/PERFDATASEARCH/PERFDATA/DDLDATA/TXT/0/PERKEY10002/0;subPartitionValues=test1%7Cthing2 37 | public replaceUrlParams(bdata, delimiter, version?) { 38 | const ttb = this.constants.bdataDetailPath 39 | .replace('{namespace}', bdata.namespace) 40 | .replace('{definitionName}', bdata.businessObjectDefinitionName) 41 | .replace('{usage}', bdata.businessObjectFormatUsage) 42 | .replace('{formatVersion}', bdata.businessObjectFormatVersion) 43 | .replace('{fileType}', bdata.businessObjectFormatFileType) 44 | .replace('{dataVersion}', version || 0) 45 | .replace('{partitionValue}', bdata.partitionValue) 46 | .replace('{subPartitions}', 47 | bdata.subPartitionValues && bdata.subPartitionValues.length ? 'subPartitionValues=' 48 | + bdata.subPartitionValues.join('%7C') : ''); 49 | return ttb; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /e2e/app/login/login.po.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { browser, by, element, ElementFinder, protractor } from 'protractor'; 17 | 18 | const conf = require('../../config/conf.e2e.json'); 19 | 20 | export class LoginPage { 21 | loginForm: ElementFinder = element(by.css('sd-login .card-block')); 22 | username: ElementFinder = this.loginForm.all(by.tagName('input')).get(0); 23 | password: ElementFinder = this.loginForm.all(by.tagName('input')).get(1); 24 | loginButton: ElementFinder = this.loginForm.element(by.css('.btn-success')); 25 | 26 | async login(name: string = conf.loginUser, pwd: string = conf.loginPwd) { 27 | await this.username.sendKeys(name); 28 | await this.password.sendKeys(pwd); 29 | await this.loginButton.click(); 30 | return browser.wait(protractor.ExpectedConditions.not(protractor.ExpectedConditions.urlContains('returnUrl'))); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /e2e/config/conf.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrlLocal": "http://localhost:4200", 3 | "baseUrlNoPassword": "{{baseUrlNoPassword}}", 4 | "baseUrl8443": "{{baseUrl8443}}", 5 | "herdHost": "{{herdHost}}", 6 | "herdHostSaucelab": "{{herdHostSaucelab}}", 7 | "docTitlePrefix": "UDC", 8 | "homePage": "/", 9 | "searchUrl": "/search", 10 | "dataEntityDetailPath": "/data-entities", 11 | "dataEntityBdefPath": "/data-entities/{namespace}/{businessObjectDefinitionName}", 12 | "categoryDetailPath": "/tags/", 13 | "formatPage": "/formats/", 14 | "bdataListPath": "/data-objects/{namespace}/{definitionName}/{usage}/{fileType}/{version}", 15 | "bdataDetailPath": "/data-objects/{namespace}/{definitionName}/{usage}/{fileType}/{formatVersion}/{partitionValue}/{dataVersion};{subPartitions}", 16 | "datamgtBucket": "{{datamgtBucket}}", 17 | "datamgtTestBucket": "{{datamgtTestBucket}}", 18 | "defaultPrefix": "", 19 | "sauceUser": "{{sauceUser}}", 20 | "sauceKey": "{{sauceKey}}", 21 | "loginUser": "{{loginUser}}", 22 | "loginPwd": "{{loginPwd}}", 23 | "noAccessUser": "{{noAccessUser}}", 24 | "noAccessPassword": "{{noAccessPassword}}", 25 | "sauceSeleniumAddress": "{{sauceSeleniumAddress}}", 26 | "authorization": { 27 | "basicKey": "{{basicKey}}" 28 | }, 29 | "dev": { 30 | "host": "{{host}}", 31 | "port": 5432, 32 | "database": "{{database}}", 33 | "user": "{{user}}", 34 | "password": "{{password}}", 35 | "ssl": true, 36 | "poolSize": 5 37 | }, 38 | "smes": [ 39 | { 40 | "userId": "{{userId}}", 41 | "fullName": "{{fullName}}", 42 | "jobTitle": "{{jobTitle}}", 43 | "phoneNumber": "{{phoneNumber}}", 44 | "email": "{{email}}" 45 | }, 46 | { 47 | "userId": "{{userId}}", 48 | "fullName": "{{fullName}}", 49 | "jobTitle": "{{jobTitle}}", 50 | "phoneNumber": "{{phoneNumber}}", 51 | "email": "{{email}}" 52 | } 53 | ], 54 | "userRoles": { 55 | "authorizedUserRoles": { 56 | "securityRoles": [ 57 | "{{securityRoles}}" 58 | ] 59 | }, 60 | "UnAuthorizedUserRoles": { 61 | "securityRoles": [ 62 | "{{securityRoles}}" 63 | ] 64 | } 65 | }, 66 | "data_objects": { 67 | "{{securityRolesAdmin}}": true, 68 | "{{securityRolesTagOwner}}": true 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /e2e/util/database/queries.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * SQL queries grouped by (!) each table 18 | */ 19 | 20 | export default { 21 | 22 | cnfgn: { 23 | // Use [configurationName, configurationValue] 24 | insertCnfgn: 'INSERT INTO cnfgn values($1,$2,null)', 25 | // Use [configurationName] 26 | deleteCnfgn: 'DELETE FROM cnfgn where cnfgn_nm = $1', 27 | // Use [configurationName, configurationValue] 28 | updateCnfgn: 'UPDATE cnfgn SET cnfgn_value_ds = $2 WHERE cnfgn_key_nm = $1' 29 | } 30 | 31 | 32 | }; 33 | -------------------------------------------------------------------------------- /e2e/util/utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | export default { 19 | dataPrefix: process.env.CURRENT_BROWSER || '', 20 | uniqueId() { 21 | // Retrieve today's date in the format of YYYYMMDD (ex. 20181214) 22 | const today = new Date().toJSON().slice(0, 10).replace(/-/g, ''); 23 | // Generate a 4-digit random in the range of [1000, 9999] 24 | const randomNumber = Math.floor(Math.random() * 9000) + 1000; 25 | // concatenate today and 4-digit number 26 | return '_' + today + '_' + randomNumber; 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /herd-ui-dist-package/README.md: -------------------------------------------------------------------------------- 1 | 16 | # Herd UI Dist 17 | 18 | This module, `herd-ui-dist`, exposes Herd-UI's built dististribution as a dependency-free npm module. 19 | 20 | For anything else, check the [Herd-UI](https://github.com/finraos/herd-ui) repository. -------------------------------------------------------------------------------- /herd-ui-dist-package/distDeploy.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2018 herd-ui contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #!/bin/bash 16 | # Deploy `herd-ui-dist` to npm. 17 | while getopts "r" flag 18 | do 19 | case "$flag" in 20 | r) 21 | RELEASE="true" 22 | ;; 23 | esac 24 | done 25 | 26 | cd "$(dirname "$0")"; 27 | 28 | # Get UI version 29 | UI_VERSION=$(node -p -e "require('../package.json').version"); 30 | DATE=`date '+%Y%m%d%H%M%S'`; 31 | 32 | # Copy UI's dist files to our directory 33 | echo "Copying dist files" 34 | cp -r ../dist .; 35 | 36 | if [ -z ${RELEASE} ]; then 37 | #RELEASE is unset so just publish beta 38 | 39 | echo "setting herd-ui-dist version to $UI_VERSION-beta.$DATE"; 40 | # Replace our version placeholder with UI's version + beta appendix 41 | sed -i "s|\$\$VERSION|$UI_VERSION-beta.$DATE|g" package.json; 42 | 43 | echo "Publishing herd-ui-dist beta $UI_VERSION-beta.$DATE"; 44 | npm publish --tag beta; 45 | else 46 | echo "setting herd-ui-dist version to $UI_VERSION"; 47 | # Replace our version placeholder with UI's version 48 | sed -i "s|\$\$VERSION|$UI_VERSION|g" package.json; 49 | echo "Publishing herd-ui-dist latest $UI_VERSION"; 50 | npm publish; 51 | fi 52 | -------------------------------------------------------------------------------- /herd-ui-dist-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@herd/herd-ui-dist", 3 | "version": "$$VERSION", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://github.com/finraos/herd-ui.git" 7 | }, 8 | "files": [ 9 | "dist" 10 | ], 11 | "license": "Apache-2.0", 12 | "publishConfig": { 13 | "registry": "https://registry.npmjs.org/", 14 | "access": "public" 15 | }, 16 | "dependencies": {}, 17 | "devDependencies": {} 18 | } -------------------------------------------------------------------------------- /license-check.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | (function () { 18 | var fs = require('fs'); 19 | var glob = require('glob-fs')(); 20 | var path = require('path'); 21 | var result = 0; 22 | var exclude = ['LICENSE', path.join('src', 'favicon.ico')]; 23 | var files = []; 24 | files = glob.readdirSync('**'); 25 | files.map((file) => { 26 | try { 27 | if (!fs.lstatSync(file).isDirectory() && file.indexOf('.json') === -1 && exclude.indexOf(file) === -1) { 28 | var data = fs.readFileSync(file, 'utf8'); 29 | 30 | if (data.indexOf('Copyright 2018 herd-ui contributors') === -1) { 31 | console.log('Please add License text in coment in the file ' + file); 32 | result = 1; 33 | } 34 | } 35 | } catch (e) { 36 | console.log('Error:', e.stack); 37 | } 38 | }); 39 | process.exit(result); 40 | })(); 41 | 42 | -------------------------------------------------------------------------------- /run-in-saucelab.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2018 herd-ui contributors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | #!/bin/bash 16 | #usage ./run-in-saucelab.sh 17 | 18 | echo "Installing npm packages..." 19 | npm install 20 | 21 | echo "Running Functianal tests..." 22 | node_modules/protractor/bin/protractor protractor.conf.ci.js 23 | 24 | echo "--- Printing Set Environemnt Variables ---" 25 | printenv 26 | echo "--- Printing Done ---" 27 | 28 | echo "slack.properties is equal to..." 29 | cat slack.properties 30 | echo "done printing slack.properties" 31 | 32 | -------------------------------------------------------------------------------- /setmeup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 herd-ui contributors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | ## script to auto-load code-style and inspection profile (for *nix systems) 18 | 19 | function code_style_setup() { 20 | cp "./.code-style-intellij/codeStyleConfig.xml" "./.idea/codeStyles/codeStyleConfig.xml" 21 | cp "./.code-style-intellij/udc-code-style.xml" "./.idea/codeStyles/Project.xml" 22 | } 23 | 24 | function inspection_profile_setup() { 25 | cp "./.code-style-intellij/inspection-profile.xml" "./.idea/inspectionProfiles/Project_Default.xml" 26 | } 27 | 28 | # setup code-style 29 | if [ -d "./.idea/codeStyles" ]; then 30 | printf "\nRemoving existing code-style, will setup the preferred code-style." 31 | rm -rf "./.idea/codeStyles" 32 | mkdir -p "./.idea/codeStyles" 33 | else 34 | printf "\nNo code-style currently defined, will setup the preferred code-style." 35 | fi 36 | code_style_setup 37 | 38 | # setup inspection-profile 39 | if [ -d "./.idea/inspectionProfiles" ]; then 40 | printf "\nRemoving existing inspection profile, will setup the preferred profile." 41 | rm -rf "./.idea/inspectionProfiles" 42 | mkdir -p "./.idea/inspectionProfiles" 43 | else 44 | printf "\nNo inspection profile currently defined, will setup the preferred profile." 45 | fi 46 | inspection_profile_setup 47 | 48 | printf "\nDone setting up" 49 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 |
24 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .viewLoading { 17 | position: fixed; 18 | top: 0; 19 | left: 0; 20 | z-index: 100000; 21 | width: 100vw; 22 | height: 100vh; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/app/categories/categories-routing.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { RouterModule, Routes } from '@angular/router'; 18 | import { CategoryDetailComponent } from 'app/categories/components/category-detail/category-detail.component'; 19 | import { CategoryDetailResolverService } from 'app/categories/services/categories-detail-resolver'; 20 | 21 | // Base route is /categories defined in app-routing.module.ts 22 | const routes: Routes = [ 23 | { 24 | path: ':tagTypeCode/:tagCode', 25 | component: CategoryDetailComponent, 26 | resolve: { 27 | resolvedData: CategoryDetailResolverService, 28 | } 29 | }, 30 | { 31 | path: ':tagTypeCode/:tagCode/:searchText', 32 | component: CategoryDetailComponent, 33 | resolve: { 34 | resolvedData: CategoryDetailResolverService, 35 | } 36 | } 37 | ]; 38 | 39 | @NgModule({ 40 | imports: [RouterModule.forChild(routes)], 41 | exports: [RouterModule], 42 | providers: [CategoryDetailResolverService] 43 | }) 44 | export class CategoriesRoutingModule { 45 | } 46 | -------------------------------------------------------------------------------- /src/app/categories/categories.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 17 | import { SharedModule } from '../shared/shared.module'; 18 | import { NgModule } from '@angular/core'; 19 | import { CommonModule } from '@angular/common'; 20 | 21 | import { CategoriesRoutingModule } from './categories-routing.module'; 22 | import { CategoryDetailComponent } from './components/category-detail/category-detail.component'; 23 | import { SearchService } from '../shared/services/search.service'; 24 | 25 | @NgModule({ 26 | imports: [ 27 | CommonModule, 28 | CategoriesRoutingModule, 29 | SharedModule, 30 | NgbModule 31 | ], 32 | providers: [ 33 | SearchService 34 | ], 35 | declarations: [ 36 | CategoryDetailComponent 37 | ] 38 | }) 39 | export class CategoriesModule { 40 | } 41 | -------------------------------------------------------------------------------- /src/app/core/components/alerts/alerts.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 |

{{ alert.title }}

19 |
{{ alert.subTitle }}
20 |

{{ alert.text }}

21 |
22 |
23 | -------------------------------------------------------------------------------- /src/app/core/components/alerts/alerts.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .sd-alerts { 17 | position: fixed; 18 | top: 0; 19 | left: 50%; 20 | z-index: 10000000; 21 | transform: translate3d(-50%, 0, 0); 22 | margin-top: 1rem; 23 | max-width: 100%; 24 | } 25 | -------------------------------------------------------------------------------- /src/app/core/components/alerts/alerts.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnInit } from '@angular/core'; 17 | import { Alert, AlertService } from 'app/core/services/alert.service'; 18 | import { map, take } from 'rxjs/operators'; 19 | import { timer } from 'rxjs'; 20 | import { environment } from '../../../../environments/environment'; 21 | 22 | @Component({ 23 | selector: 'sd-alerts', 24 | templateUrl: './alerts.component.html', 25 | styleUrls: ['./alerts.component.scss'] 26 | }) 27 | export class AlertsComponent implements OnInit { 28 | @Input() 29 | public alerts: Array = []; 30 | public delay: number; 31 | 32 | constructor(private alerter: AlertService) { 33 | } 34 | 35 | ngOnInit() { 36 | this.alerter.alerts.subscribe((a: Alert) => { 37 | this.delay = (a.closeDelay || environment.alertDelayInSeconds) * 1000; 38 | // push it on to show 39 | this.alerts = this.alerts.concat(a); 40 | 41 | // close the alert after 5 seconds by default 42 | // have to use timer -> map instead of delay because delay can't currently 43 | // be properly unit tested due to fakeAsync issues. 44 | timer(this.delay).pipe(take(1), map(() => a)).subscribe((al) => this.closeAlert(al)); 45 | }); 46 | } 47 | 48 | public closeAlert(al: Alert) { 49 | const index: number = this.alerts.indexOf(al); 50 | this.alerts.splice(index, 1); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/app/core/components/back-track/back-track.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 20 |
21 | -------------------------------------------------------------------------------- /src/app/core/components/back-track/back-track.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import 'src/styles'; 17 | 18 | .back-track-wrapper { 19 | box-sizing: border-box; 20 | padding: 15px 0; 21 | box-shadow: 0 3px 5px -1px rgba(0, 0, 0, .2), 0 5px 8px 0 rgba(0, 0, 0, .14), 0 1px 14px 0 rgba(0, 0, 0, .12); 22 | color: $brand-blue; 23 | margin-bottom: 35px; 24 | 25 | a { 26 | cursor: pointer; 27 | font-weight: 700; 28 | } 29 | 30 | a:hover { 31 | text-decoration: underline; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/app/core/components/header/header.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 | 42 |
43 |
44 | -------------------------------------------------------------------------------- /src/app/core/components/header/header.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import './../../../../styles'; 17 | 18 | $header-background: $brand-blue; 19 | $header-color: $logo-color; 20 | 21 | .sd-header { 22 | background-color: $header-background; 23 | 24 | .navbar-brand { 25 | width: 120px; 26 | } 27 | 28 | .help { 29 | font-size: 26px; 30 | cursor: pointer; 31 | 32 | a { 33 | color: inherit; 34 | } 35 | } 36 | 37 | .container { 38 | nav { 39 | padding: 0px; 40 | color: $header-color; 41 | background-color: $header-background; 42 | 43 | a { 44 | div { 45 | max-height: 60px; 46 | background-size: contain; 47 | // /deep/ is needed for styling the svg as viewEncapsulation does not work font-kerning: 48 | // inlineSvg yet. /deep/ ignores the view encapsulation attribute addition. 49 | // only needed when the svg is nested heavily. This is currently only needed for IE 50 | /deep/ svg { 51 | width: 120px; 52 | height: 60px; 53 | max-height: 60px !important; 54 | 55 | path { 56 | color: $header-color; 57 | } 58 | 59 | } 60 | } 61 | } 62 | 63 | div { 64 | ul { 65 | li { 66 | a { 67 | color: $header-color; 68 | font-weight: bold; 69 | } 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/app/core/components/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { HeaderComponent } from './header.component'; 19 | import { InlineSVGModule } from 'ng-inline-svg'; 20 | import { RouterTestingModule } from '@angular/router/testing'; 21 | import { HttpClientTestingModule } from '@angular/common/http/testing'; 22 | import { InlineSVGService } from '../../../../../node_modules/ng-inline-svg/lib/inline-svg.service'; 23 | 24 | describe('HeaderComponent', () => { 25 | let component: HeaderComponent; 26 | let fixture: ComponentFixture; 27 | 28 | beforeEach(async(() => { 29 | TestBed.configureTestingModule({ 30 | imports: [ 31 | InlineSVGModule, 32 | RouterTestingModule, 33 | HttpClientTestingModule 34 | ], 35 | declarations: [ 36 | HeaderComponent 37 | ], 38 | providers: [ 39 | InlineSVGService 40 | ] 41 | }) 42 | .compileComponents(); 43 | })); 44 | 45 | beforeEach(() => { 46 | fixture = TestBed.createComponent(HeaderComponent); 47 | component = fixture.componentInstance; 48 | fixture.detectChanges(); 49 | }); 50 | 51 | afterEach(() => { 52 | fixture.destroy(); 53 | }); 54 | 55 | it('should create', () => { 56 | expect(component).toBeTruthy(); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /src/app/core/components/header/header.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, OnInit } from '@angular/core'; 17 | import { environment } from '../../../../environments/environment'; 18 | 19 | @Component({ 20 | selector: 'sd-header', 21 | templateUrl: './header.component.html', 22 | styleUrls: ['./header.component.scss'] 23 | }) 24 | export class HeaderComponent implements OnInit { 25 | public helpUrl: string; 26 | 27 | constructor() { 28 | } 29 | 30 | ngOnInit() { 31 | this.helpUrl = environment.helpUrl; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/app/core/components/home/home.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 | 27 | 28 |
29 | 30 |
31 |

32 | 33 | 34 | 35 |
Click Explore to view all categories
36 |

37 |
38 | 39 |
40 | 41 |
42 |
43 |
44 |

{{tagType.displayName}}

45 | 46 | 53 | 54 |
55 |
56 |
57 | 58 |
59 |
60 | 61 |
62 | -------------------------------------------------------------------------------- /src/app/core/components/login/login.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | body { 17 | background-color: #0c8bea; 18 | } 19 | 20 | .container { 21 | padding: 250px; 22 | } 23 | 24 | .card-header { 25 | color: #ffffff; 26 | background-color: #31a9e2; 27 | } 28 | 29 | .card { 30 | border-color: #006bd0; 31 | box-shadow: 1px 4px 7px 0px #003b75, 0px 4px 17px 0px #07427b; 32 | position: fixed; 33 | top: 50%; 34 | left: 50%; 35 | width: 50%; 36 | transform: translate(-50%, -50%); 37 | } 38 | 39 | .splash { 40 | position: absolute; 41 | top: 0; 42 | left: 0; 43 | width: 100%; 44 | height: 100%; 45 | background-color: #0c8bea; 46 | opacity: 1; 47 | pointer-events: none; 48 | /*wait until the opacity is finished and then move the splash screen back*/ 49 | transition: opacity .8s ease-in-out, z-index .1s linear .8s; 50 | z-index: -1; 51 | } 52 | 53 | .splash > svg { 54 | position: absolute; 55 | top: 50%; 56 | left: 50%; 57 | transform: translate(-50%, -50%); 58 | width: 50vw; 59 | height: 50vh; 60 | } 61 | 62 | sd-root:empty + .splash { 63 | opacity: 1; 64 | z-index: 100; 65 | } 66 | -------------------------------------------------------------------------------- /src/app/core/services/alert.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { inject, TestBed } from '@angular/core/testing'; 17 | 18 | import { AlertService, DangerAlert, InfoAlert, SuccessAlert, WarningAlert } from './alert.service'; 19 | import { bufferCount } from 'rxjs/operators'; 20 | 21 | describe('AlertService', () => { 22 | beforeEach(() => { 23 | TestBed.configureTestingModule({ 24 | providers: [AlertService] 25 | }); 26 | }); 27 | 28 | it('should return Observable when alerts are accessed and alert() should send new alerts', 29 | inject([AlertService], (service: AlertService) => { 30 | 31 | service.alerts.pipe(bufferCount(4)).subscribe((values) => { 32 | expect(values[0] instanceof SuccessAlert).toBe(true); 33 | expect(values[1] instanceof InfoAlert).toBe(true); 34 | expect(values[2] instanceof WarningAlert).toBe(true); 35 | expect(values[3] instanceof DangerAlert).toBe(true); 36 | }); 37 | 38 | service.alert(new SuccessAlert('test', 'testSub', 'success text')); 39 | service.alert(new InfoAlert('test', 'testSub', 'info text')); 40 | service.alert(new WarningAlert('test', 'testSub', 'warning text')); 41 | service.alert(new DangerAlert('test', 'testSub', 'danger text')); 42 | })); 43 | }); 44 | -------------------------------------------------------------------------------- /src/app/core/services/alert.service.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Injectable } from '@angular/core'; 17 | import { Observable, ReplaySubject } from 'rxjs'; 18 | 19 | export interface Alert { 20 | title: string; 21 | subTitle: string; 22 | text: string; 23 | type: AlertType; 24 | closeDelay?: number; 25 | } 26 | 27 | export class SuccessAlert implements Alert { 28 | readonly type: AlertType; 29 | 30 | constructor(public title: string, public subTitle, public text, public closeDelay?: number) { 31 | this.type = 'success'; 32 | } 33 | } 34 | 35 | export class InfoAlert implements Alert { 36 | readonly type: AlertType; 37 | 38 | constructor(public title: string, public subTitle, public text, public closeDelay?: number) { 39 | this.type = 'info'; 40 | } 41 | } 42 | 43 | export class WarningAlert implements Alert { 44 | readonly type: AlertType; 45 | 46 | constructor(public title: string, public subTitle, public text, public closeDelay?: number) { 47 | this.type = 'warning'; 48 | } 49 | } 50 | 51 | export class DangerAlert implements Alert { 52 | readonly type: AlertType; 53 | 54 | constructor(public title: string, public subTitle, public text, public closeDelay?: number) { 55 | this.type = 'danger'; 56 | } 57 | } 58 | 59 | export type AlertType = 'success' | 'info' | 'warning' | 'danger'; 60 | 61 | 62 | @Injectable() 63 | export class AlertService { 64 | 65 | get alerts(): Observable { 66 | return this._alerts.asObservable(); 67 | } 68 | 69 | private _alerts: ReplaySubject; 70 | 71 | constructor() { 72 | this._alerts = new ReplaySubject(); 73 | } 74 | 75 | /** 76 | * Sends a message to be seen globally. 77 | */ 78 | public alert(m: Alert) { 79 | this._alerts.next(m); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/app/core/services/auth-guard.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { inject, TestBed } from '@angular/core/testing'; 17 | 18 | import { AuthGuardService } from './auth-guard.service'; 19 | import { Router } from '@angular/router'; 20 | import { RouterStub } from 'testing/router-stubs'; 21 | import { UserService } from 'app/core/services/user.service'; 22 | 23 | describe('AuthGuardService', () => { 24 | beforeEach(() => { 25 | TestBed.configureTestingModule({ 26 | providers: [ 27 | AuthGuardService, 28 | { 29 | provide: Router, 30 | useClass: RouterStub 31 | }, { 32 | provide: UserService, 33 | useValue: { 34 | getCurrentUser: jasmine.createSpy('getCurrentUser') 35 | } 36 | } 37 | ] 38 | }); 39 | }); 40 | 41 | it('should be created', inject([AuthGuardService], (service: AuthGuardService) => { 42 | expect(service).toBeDefined(); 43 | })); 44 | 45 | it('should not call load if already authenticated', inject([AuthGuardService, Router], 46 | (service: AuthGuardService, router: Router, userService: UserService) => { 47 | })); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /src/app/core/services/auth-guard.service.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Injectable } from '@angular/core'; 17 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; 18 | import { Observable } from 'rxjs'; 19 | import { UserService } from './user.service'; 20 | import { environment } from '../../../environments/environment'; 21 | import { catchError, map } from 'rxjs/operators'; 22 | import { of } from 'rxjs/internal/observable/of'; 23 | 24 | @Injectable() 25 | export class AuthGuardService implements CanActivate { 26 | constructor( 27 | private currentUserService: UserService, 28 | private router: Router) { 29 | } 30 | 31 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Observable | Promise { 32 | // if logged in 33 | if (this.currentUserService.isAuthenticated) { 34 | return true; 35 | // If not logged in but we want to attempt to initialize the user information 36 | // due to APP_INITIALIZER based authentication happening 37 | } else if (!environment.useBasicAuth) { 38 | return this.currentUserService.getCurrentUser().pipe( 39 | map((resp: any) => { 40 | if (resp.userId) { 41 | return true; 42 | } 43 | }), 44 | catchError((e) => { 45 | environment.useBasicAuth = true; 46 | this.router.navigate(['/login'], { 47 | replaceUrl: true, 48 | queryParams: { 49 | returnUrl: state.url, 50 | } 51 | }); 52 | return of(false as any); 53 | }) 54 | ) as any; 55 | } else { 56 | this.router.navigate(['/login'], { 57 | replaceUrl: true, 58 | queryParams: { 59 | returnUrl: state.url 60 | } 61 | }); 62 | return false; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/app/core/services/http-intercept.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { inject, TestBed } from '@angular/core/testing'; 17 | 18 | import { HttpInterceptService } from './http-intercept.service'; 19 | import { AlertService } from './alert.service'; 20 | 21 | describe('HttpInterceptService', () => { 22 | beforeEach(() => { 23 | TestBed.configureTestingModule({ 24 | providers: [ 25 | AlertService, 26 | HttpInterceptService 27 | ] 28 | }); 29 | }); 30 | 31 | it('should be created', inject([HttpInterceptService], (service: HttpInterceptService) => { 32 | expect(service).toBeTruthy(); 33 | })); 34 | }); 35 | -------------------------------------------------------------------------------- /src/app/core/services/no-auth-guard.service.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Injectable } from '@angular/core'; 17 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router'; 18 | import { Observable } from 'rxjs'; 19 | import { UserService } from './user.service'; 20 | import { environment } from '../../../environments/environment'; 21 | 22 | @Injectable() 23 | export class NoAuthGuardService implements CanActivate { 24 | constructor( 25 | private currentUserService: UserService, 26 | private router: Router) { 27 | } 28 | 29 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean | Observable | Promise { 30 | if (environment.useBasicAuth) { 31 | return true; 32 | } else { 33 | this.router.navigate(['/'], { 34 | replaceUrl: true, 35 | }); 36 | return false; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/app/data-entities/components/contacts/contacts.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .row { 17 | border: 1px solid; 18 | border-color: #ffffff; 19 | 20 | .col-1 { 21 | display: none; 22 | background-color: #dddddd; 23 | text-align: center; 24 | } 25 | } 26 | 27 | .edit { 28 | border: 1px solid; 29 | border-color: #b1aeae; 30 | } 31 | 32 | .edit-icon { 33 | display: inline-block !important; 34 | } 35 | 36 | .alert-info { 37 | color: #0076ea; 38 | background-color: #f6faff; 39 | border-color: #3b79b5; 40 | } 41 | -------------------------------------------------------------------------------- /src/app/data-entities/components/data-entity-list/data-entity-list.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 |
19 | 20 | 21 |
22 | 23 |
24 |

Data Entities

25 |

Showing {{ dataEntities.length }} of {{ total }}

26 |
27 | 28 |
29 |
30 |

{{dataEntity.businessObjectDefinitionName}}

31 |
32 | Namespace: 33 | {{ dataEntity.namespace}} 34 |
35 |
36 | 41 |
42 | 43 | 44 |
45 |
46 | -------------------------------------------------------------------------------- /src/app/data-entities/components/data-entity-list/data-entity-list.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import 'src/styles'; 17 | 18 | .data-entity-list-view { 19 | margin-top: 25px; 20 | 21 | input { 22 | display: inline-block; 23 | width: 98%; 24 | } 25 | 26 | i { 27 | width: 2%; 28 | vertical-align: middle; 29 | text-align: center; 30 | position: relative; 31 | } 32 | 33 | i:before { 34 | display: inline-block; 35 | position: absolute; 36 | top: 50%; 37 | left: 50%; 38 | transform: translate3d(-50%, -50%, 0); 39 | } 40 | 41 | .data-entity-row { 42 | border: 1px solid #e8e8e8; 43 | margin-bottom: 5px; 44 | padding: 10px 5px; 45 | 46 | div:nth-child(2) > a { 47 | font-size: .8125rem; 48 | } 49 | 50 | h4 { 51 | font-size: 1.125rem; 52 | } 53 | 54 | h6 span:first-child { 55 | font-weight: .8125rem; 56 | } 57 | 58 | h4, 59 | h6 span:first-child { 60 | font-weight: 700; 61 | } 62 | 63 | } 64 | 65 | .content-header { 66 | margin: 30px 0; 67 | 68 | h1 { 69 | font-size: 2rem; 70 | font-weight: 700; 71 | margin: 0; 72 | } 73 | 74 | h4 { 75 | font-size: 1.2rem; 76 | } 77 | } 78 | 79 | .filter-results { 80 | margin: 0; 81 | color: $subheader-grey; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/app/data-entities/components/suggestions/suggestions.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .main-model { 17 | margin-bottom: 40px; 18 | 19 | .flex-column { 20 | font-size: 12px; 21 | margin-bottom: 20px; 22 | 23 | div:first-child { 24 | color: #9cd588; 25 | 26 | span { 27 | } 28 | } 29 | 30 | div:nth-child(2) { 31 | color: #ffb7ba; 32 | 33 | span { 34 | } 35 | } 36 | } 37 | 38 | .card { 39 | border: 0; 40 | box-shadow: 1px 2px 2px 0px #dddddd; 41 | margin-bottom: 22px; 42 | 43 | .card-header { 44 | padding: 10px 10px 2px; 45 | background-color: #b7d7f5; 46 | border-bottom: 0; 47 | } 48 | 49 | .card-block { 50 | padding: 2px 16px; 51 | background-color: rgba(246, 250, 255, 0.73); 52 | 53 | .row { 54 | border: 1px solid rgba(246, 250, 255, 0.73); 55 | 56 | .col { 57 | padding: 2px 0 2px 2px; 58 | 59 | .suggest-diff { 60 | font-family: monospace; 61 | } 62 | } 63 | 64 | .col-1 { 65 | padding: 2px 2px 2px 4px; 66 | flex: 0 0 3%;; 67 | } 68 | } 69 | 70 | .editor { 71 | margin-bottom: 10px; 72 | } 73 | 74 | .editor-buttons { 75 | margin-bottom: 10px; 76 | } 77 | } 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/app/data-entities/components/tags/tags.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../../shared/styles/shared'; 17 | 18 | $button-hover-color: $table-header-color; 19 | 20 | .tags-container { 21 | button.tag-button { 22 | @include button-style; 23 | margin: 5px 0px; 24 | font-size: 14px; 25 | border-radius: 0; 26 | white-space: normal; 27 | padding: 0.5rem 0.5rem; 28 | border: 0; 29 | } 30 | 31 | button.tag-button:not([disabled]):hover { 32 | background-color: $button-hover-color; 33 | } 34 | 35 | .inner-header { 36 | @include inner-header; 37 | } 38 | 39 | p { 40 | @include unavailable-label 41 | } 42 | 43 | .list-inline { 44 | padding: 0 2px 0 2px; 45 | } 46 | } 47 | 48 | /* scss for the edit gasture on mouse over */ 49 | .tags-content { 50 | margin: 0; 51 | border: 1px solid; 52 | border-color: #ffffff; 53 | 54 | .col-1 { 55 | display: none; 56 | text-align: center; 57 | background-color: #dddddd; 58 | } 59 | } 60 | 61 | .edit { 62 | border: 1px solid; 63 | border-color: #b1aeae; 64 | } 65 | 66 | .edit-icon { 67 | display: inline-block !important; 68 | } 69 | 70 | -------------------------------------------------------------------------------- /src/app/data-entities/data-entities-routing.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { RouterModule, Routes } from '@angular/router'; 18 | import { DataEntityListComponent } from 'app/data-entities/components/data-entity-list/data-entity-list.component'; 19 | import { DataEntityDetailComponent } from 'app/data-entities/components/data-entity-detail/data-entity-detail.component'; 20 | import { DataEntityListResolverService } from 'app/data-entities/services/data-entity-list-resolver'; 21 | import { DataEntityDetailResolverService } from 'app/data-entities/services/data-entity-detail-resolver'; 22 | // Base route is /data-entities defined in app-routing.module.ts 23 | const routes: Routes = [{ 24 | path: ':namespace/:dataEntityName', 25 | component: DataEntityDetailComponent, 26 | resolve: { 27 | resolvedData: DataEntityDetailResolverService, 28 | } 29 | }, { 30 | path: '', 31 | component: DataEntityListComponent, 32 | data: { 33 | ignorePreviousTitle: true // cancel using previous title 34 | }, 35 | resolve: { 36 | resolvedData: DataEntityListResolverService, 37 | }, 38 | runGuardsAndResolvers: 'always' 39 | }]; 40 | 41 | @NgModule({ 42 | imports: [RouterModule.forChild(routes)], 43 | exports: [RouterModule], 44 | providers: [ 45 | DataEntityListResolverService, 46 | DataEntityDetailResolverService 47 | ] 48 | }) 49 | export class DataEntitiesRoutingModule { 50 | } 51 | -------------------------------------------------------------------------------- /src/app/data-entities/data-entities.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { DataEntitiesRoutingModule } from './data-entities-routing.module'; 18 | import { DataEntityListComponent } from 'app/data-entities/components/data-entity-list/data-entity-list.component'; 19 | import { DataEntityDetailComponent } from 'app/data-entities/components/data-entity-detail/data-entity-detail.component'; 20 | import { SharedModule } from '../shared/shared.module'; 21 | import { TagsComponent } from './components/tags/tags.component'; 22 | import { ContactsComponent } from './components/contacts/contacts.component'; 23 | import { SuggestionsComponent } from './components/suggestions/suggestions.component'; 24 | import { DiffMatchPatchModule } from 'ng-diff-match-patch/dist'; 25 | 26 | @NgModule({ 27 | imports: [ 28 | DataEntitiesRoutingModule, 29 | SharedModule, 30 | DiffMatchPatchModule 31 | ], 32 | declarations: [ 33 | DataEntityListComponent, 34 | DataEntityDetailComponent, 35 | TagsComponent, 36 | ContactsComponent, 37 | SuggestionsComponent 38 | ] 39 | }) 40 | export class DataEntitiesModule { 41 | } 42 | -------------------------------------------------------------------------------- /src/app/data-objects/components/attribute-filter/attribute-filter.component.html: -------------------------------------------------------------------------------- 1 | 16 | 17 |
18 |
19 | 20 |
22 | {{ attributeFilterForm.errors.atLeastOneRequired }} 23 |
24 |
25 | 26 |
27 |
28 | 29 |
30 | 31 | 32 | 33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /src/app/data-objects/components/attribute-filter/attribute-filter.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .form-errors { 17 | color: red; 18 | } 19 | -------------------------------------------------------------------------------- /src/app/data-objects/components/data-object-list-filters/data-object-list-filters.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .data-object-list-filters { 17 | padding: 20px 15px; 18 | margin-bottom: 30px; 19 | margin-left: 0; 20 | margin-right: 0; 21 | box-shadow: 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12); 22 | } 23 | 24 | .filters { 25 | margin: 0; 26 | } 27 | -------------------------------------------------------------------------------- /src/app/data-objects/components/data-object-list/data-object-list.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import './../../../../styles'; 17 | 18 | div[header-content] { 19 | padding-left: 15px; 20 | border-left: 10px solid black; 21 | margin-bottom: 30px; 22 | 23 | .main-header { 24 | font-size: 3rem; 25 | font-weight: bold; 26 | } 27 | 28 | .sub-header { 29 | margin: 0; 30 | font-size: 1rem; 31 | font-weight: bold; 32 | } 33 | 34 | .sub-header > *:not(:last-child) { 35 | margin-right: .5rem; 36 | } 37 | } 38 | 39 | div[main-content] { 40 | position: relative; 41 | } 42 | 43 | p-datatable { 44 | /deep/ .ui-widget-content a { 45 | color: $blue; 46 | } 47 | 48 | /deep/ .ui-datatable .ui-datatable-scrollable-body { 49 | min-height: 350px; 50 | } 51 | 52 | /deep/ .ui-datatable-tablewrapper { 53 | overflow-x: scroll; 54 | } 55 | 56 | // only needed while their library has the issue take this out once PR is merged into PrimeNg Datatable 57 | @media(max-width: 35em) { 58 | /deep/ .ui-datatable-reflow { 59 | .ui-datatable-data > tr > td { 60 | width: 100% !important; 61 | } 62 | } 63 | } 64 | 65 | /deep/ .table-header { 66 | margin: 0; 67 | } 68 | } 69 | 70 | .modal-header { 71 | background-color: #2399e5; 72 | border-color: #2399e5; 73 | } 74 | -------------------------------------------------------------------------------- /src/app/data-objects/components/filter-template/filter-template.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 |
19 | {{ title }} 20 |
21 | 22 |
23 | 26 |
27 |
28 | 29 |
30 |
31 |
32 | 33 |
34 |
35 | -------------------------------------------------------------------------------- /src/app/data-objects/components/filter-template/filter-template.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import './../../../../styles'; 17 | 18 | .filter { 19 | position: relative; 20 | background-color: rgba(255, 255, 255, 1); 21 | 22 | .filter-title { 23 | border: 1px solid grey; 24 | margin: 0; 25 | 26 | .close-col:hover { 27 | background-color: $blue; 28 | } 29 | } 30 | 31 | .filter-content { 32 | background-color: rgba(255, 255, 255, 1); 33 | box-shadow: 0 7px 9px -4px rgba(0, 0, 0, .2), 0 14px 21px 2px rgba(0, 0, 0, .14), 0 5px 26px 4px rgba(0, 0, 0, .12); 34 | width: 100%; 35 | box-sizing: border-box; 36 | position: absolute; 37 | padding: 15px; 38 | 39 | /deep/ input { 40 | line-height: 1.15; 41 | } 42 | } 43 | } 44 | 45 | .filter.open { 46 | z-index: 50; 47 | } 48 | -------------------------------------------------------------------------------- /src/app/data-objects/components/filter-template/filter-template.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { FilterTemplateComponent } from './filter-template.component'; 19 | import { EllipsisOverflowComponent } from 'app/shared/components/ellipsis-overflow/ellipsis-overflow.component'; 20 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 21 | 22 | describe('FilterTemplateComponent', () => { 23 | let component: FilterTemplateComponent; 24 | let fixture: ComponentFixture; 25 | 26 | beforeEach(async(() => { 27 | TestBed.configureTestingModule({ 28 | imports: [NgbModule], 29 | declarations: [ 30 | FilterTemplateComponent, EllipsisOverflowComponent 31 | ] 32 | }) 33 | .compileComponents(); 34 | })); 35 | 36 | beforeEach(() => { 37 | fixture = TestBed.createComponent(FilterTemplateComponent); 38 | component = fixture.componentInstance; 39 | fixture.detectChanges(); 40 | }); 41 | 42 | it('should be created', () => { 43 | expect(component).toBeTruthy(); 44 | }); 45 | 46 | it('should toggle and remove filter', () => { 47 | component.remove(); 48 | component.isFilterContentShown = false; 49 | component.toggleContent(); 50 | expect(component.isFilterContentShown).toBeTruthy(); 51 | }); 52 | 53 | }); 54 | -------------------------------------------------------------------------------- /src/app/data-objects/components/filter-template/filter-template.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-filter-template', 20 | templateUrl: './filter-template.component.html', 21 | styleUrls: ['./filter-template.component.scss'], 22 | changeDetection: ChangeDetectionStrategy.OnPush 23 | }) 24 | export class FilterTemplateComponent implements OnInit { 25 | 26 | @Input() title: string; 27 | @Input() isFilterContentShown: boolean; 28 | @Output() isFilterContentShownChange: EventEmitter = new EventEmitter(); 29 | @Output() removeFilter: EventEmitter = new EventEmitter(); 30 | 31 | constructor() { 32 | } 33 | 34 | ngOnInit() { 35 | // make shown by default 36 | if (this.isFilterContentShown === null || this.isFilterContentShown === undefined) { 37 | this.isFilterContentShown = true; 38 | } 39 | } 40 | 41 | toggleContent() { 42 | this.isFilterContentShown = !this.isFilterContentShown; 43 | this.isFilterContentShownChange.emit(this.isFilterContentShown); 44 | } 45 | 46 | remove() { 47 | this.removeFilter.emit(null); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/app/data-objects/components/latest-valid-version-filter/latest-valid-version-filter.component.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/app/data-objects/components/latest-valid-version-filter/latest-valid-version-filter.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | sd-filter-template { 17 | /deep/ .filter-content { 18 | display: none; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/app/data-objects/components/latest-valid-version-filter/latest-valid-version-filter.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { LatestValidVersionFilterComponent } from './latest-valid-version-filter.component'; 19 | import { FilterTemplateComponent } from 'app/data-objects/components/filter-template/filter-template.component'; 20 | import { EllipsisOverflowComponent } from 'app/shared/components/ellipsis-overflow/ellipsis-overflow.component'; 21 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 22 | 23 | describe('LatestValidVersionFilterComponent', () => { 24 | let component: LatestValidVersionFilterComponent; 25 | let fixture: ComponentFixture; 26 | 27 | beforeEach(async(() => { 28 | TestBed.configureTestingModule({ 29 | imports: [NgbModule], 30 | declarations: [LatestValidVersionFilterComponent, 31 | FilterTemplateComponent, 32 | EllipsisOverflowComponent] 33 | }) 34 | .compileComponents(); 35 | })); 36 | 37 | beforeEach(() => { 38 | fixture = TestBed.createComponent(LatestValidVersionFilterComponent); 39 | component = fixture.componentInstance; 40 | fixture.detectChanges(); 41 | }); 42 | 43 | it('should be created', () => { 44 | expect(component).toBeTruthy(); 45 | expect(component.title).toBe('Latest Valid Version'); 46 | }); 47 | 48 | it('should emit that it is deleted on delete binding', () => { 49 | component.filterDeleted.subscribe((deleteText) => { 50 | expect(deleteText).toBe('Latest Valid Version'); 51 | }); 52 | spyOn(component.filterDeleted, 'emit').and.callThrough(); 53 | component.delete(); 54 | expect(component.filterDeleted.emit).toHaveBeenCalledWith('Latest Valid Version'); 55 | }); 56 | }); 57 | -------------------------------------------------------------------------------- /src/app/data-objects/components/latest-valid-version-filter/latest-valid-version-filter.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, EventEmitter, OnInit, Output } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-latest-valid-version-filter', 20 | templateUrl: './latest-valid-version-filter.component.html', 21 | styleUrls: ['./latest-valid-version-filter.component.scss'] 22 | }) 23 | export class LatestValidVersionFilterComponent implements OnInit { 24 | 25 | title = 'Latest Valid Version'; 26 | @Output() filterDeleted: EventEmitter = new EventEmitter(); 27 | 28 | constructor() { 29 | } 30 | 31 | ngOnInit() { 32 | } 33 | 34 | delete() { 35 | this.filterDeleted.emit('Latest Valid Version'); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/app/data-objects/components/lineage/lineage.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../../shared/styles/shared'; 17 | 18 | .columns-content { 19 | .columns-header { 20 | .list-group-item { 21 | @include table-heading; 22 | @include text-styling(14px, 700, #fff); 23 | } 24 | } 25 | 26 | .columns-detail { 27 | .list-group-item { 28 | @include table-contents; 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/app/data-objects/components/lineage/lineage.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { LineageComponent } from './lineage.component'; 19 | import { EllipsisOverflowComponent } from 'app/shared/components/ellipsis-overflow/ellipsis-overflow.component'; 20 | import { RouterTestingModule } from '@angular/router/testing'; 21 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 22 | 23 | describe('LineageComponent', () => { 24 | let component: LineageComponent; 25 | let fixture: ComponentFixture; 26 | 27 | const bdata = [{ 28 | namespace: '', 29 | businessObjectDefinitionName: '', 30 | businessObjectFormatUsage: '', 31 | businessObjectFormatFileType: '', 32 | businessObjectFormatVersion: '', 33 | partitionValue: '', 34 | businessObjectDataVersion: '', 35 | subPartitionValues: ['|', ''] 36 | }]; 37 | 38 | beforeEach(async(() => { 39 | TestBed.configureTestingModule({ 40 | imports: [RouterTestingModule, NgbModule], 41 | declarations: [LineageComponent, EllipsisOverflowComponent] 42 | }) 43 | .compileComponents(); 44 | })); 45 | 46 | beforeEach(() => { 47 | fixture = TestBed.createComponent(LineageComponent); 48 | component = fixture.componentInstance; 49 | component.content = bdata; 50 | fixture.detectChanges(); 51 | }); 52 | 53 | it('should be created', () => { 54 | expect(component).toBeTruthy(); 55 | }); 56 | }); 57 | -------------------------------------------------------------------------------- /src/app/data-objects/components/lineage/lineage.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnInit } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-lineage', 20 | templateUrl: './lineage.component.html', 21 | styleUrls: ['./lineage.component.scss'] 22 | }) 23 | export class LineageComponent implements OnInit { 24 | 25 | @Input() content; 26 | 27 | constructor() { 28 | } 29 | 30 | ngOnInit() { 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/app/data-objects/components/partition-filter/partition-filter.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .error { 17 | color: red; 18 | } 19 | -------------------------------------------------------------------------------- /src/app/data-objects/components/registration-date-range-filter/registration-date-range-filter.component.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 |
19 |
20 | 21 |
22 | 23 |
24 | 25 | {{ registrationDateRangeFilterForm.errors.valueRequired}} 26 | 27 |
28 | 29 |
30 | 31 | 32 |
33 | 34 |
35 | 36 | 37 |
38 | 39 | 40 | 41 |
42 | 43 |
44 | 45 |
46 | -------------------------------------------------------------------------------- /src/app/data-objects/components/registration-date-range-filter/registration-date-range-filter.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .error { 17 | color: red; 18 | line-height: 1; 19 | } 20 | 21 | hr { 22 | margin-top: -6px; 23 | } 24 | -------------------------------------------------------------------------------- /src/app/data-objects/components/storage-units/storage-units.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../../shared/styles/shared'; 17 | 18 | .storage-units { 19 | .columns-content { 20 | .columns-header { 21 | .list-group-item { 22 | @include table-heading; 23 | @include text-styling(14px, 700, #fff); 24 | } 25 | } 26 | 27 | .columns-detail { 28 | .list-group-item { 29 | border-radius: 0; 30 | @include text-styling(13px, 400); 31 | 32 | .storage-attribute:not(:last-child) { 33 | margin-bottom: 10px; 34 | } 35 | 36 | .btn-link { 37 | padding: 0 8px; 38 | text-align: center; 39 | cursor: pointer; 40 | cursor: hand; 41 | 42 | .fa-cloud-download { 43 | font-size: 25px; 44 | color: #0074d9 45 | } 46 | } 47 | } 48 | } 49 | 50 | } 51 | 52 | .left-blue-border { 53 | border-left: 15px solid #0074d9; 54 | height: 60px; 55 | } 56 | 57 | h2 { 58 | padding-left: 16px; 59 | padding-top: 15px; 60 | @include text-styling(24px, bold, #0074d9); 61 | } 62 | 63 | .sub-header-label { 64 | @include sub-header-label; 65 | @include side-detail-box(30px); 66 | } 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/app/data-objects/components/storage-units/storage-units.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core'; 17 | import { NamespaceAuthorization, StorageUnit } from '@herd/angular-client'; 18 | import { AuthMap } from '../../../shared/directive/authorized/authorized.directive'; 19 | 20 | @Component({ 21 | selector: 'sd-storage-units', 22 | templateUrl: './storage-units.component.html', 23 | styleUrls: ['./storage-units.component.scss'], 24 | encapsulation: ViewEncapsulation.None 25 | }) 26 | export class StorageUnitsComponent implements OnInit { 27 | 28 | @Input() namespace: string; 29 | @Input() storageUnits: StorageUnit[]; 30 | @Output() downloadAFile = new EventEmitter(); 31 | attributesToShow = ['bucket.name', 'jdbc.url', 'jdbc.username', 'jdbc.user.credential.name']; 32 | authMap = AuthMap; 33 | editDescriptiveContentPermissions = [ 34 | NamespaceAuthorization.NamespacePermissionsEnum.READ 35 | ]; 36 | 37 | constructor() { 38 | } 39 | 40 | ngOnInit() { 41 | } 42 | 43 | downloadFile(storageFile, storage) { 44 | this.downloadAFile.emit({...storageFile, storage}); 45 | } 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/app/data-objects/data-objects-routing.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { RouterModule, Routes } from '@angular/router'; 18 | import { DataObjectDetailComponent } from 'app/data-objects/components/data-object-detail/data-object-detail.component'; 19 | import { DataObjectListComponent } from 'app/data-objects/components/data-object-list/data-object-list.component'; 20 | import { DataObjectsResolverService } from 'app/data-objects/services/data-objects-resolver.service'; 21 | import { DataObjectDetailResolverService } from './services/data-object-detail-resolver.service'; 22 | 23 | const routes: Routes = [{ 24 | path: `:namespace/:dataEntityName/:formatUsage/:formatFileType/:formatVersion/:partitionValue/:dataObjectVersion`, 25 | component: DataObjectDetailComponent, 26 | resolve: { 27 | resolvedData: DataObjectDetailResolverService 28 | } 29 | }, { 30 | path: ':namespace/:dataEntityName/:formatUsage/:formatFileType/:formatVersion', 31 | component: DataObjectListComponent, 32 | resolve: { 33 | resolvedData: DataObjectsResolverService 34 | } 35 | }, { 36 | path: ':namespace/:dataEntityName', 37 | component: DataObjectListComponent, 38 | resolve: { 39 | resolvedData: DataObjectsResolverService 40 | } 41 | }]; 42 | 43 | @NgModule({ 44 | imports: [RouterModule.forChild(routes)], 45 | exports: [RouterModule], 46 | providers: [ 47 | DataObjectsResolverService, 48 | DataObjectDetailResolverService 49 | ] 50 | }) 51 | export class DataObjectsRoutingModule { 52 | } 53 | -------------------------------------------------------------------------------- /src/app/data-objects/services/data-objects-resolver.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { inject, TestBed } from '@angular/core/testing'; 17 | import { DataObjectsResolverService } from './data-objects-resolver.service'; 18 | 19 | describe('DataObjectsResolverService', () => { 20 | beforeEach(() => { 21 | TestBed.configureTestingModule({ 22 | providers: [DataObjectsResolverService] 23 | }); 24 | }); 25 | 26 | it('should be created', inject([DataObjectsResolverService], (service: DataObjectsResolverService) => { 27 | expect(service).toBeTruthy(); 28 | })); 29 | }); 30 | -------------------------------------------------------------------------------- /src/app/data-objects/services/data-objects-resolver.service.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Injectable } from '@angular/core'; 17 | import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; 18 | import { TitleResolverData } from 'app/data-entities/services/data-entity-list-resolver'; 19 | 20 | @Injectable() 21 | export class DataObjectsResolverService implements Resolve { 22 | constructor() { 23 | } 24 | 25 | resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): TitleResolverData { 26 | const params = route.params; 27 | const bdefString = `${params.namespace} : ${params.dataEntityName}`; 28 | const schemaString = params.formatUsage && params.formatFileType && params.formatVersion ? 29 | `${params.formatUsage} : ${params.formatFileType} : ${params.formatVersion}` : ''; 30 | return {title: 'Data Objects - ' + bdefString + (schemaString ? ` | ${schemaString}` : '')}; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/app/formats/components/attribute-definitions/attribute-definitions.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 | No attribute definitions registered 19 |
20 |
21 |
22 |
23 |
Name
24 |
Published
25 |
26 |
27 |
29 |
30 |
{{businessObjectFormatAttributeDefinition.name}}
31 |
{{businessObjectFormatAttributeDefinition.publish ? 'Yes' : 'No'}}
32 |
33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /src/app/formats/components/attribute-definitions/attribute-definitions.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../../shared/styles/shared'; 17 | 18 | .columns-content { 19 | .columns-header { 20 | .list-group-item { 21 | @include table-heading; 22 | @include text-styling(14px, 700, #fff); 23 | } 24 | } 25 | 26 | .columns-detail { 27 | .list-group-item { 28 | @include table-contents; 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/app/formats/components/attribute-definitions/attribute-definitions.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { AttributeDefinitionsComponent } from './attribute-definitions.component'; 19 | 20 | describe('AttributeDefinitionsComponent', () => { 21 | let component: AttributeDefinitionsComponent; 22 | let fixture: ComponentFixture; 23 | 24 | beforeEach(async(() => { 25 | TestBed.configureTestingModule({ 26 | declarations: [AttributeDefinitionsComponent] 27 | }) 28 | .compileComponents(); 29 | })); 30 | 31 | beforeEach(() => { 32 | fixture = TestBed.createComponent(AttributeDefinitionsComponent); 33 | component = fixture.componentInstance; 34 | fixture.detectChanges(); 35 | }); 36 | 37 | it('should be created', () => { 38 | expect(component).toBeTruthy(); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /src/app/formats/components/attribute-definitions/attribute-definitions.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnInit } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-attribute-definitions', 20 | templateUrl: './attribute-definitions.component.html', 21 | styleUrls: ['./attribute-definitions.component.scss'] 22 | }) 23 | export class AttributeDefinitionsComponent implements OnInit { 24 | 25 | @Input() content; 26 | 27 | constructor() { 28 | } 29 | 30 | ngOnInit() { 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/app/formats/components/schema-columns/schema-columns.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../../shared/styles/shared'; 17 | 18 | .schema-columns { 19 | .technical-notes { 20 | font-weight: 700; 21 | } 22 | 23 | p-datatable { 24 | td { 25 | white-space: normal !important; 26 | } 27 | 28 | /deep/ .ui-datatable-tablewrapper { 29 | overflow-x: auto; 30 | } 31 | 32 | /deep/ .ui-datatable { 33 | margin-top: 20px; 34 | } 35 | 36 | 37 | // only needed while their library has the issue take this out once PR is merged into PrimeNg Datatable 38 | @media(max-width: 35em) { 39 | /deep/ .ui-datatable-reflow { 40 | .ui-datatable-data > tr > td { 41 | width: 100% !important; 42 | } 43 | } 44 | } 45 | 46 | /deep/ .table-header { 47 | margin: 0; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/app/formats/format-resolver.service.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Injectable } from '@angular/core'; 17 | import { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router'; 18 | import { Observable, of } from 'rxjs'; 19 | 20 | export interface TitleResolverData { 21 | title?: string; 22 | } 23 | 24 | export interface FormatResolverServiceData extends TitleResolverData { 25 | businessObjectFormatDetail: any; 26 | } 27 | 28 | @Injectable() 29 | export class FormatResolverService implements Resolve { 30 | 31 | constructor(private router: Router) { 32 | } 33 | 34 | public resolve(route: ActivatedRouteSnapshot, 35 | state: RouterStateSnapshot): Observable | TitleResolverData { 36 | 37 | if (!this.router.routeReuseStrategy.shouldAttach(route)) { 38 | const retval: FormatResolverServiceData = { 39 | businessObjectFormatDetail: null, 40 | title: 'Format - ' + route.params.formatUsage + ':' 41 | + route.params.formatFileType + ':' + route.params.formatVersion 42 | }; 43 | return of(retval as any); 44 | 45 | } else { 46 | return { 47 | title: 'Format - ' + route.params.formatUsage + ':' 48 | + route.params.formatFileType + ':' + route.params.formatVersion 49 | }; 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/app/formats/formats-routing.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { RouterModule, Routes } from '@angular/router'; 18 | import { FormatDetailComponent } from 'app/formats/components/format-detail/format-detail.component'; 19 | import { FormatResolverService } from './format-resolver.service'; 20 | 21 | const routes: Routes = [{ 22 | path: ':namespace/:dataEntityname/:formatUsage/:formatFileType/:formatVersion', 23 | component: FormatDetailComponent, 24 | resolve: { 25 | resolvedData: FormatResolverService, 26 | } 27 | }]; 28 | 29 | @NgModule({ 30 | imports: [RouterModule.forChild(routes)], 31 | providers: [ 32 | FormatResolverService 33 | ], 34 | exports: [RouterModule] 35 | }) 36 | export class FormatsRoutingModule { 37 | } 38 | -------------------------------------------------------------------------------- /src/app/formats/formats.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 17 | import { NgModule } from '@angular/core'; 18 | import { CommonModule } from '@angular/common'; 19 | import { SharedModule } from '../shared/shared.module'; 20 | import { FormatsRoutingModule } from './formats-routing.module'; 21 | import { FormatDetailComponent } from 'app/formats/components/format-detail/format-detail.component'; 22 | import { SchemaColumnsComponent } from './components/schema-columns/schema-columns.component'; 23 | import { AttributeDefinitionsComponent } from './components/attribute-definitions/attribute-definitions.component'; 24 | 25 | 26 | @NgModule({ 27 | imports: [ 28 | CommonModule, 29 | FormatsRoutingModule, 30 | SharedModule, 31 | NgbModule 32 | ], 33 | declarations: [ 34 | FormatDetailComponent, 35 | SchemaColumnsComponent, 36 | AttributeDefinitionsComponent 37 | ] 38 | }) 39 | export class FormatsModule { 40 | } 41 | -------------------------------------------------------------------------------- /src/app/search/search-routing.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { RouterModule, Routes } from '@angular/router'; 18 | import { SearchComponent } from 'app/search/components/search/search.component'; 19 | import { SearchResolverService } from './services/search-resolver.service'; 20 | 21 | const routes: Routes = [{ 22 | path: ':searchText', 23 | component: SearchComponent, 24 | resolve: { 25 | resolvedData: SearchResolverService, 26 | }, 27 | runGuardsAndResolvers: 'always' 28 | }]; 29 | 30 | @NgModule({ 31 | imports: [RouterModule.forChild(routes)], 32 | providers: [ 33 | SearchResolverService 34 | ], 35 | exports: [RouterModule] 36 | }) 37 | export class SearchRoutingModule { 38 | } 39 | -------------------------------------------------------------------------------- /src/app/search/search.module.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { NgModule } from '@angular/core'; 17 | import { CommonModule } from '@angular/common'; 18 | 19 | import { SearchRoutingModule } from './search-routing.module'; 20 | import { SearchComponent } from 'app/search/components/search/search.component'; 21 | import { SharedModule } from '../shared/shared.module'; 22 | import { SearchService } from '../shared/services/search.service'; 23 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 24 | 25 | @NgModule({ 26 | imports: [ 27 | CommonModule, 28 | NgbModule, 29 | SearchRoutingModule, 30 | SharedModule 31 | ], 32 | providers: [ 33 | SearchService 34 | ], 35 | declarations: [ 36 | SearchComponent, 37 | ] 38 | }) 39 | export class SearchModule { 40 | } 41 | -------------------------------------------------------------------------------- /src/app/shared/components/attributes/attributes.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 | No user-defined attributes registered 19 |
20 |
21 |
22 |
23 |
Name
24 |
Value
25 |
26 |
27 |
28 |
29 |
{{attribute.name}}
30 |
{{attribute.value}}
31 |
32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /src/app/shared/components/attributes/attributes.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../../shared/styles/shared'; 17 | 18 | .columns-content { 19 | .columns-header { 20 | .list-group-item { 21 | @include table-heading; 22 | @include text-styling(14px, 700, #fff); 23 | } 24 | } 25 | 26 | .columns-detail { 27 | .list-group-item { 28 | @include table-contents; 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/app/shared/components/attributes/attributes.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { AttributesComponent } from './attributes.component'; 19 | 20 | describe('AttributesComponent', () => { 21 | let component: AttributesComponent; 22 | let fixture: ComponentFixture; 23 | 24 | beforeEach(async(() => { 25 | TestBed.configureTestingModule({ 26 | declarations: [AttributesComponent] 27 | }) 28 | .compileComponents(); 29 | })); 30 | 31 | beforeEach(() => { 32 | fixture = TestBed.createComponent(AttributesComponent); 33 | component = fixture.componentInstance; 34 | fixture.detectChanges(); 35 | }); 36 | 37 | afterEach(() => { 38 | fixture.destroy(); 39 | }); 40 | 41 | it('should be created', () => { 42 | expect(component).toBeTruthy(); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /src/app/shared/components/attributes/attributes.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnInit } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-attributes', 20 | templateUrl: './attributes.component.html', 21 | styleUrls: ['./attributes.component.scss'] 22 | }) 23 | export class AttributesComponent implements OnInit { 24 | 25 | @Input() content; 26 | 27 | constructor() { 28 | } 29 | 30 | ngOnInit() { 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/app/shared/components/edit/edit.component.html: -------------------------------------------------------------------------------- 1 | 16 |
18 |
19 |
20 | 21 |
22 |
23 | 24 |
25 |
26 |
27 |
28 | {{ editForm.errors.valueRequired }} 29 | {{ editForm.errors.illegalCharacters }} 31 |
32 | 34 | 35 | 36 | 37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 |
45 | -------------------------------------------------------------------------------- /src/app/shared/components/edit/edit.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .row { 17 | margin: 0; 18 | border: 0px solid; 19 | border-color: inherit; 20 | 21 | .col:empty { 22 | min-height: 2em; 23 | } 24 | 25 | .col-1 { 26 | background-color: #dddddd; 27 | text-align: center; 28 | font-size: initial; 29 | max-width: 24px; 30 | } 31 | } 32 | 33 | .edit { 34 | border: 1px solid; 35 | border-color: #b1aeae; 36 | } 37 | -------------------------------------------------------------------------------- /src/app/shared/components/ellipsis-overflow/ellipsis-overflow.component.html: -------------------------------------------------------------------------------- 1 | 16 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | {{ ellipsisContent || '' }} 26 | 27 | 28 |
29 | -------------------------------------------------------------------------------- /src/app/shared/components/ellipsis-overflow/ellipsis-overflow.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../styles/shared'; 17 | 18 | sd-ellipsis-overflow { 19 | max-width: 100%; 20 | display: inline-block; 21 | height: 100%; 22 | } 23 | 24 | .ellipsis-overflow { 25 | display: inline-block; 26 | overflow: hidden; 27 | white-space: nowrap; 28 | text-overflow: ellipsis; 29 | vertical-align: middle; 30 | width: 100%; 31 | margin: 0; 32 | padding: 0; 33 | border: 0; 34 | } 35 | 36 | .tooltip { 37 | @include tooltip-style; 38 | } 39 | -------------------------------------------------------------------------------- /src/app/shared/components/ellipsis-overflow/ellipsis-overflow.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { AfterViewInit, Component, ElementRef, Input, ViewChild, ViewEncapsulation } from '@angular/core'; 17 | import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; 18 | 19 | @Component({ 20 | selector: 'sd-ellipsis-overflow', 21 | templateUrl: './ellipsis-overflow.component.html', 22 | styleUrls: ['./ellipsis-overflow.component.scss'], 23 | encapsulation: ViewEncapsulation.None 24 | }) 25 | export class EllipsisOverflowComponent implements AfterViewInit { 26 | 27 | 28 | @Input() public ellipsisContent; 29 | @Input() public tooltipDirection; 30 | @ViewChild(NgbTooltip) public tooltip: NgbTooltip; 31 | private isEllipisOverflow; 32 | private div; 33 | 34 | constructor(private elementRef: ElementRef) { 35 | } 36 | 37 | ngAfterViewInit() { 38 | this.div = this.elementRef.nativeElement.getElementsByClassName('ellipsis-overflow')[0]; 39 | } 40 | 41 | enableTooltip() { 42 | // tolerance of -3 due to IE offsetWidth issues 43 | if (this.div.clientWidth < this.div.scrollWidth - 3) { 44 | this.tooltip.ngbTooltip = this.div.innerText; 45 | this.tooltip.open(); 46 | } 47 | } 48 | 49 | disableTooltip() { 50 | this.tooltip.close(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/app/shared/components/facet/facet.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
Refine By
18 | reset 19 |
20 |
21 | 22 |
24 | 25 |
26 | {{facet.facetDisplayName}} 27 | 28 | 29 |
30 | 31 |
32 | 33 |
34 | 35 |
    36 |
  • 37 | 41 | 42 |
  • 43 |
44 | 45 |
46 | 47 |
48 | -------------------------------------------------------------------------------- /src/app/shared/components/facet/facet.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | sd-facet { 17 | .card-header { 18 | background-color: #dddddd; 19 | } 20 | 21 | .card-block { 22 | padding: 7px 0 0 8px;; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/app/shared/components/generic-view/generic-view.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 | 19 |
20 |
21 | 22 |
23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 |
34 |
35 |
36 | 37 |
38 | -------------------------------------------------------------------------------- /src/app/shared/components/generic-view/generic-view.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | .generic-template { 17 | margin-top: 30px; 18 | margin-bottom: 20px; 19 | } 20 | -------------------------------------------------------------------------------- /src/app/shared/components/generic-view/generic-view.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | import { GenericViewComponent } from './generic-view.component'; 18 | 19 | describe('GenericViewComponent', () => { 20 | let component: GenericViewComponent; 21 | let fixture: ComponentFixture; 22 | 23 | beforeEach(async(() => { 24 | TestBed.configureTestingModule({ 25 | declarations: [GenericViewComponent] 26 | }) 27 | .compileComponents(); 28 | })); 29 | 30 | beforeEach(() => { 31 | fixture = TestBed.createComponent(GenericViewComponent); 32 | component = fixture.componentInstance; 33 | fixture.detectChanges(); 34 | }); 35 | 36 | afterEach(() => { 37 | fixture.destroy(); 38 | }); 39 | 40 | it('should create', () => { 41 | expect(component).toBeTruthy(); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /src/app/shared/components/generic-view/generic-view.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, OnInit, ViewEncapsulation } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-generic-view', 20 | templateUrl: './generic-view.component.html', 21 | styleUrls: ['./generic-view.component.scss'], 22 | encapsulation: ViewEncapsulation.None 23 | }) 24 | export class GenericViewComponent implements OnInit { 25 | 26 | constructor() { 27 | } 28 | 29 | ngOnInit() { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/app/shared/components/global-search/global-search.component.html: -------------------------------------------------------------------------------- 1 | 16 |
Please supply at least 3 characters.
17 | 18 |
19 | 20 | 22 | 23 |
24 | 25 |
26 |
27 | 30 | 35 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /src/app/shared/components/side-action/side-action.component.html: -------------------------------------------------------------------------------- 1 | 16 |
18 | 19 | 20 |
21 | -------------------------------------------------------------------------------- /src/app/shared/components/side-action/side-action.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import '../../styles/shared'; 17 | 18 | $side-action-disabled-color: #63b5f2; 19 | $side-action-enabled-color: $white; 20 | 21 | .side-action { 22 | text-align: center; 23 | padding: 5px; 24 | margin: 0px 5px; 25 | 26 | .icon { 27 | @include text-styling(18px, bolder, $side-action-disabled-color); 28 | } 29 | 30 | label { 31 | @include text-styling(13px, bolder, $side-action-disabled-color); 32 | } 33 | } 34 | 35 | div.enabled { 36 | 37 | .icon { 38 | cursor: pointer; 39 | @include text-styling(18px, bolder, $side-action-enabled-color); 40 | } 41 | 42 | label { 43 | cursor: pointer; 44 | @include text-styling(13px, bolder, $side-action-enabled-color); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/shared/components/side-action/side-action.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnInit } from '@angular/core'; 17 | 18 | export class Action { 19 | /** 20 | * @parameter icon string representing the icon 21 | * @parameter label string representing the label for the action 22 | * @parameter onAction optional call back function to be executed when the action is clicked 23 | * @parameter isDisabled Function to control whether or not the action should occur 24 | */ 25 | constructor(public icon: string, 26 | public label: string, 27 | public onAction?: () => any, 28 | public isDisabled?: boolean | (() => boolean)) { 29 | } 30 | } 31 | 32 | @Component({ 33 | selector: 'sd-side-action', 34 | templateUrl: './side-action.component.html', 35 | styleUrls: ['./side-action.component.scss'] 36 | }) 37 | export class SideActionComponent implements OnInit { 38 | 39 | @Input() action: Action; 40 | 41 | constructor() { 42 | } 43 | 44 | ngOnInit() { 45 | 46 | } 47 | 48 | public checkDisabled(): boolean { 49 | 50 | if (this.action.onAction) { 51 | // make enabled if nothing is passed in otherwise use the passed in variable 52 | if (typeof this.action.isDisabled === 'boolean') { 53 | return this.action.isDisabled; 54 | } else if (typeof this.action.isDisabled === 'function') { 55 | // make sure to just pass back true or false and not a value 56 | return !!this.action.isDisabled(); 57 | } else { 58 | // if action exists by default make enabled 59 | return false; 60 | } 61 | } 62 | // by default make disabled if no action exists 63 | return true; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/app/shared/components/side-actions/side-actions.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 | 19 |
20 | -------------------------------------------------------------------------------- /src/app/shared/components/side-actions/side-actions.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import './../../../../styles'; 17 | 18 | .side-actions-wrapper { 19 | background-color: $brand-blue; 20 | max-width: 70px !important; 21 | } 22 | -------------------------------------------------------------------------------- /src/app/shared/components/side-actions/side-actions.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnInit } from '@angular/core'; 17 | import { Action } from '../side-action/side-action.component'; 18 | 19 | @Component({ 20 | selector: 'sd-side-actions', 21 | templateUrl: './side-actions.component.html', 22 | styleUrls: ['./side-actions.component.scss'] 23 | }) 24 | export class SideActionsComponent implements OnInit { 25 | 26 | @Input() actions: Action[]; 27 | 28 | constructor() { 29 | } 30 | 31 | ngOnInit() { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/app/shared/components/spinner/spinner.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 |
18 | 19 | 20 |
21 | 22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /src/app/shared/components/spinner/spinner.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | div.wrapper { 17 | background-color: rgba(0, 0, 0, .5); 18 | position: absolute; 19 | bottom: 0; 20 | right: 0; 21 | top: 0; 22 | left: 0; 23 | } 24 | 25 | div.spinner-wrapper:before { 26 | content: ""; 27 | display: block; 28 | padding-top: 100%; 29 | } 30 | 31 | div.spinner-wrapper { 32 | position: absolute; 33 | top: 50%; 34 | left: 50%; 35 | min-width: 25%; 36 | transform: translate(-50%, -50%); 37 | 38 | div.spinner-svg-logo, div.spinner { 39 | position: absolute; 40 | top: 0; 41 | left: 0; 42 | bottom: 0; 43 | right: 0; 44 | } 45 | 46 | div.spinner { 47 | border: 20px solid; 48 | border-radius: 100%; 49 | border-top-color: rgba(0, 0, 0, 0); 50 | border-left-color: white; 51 | border-right-color: white; 52 | border-bottom-color: rgba(0, 0, 0, 0); 53 | animation: spin 1s ease-out infinite; 54 | } 55 | 56 | div.spinner-svg-logo { 57 | padding: 25px; 58 | 59 | /deep/ svg { 60 | position: absolute; 61 | top: 50%; 62 | left: 50%; 63 | transform: translate(-50%, -50%); 64 | max-width: 100%; 65 | max-height: 100%; 66 | } 67 | } 68 | } 69 | 70 | @keyframes spin { 71 | from { 72 | transform: rotate(0deg); 73 | } 74 | 75 | to { 76 | transform: rotate(360deg); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/app/shared/components/spinner/spinner.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | 18 | import { SpinnerComponent } from './spinner.component'; 19 | import { InlineSVGModule } from 'ng-inline-svg'; 20 | import { APP_BASE_HREF } from '@angular/common'; 21 | import { HttpClientTestingModule } from '@angular/common/http/testing'; 22 | import { InlineSVGService } from '../../../../../node_modules/ng-inline-svg/lib/inline-svg.service'; 23 | 24 | describe('SpinnerComponent', () => { 25 | let component: SpinnerComponent; 26 | let fixture: ComponentFixture; 27 | 28 | beforeEach(async(() => { 29 | TestBed.configureTestingModule({ 30 | imports: [ 31 | InlineSVGModule, 32 | HttpClientTestingModule 33 | ], 34 | providers: [ 35 | { 36 | provide: APP_BASE_HREF, 37 | useValue: '/' 38 | }, 39 | InlineSVGService 40 | ], 41 | declarations: [ 42 | SpinnerComponent 43 | ] 44 | }) 45 | .compileComponents(); 46 | })); 47 | 48 | beforeEach(() => { 49 | fixture = TestBed.createComponent(SpinnerComponent); 50 | component = fixture.componentInstance; 51 | fixture.detectChanges(); 52 | }); 53 | 54 | afterEach(() => { 55 | fixture.destroy(); 56 | }); 57 | 58 | it('should be created', () => { 59 | expect(component).toBeTruthy(); 60 | }); 61 | }); 62 | -------------------------------------------------------------------------------- /src/app/shared/components/spinner/spinner.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-spinner', 20 | templateUrl: './spinner.component.html', 21 | styleUrls: ['./spinner.component.scss'], 22 | changeDetection: ChangeDetectionStrategy.OnPush 23 | }) 24 | export class SpinnerComponent implements OnInit { 25 | constructor() { 26 | } 27 | 28 | ngOnInit() { 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/app/shared/components/tri-state/tri-state.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {{label}} 29 |
30 | 31 | -------------------------------------------------------------------------------- /src/app/shared/components/tri-state/tri-state.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | sd-tri-state { 17 | cursor: pointer; 18 | 19 | * { 20 | cursor: pointer; 21 | outline: none; 22 | } 23 | 24 | div { 25 | span.fa-stack { 26 | width: 17px; 27 | height: 21px; 28 | line-height: 0.75em; 29 | } 30 | 31 | span { 32 | i.fa-stack-1x { 33 | top: 0; 34 | } 35 | 36 | i.fa-check { 37 | font-size: 16px; 38 | } 39 | 40 | i.fa-close { 41 | font-size: 16px; 42 | } 43 | } 44 | } 45 | 46 | .tri-state-label { 47 | margin-left: 6px; 48 | } 49 | 50 | /*.tri-state-checkbox { 51 | width: 20px; 52 | height: 20px; 53 | border-width: 1px; 54 | border-style: solid; 55 | border-radius: 2px; 56 | margin: 3px 5px 3px 10px; 57 | box-sizing: border-box; 58 | position: relative; 59 | i { 60 | font-size: inherit; 61 | min-height: 100%; 62 | min-width: 100%; 63 | height: 100%; 64 | width: 100%; 65 | box-sizing: border-box; 66 | position: absolute; 67 | .state-one { 68 | background-color: inherit; 69 | } 70 | } 71 | .state-two { 72 | i { 73 | color: green; 74 | } 75 | 76 | } 77 | .state-three { 78 | i { 79 | color: red; 80 | } 81 | } 82 | 83 | } 84 | .tri-state-label.state-three { 85 | text-decoration: line-through; 86 | }*/ 87 | 88 | } 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/app/shared/components/tri-state/tri-state.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 17 | import { TriStateComponent, TriStateEnum } from './tri-state.component'; 18 | 19 | describe('TriStateComponent', () => { 20 | let component: TriStateComponent; 21 | let fixture: ComponentFixture; 22 | 23 | beforeEach(async(() => { 24 | TestBed.configureTestingModule({ 25 | declarations: [TriStateComponent] 26 | }) 27 | .compileComponents(); 28 | })); 29 | 30 | beforeEach(() => { 31 | fixture = TestBed.createComponent(TriStateComponent); 32 | component = fixture.componentInstance; 33 | }); 34 | 35 | afterEach(() => { 36 | fixture.destroy(); 37 | }); 38 | 39 | it('should be created', () => { 40 | expect(component).toBeTruthy(); 41 | }); 42 | 43 | it('should set state when already defined', () => { 44 | component.state = TriStateEnum.State2; 45 | fixture.detectChanges(); 46 | expect(component.state).toEqual(TriStateEnum.State2); 47 | }); 48 | 49 | it('should toggle between all the three states', () => { 50 | component.state = undefined; 51 | fixture.detectChanges(); 52 | expect(component.state).toEqual(TriStateEnum.State1); 53 | 54 | component.changeState(); 55 | fixture.detectChanges(); 56 | expect(component.state).toEqual(TriStateEnum.State2); 57 | 58 | component.changeState(); 59 | fixture.detectChanges(); 60 | expect(component.state).toEqual(TriStateEnum.State3); 61 | 62 | component.changeState(); 63 | fixture.detectChanges(); 64 | expect(component.state).toEqual(TriStateEnum.State1); 65 | 66 | // invalid state 67 | component.state = undefined; 68 | component.checkState(); 69 | 70 | }); 71 | }); 72 | -------------------------------------------------------------------------------- /src/app/shared/components/tri-state/tri-state.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core'; 17 | 18 | export enum TriStateEnum { 19 | State1, 20 | State2, 21 | State3 22 | } 23 | 24 | @Component({ 25 | selector: 'sd-tri-state', 26 | templateUrl: './tri-state.component.html', 27 | styleUrls: ['./tri-state.component.scss'], 28 | encapsulation: ViewEncapsulation.None 29 | }) 30 | export class TriStateComponent implements OnInit { 31 | 32 | @Input() label: string; 33 | @Input() state: number; 34 | @Input() triStateId: number; 35 | @Output() propagate = new EventEmitter(); 36 | 37 | constructor() { 38 | } 39 | 40 | ngOnInit() { 41 | if (!this.state) { 42 | this.state = TriStateEnum.State1; 43 | } else { 44 | this.state = this.state; 45 | } 46 | } 47 | 48 | public changeState() { 49 | this.state = (this.state + 1) % 3; 50 | this.propagate.emit({facetState: this.state}); 51 | } 52 | 53 | public checkState() { 54 | let className: string; 55 | switch (this.state) { 56 | case TriStateEnum.State1: 57 | className = 'state-one'; 58 | break; 59 | case TriStateEnum.State2: 60 | className = 'state-two'; 61 | break; 62 | case TriStateEnum.State3: 63 | className = 'state-three'; 64 | break; 65 | default: 66 | break; 67 | } 68 | 69 | return className; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/app/shared/components/truncated-content/truncated-content.component.html: -------------------------------------------------------------------------------- 1 | 16 |
17 | 18 |
19 | 20 | 21 | 22 | 23 |
24 | 25 |
26 |
27 |
28 | 29 | 30 |
31 |
32 | {{ readMoreText }} 33 |
34 | -------------------------------------------------------------------------------- /src/app/shared/components/truncated-content/truncated-content.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | @import './../../../../styles'; 17 | 18 | .truncated-content-wrapper { 19 | overflow: hidden; 20 | transition: all 0.5s; 21 | width: 100%; 22 | position: relative; 23 | } 24 | 25 | .truncated-content { 26 | line-height: 1.2; 27 | width: 100%; 28 | } 29 | 30 | .truncated-content * { 31 | line-height: inherit !important; 32 | } 33 | 34 | .toggle-content { 35 | text-transform: capitalize; 36 | cursor: pointer; 37 | color: $blue; 38 | opacity: .5; 39 | text-align: right; 40 | transition: all 0.5s; 41 | width: 100%; 42 | height: 1.2rem; 43 | } 44 | 45 | .hide { 46 | display: none; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/app/shared/directive/file-downloader/file-downloader.directive.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { SimpleChanges } from '@angular/core'; 17 | import { FileDownloaderDirective } from './file-downloader.directive'; 18 | 19 | describe('FileDownloaderDirective', () => { 20 | 21 | it('should create an instance', () => { 22 | const directive = new FileDownloaderDirective(); 23 | expect(directive).toBeTruthy(); 24 | }); 25 | 26 | it('should call download file when url changes and does not when invalid', () => { 27 | const directive = new FileDownloaderDirective(); 28 | directive.sampleDataFileUrl = 'http://herd-ui.test'; 29 | let fc = true; 30 | const downloadSpy = spyOn(directive, 'download'); 31 | const changeObj: SimpleChanges = { 32 | sampleDataFileUrl: { 33 | currentValue: 'http://test.url', 34 | previousValue: directive.sampleDataFileUrl, 35 | firstChange: true, 36 | isFirstChange: () => fc 37 | } 38 | }; 39 | 40 | // download should not be called on the first change 41 | directive.ngOnChanges(changeObj); 42 | expect(downloadSpy).not.toHaveBeenCalled(); 43 | 44 | // download should not be called when url is empty 45 | fc = false; 46 | changeObj.sampleDataFileUrl.currentValue = ''; 47 | directive.ngOnChanges(changeObj); 48 | expect(downloadSpy).not.toHaveBeenCalled(); 49 | 50 | // download should get called when the value changes 51 | changeObj.sampleDataFileUrl.currentValue = 'http://newval.url'; 52 | directive.ngOnChanges(changeObj); 53 | expect(downloadSpy).toHaveBeenCalledWith(changeObj.sampleDataFileUrl.currentValue); 54 | }); 55 | }); 56 | -------------------------------------------------------------------------------- /src/app/shared/directive/file-downloader/file-downloader.directive.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Directive, Input, OnChanges, SimpleChanges } from '@angular/core'; 17 | 18 | @Directive({ 19 | selector: '[sdFileDownloader]' 20 | }) 21 | export class FileDownloaderDirective implements OnChanges { 22 | 23 | @Input() sampleDataFileUrl: string; 24 | 25 | constructor() { 26 | } 27 | 28 | public ngOnChanges(changesObj: SimpleChanges) { 29 | const urlChange = changesObj['sampleDataFileUrl']; 30 | if (!urlChange.isFirstChange() && urlChange.currentValue) { 31 | this.download(urlChange.currentValue); 32 | } 33 | } 34 | 35 | public download(url: string) { 36 | const a = document.createElement('a'); 37 | a.href = url; 38 | a.download = 'FileData'; 39 | a.target = '_self'; 40 | document.body.appendChild(a); 41 | a.click(); 42 | document.body.removeChild(a); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/app/shared/pipes/safe-html.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { SafeHtmlPipe } from './safe-html.pipe'; 17 | import { DomSanitizer } from '@angular/platform-browser'; 18 | import { inject } from '@angular/core/testing'; 19 | 20 | describe('SafeHtmlPipe', () => { 21 | it('create an instance', inject([DomSanitizer], (sanitizer: DomSanitizer) => { 22 | const pipe = new SafeHtmlPipe(sanitizer); 23 | expect(sanitizer).toBeTruthy(); 24 | expect(pipe).toBeTruthy(); 25 | })); 26 | }); 27 | -------------------------------------------------------------------------------- /src/app/shared/pipes/safe-html.pipe.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Pipe, PipeTransform } from '@angular/core'; 17 | import { DomSanitizer } from '@angular/platform-browser'; 18 | 19 | @Pipe({name: 'safeHtml'}) 20 | export class SafeHtmlPipe implements PipeTransform { 21 | 22 | constructor(private sanitized: DomSanitizer) { 23 | } 24 | 25 | transform(value) { 26 | return this.sanitized.bypassSecurityTrustHtml(value); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/app/shared/read-more/read-more.component.html: -------------------------------------------------------------------------------- 1 | 16 | 22 | 23 | -------------------------------------------------------------------------------- /src/app/shared/read-more/read-more.component.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /src/app/shared/read-more/read-more.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, Input, OnChanges } from '@angular/core'; 17 | 18 | @Component({ 19 | selector: 'sd-read-more', 20 | templateUrl: './read-more.component.html', 21 | styleUrls: ['./read-more.component.scss'] 22 | }) 23 | 24 | export class ReadMoreComponent implements OnChanges { 25 | @Input() text: string; 26 | @Input() maxLength = 100; 27 | @Input() hideLink: boolean; 28 | @Input() linkLabel: string; 29 | public currentText: string; 30 | public hideToggle = true; 31 | 32 | public isCollapsed = true; 33 | 34 | constructor() { 35 | } 36 | 37 | toggleView() { 38 | this.isCollapsed = !this.isCollapsed; 39 | this.determineView(); 40 | } 41 | 42 | determineView() { 43 | if (this.text.length <= this.maxLength) { 44 | this.currentText = this.text; 45 | this.isCollapsed = false; 46 | this.hideToggle = true; 47 | return; 48 | } 49 | this.hideToggle = false; 50 | if (this.isCollapsed === true) { 51 | this.currentText = this.text.substring(0, this.maxLength); 52 | this.currentText = this.currentText.split('
')[0]; 53 | this.currentText += (this.hideLink) ? '...' : ''; 54 | } else if (this.isCollapsed === false) { 55 | this.currentText = this.text; 56 | } 57 | 58 | } 59 | 60 | ngOnChanges() { 61 | this.determineView(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/app/shared/services/beast-actions.enum.ts: -------------------------------------------------------------------------------- 1 | export enum BeastActions { 2 | viewDataObjectDetails = 'View Data Object Details', 3 | viewDataObejctList = 'View Data Object List', 4 | viewColumns = 'View Columns', 5 | viewDocumentSchema = 'View Document Schema', 6 | viewLineage = 'View Lineage', 7 | downloadSampleData = 'Download Sample Data', 8 | downloadCsv = 'Download CSV', 9 | editTag = 'Edit Tag', 10 | editName = 'Edit Name', 11 | editDescription = 'Edit Description', 12 | editSme = 'Edit SME', 13 | default = 'View' 14 | } 15 | -------------------------------------------------------------------------------- /src/app/shared/services/beast-components.enum.ts: -------------------------------------------------------------------------------- 1 | export enum BeastComponents { 2 | globalSearch = 'Global Search', 3 | tag = 'Tag', 4 | dataEntities = 'Data Entities', 5 | dataObjects = 'Data Objects', 6 | formats = 'Formats', 7 | default = 'Homepage' 8 | } 9 | -------------------------------------------------------------------------------- /src/app/shared/services/encryption.service.spec.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { inject, TestBed } from '@angular/core/testing'; 17 | 18 | import { EncryptionService } from './encryption.service'; 19 | import { HttpClientModule } from '@angular/common/http'; 20 | 21 | describe('EncryptionService', () => { 22 | beforeEach(() => { 23 | TestBed.configureTestingModule({ 24 | imports: [ 25 | HttpClientModule 26 | ], 27 | providers: [ 28 | EncryptionService, 29 | ] 30 | }); 31 | }); 32 | 33 | it('should encrypt the user id', inject([EncryptionService], (service: EncryptionService) => { 34 | const encryptedValue = service.encryptAndGet('userid'); 35 | expect(encryptedValue).not.toEqual(''); 36 | })); 37 | }); 38 | -------------------------------------------------------------------------------- /src/app/shared/services/encryption.service.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Injectable } from '@angular/core'; 17 | import * as CryptoJS from 'crypto-js'; 18 | import { environment } from '../../../environments/environment'; 19 | 20 | @Injectable() 21 | export class EncryptionService { 22 | 23 | constructor() { 24 | } 25 | 26 | 27 | public encryptAndGet(userId: string) { 28 | 29 | // Pads a given string with whitespace to make it 16 chars. long 30 | const padString = function (source) { 31 | const paddingChar = ' '; 32 | const size = 16; 33 | const padLength = size - source.length; 34 | 35 | for (let i = 0; i < padLength; i++) { 36 | source += paddingChar; 37 | } 38 | 39 | return source; 40 | }; 41 | 42 | // Get key and IV from configuration 43 | const key = CryptoJS.enc.Hex.parse(environment.bs.beastEndpointUrl); 44 | const iv = CryptoJS.enc.Hex.parse(environment.bs.beastAgs); 45 | 46 | // Get padded value 47 | const padMsg = padString(userId); 48 | 49 | // Encrypt with a constant IV to always get a deterministic output 50 | const encrypted = CryptoJS.AES.encrypt( 51 | padMsg, 52 | key, 53 | { 54 | iv: iv, 55 | padding: CryptoJS.pad.Pkcs7, 56 | mode: CryptoJS.mode.CBC 57 | } 58 | ); 59 | 60 | // return the cipher-text 61 | return encrypted.toString(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/app/shared/services/facet-tri-state.enum.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import { TriStateEnum } from './tri-state-enum.enum'; 18 | 19 | export enum FacetTriState { 20 | default = TriStateEnum.State1.valueOf(), 21 | include = TriStateEnum.State2.valueOf(), 22 | exclude = TriStateEnum.State3.valueOf() 23 | } 24 | -------------------------------------------------------------------------------- /src/app/shared/services/highlight-display-mapping.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export class HighlightDisplayMapping { 17 | 18 | private _mappings = { 19 | 'displayName': 'Name', 20 | 'displayName.stemmed': 'Name', 21 | 'displayName.ngrams': 'Name', 22 | 'name': 'Physical Name', 23 | 'name.stemmed': 'Physical Name', 24 | 'name.ngrams': 'Physical Name', 25 | 'namespace.code': 'Namespace', 26 | 'namespace.code.stemmed': 'Namespace', 27 | 'namespace.code.ngrams': 'Namespace', 28 | 'description': 'Description', 29 | 'description.stemmed': 'Description', 30 | 'description.ngrams': 'Description', 31 | 'columns.name': 'Column Name', 32 | 'columns.name.stemmed': 'Column Name', 33 | 'columns.name.ngrams': 'Column Name', 34 | 'columns.description': 'Column Description', 35 | 'columns.description.stemmed': 'Column Description', 36 | 'columns.description.ngrams': 'Column Description', 37 | 'descriptiveBusinessObjectFormat.schemaColumns.name': 'Column Physical Name', 38 | 'descriptiveBusinessObjectFormat.schemaColumns.name.stemmed': 'Column Physical Name', 39 | 'descriptiveBusinessObjectFormat.schemaColumns.name.ngrams': 'Column Physical Name', 40 | 'businessObjectDefinitionTags.tag.displayName': 'Category Name', 41 | 'businessObjectDefinitionTags.tag.displayName.stemmed': 'Category Name', 42 | 'businessObjectDefinitionTags.tag.displayName.ngrams': 'Category Name', 43 | 'subjectMatterExperts.userId': 'Contact Information', 44 | 'subjectMatterExperts.userId.stemmed': 'Contact Information', 45 | 'subjectMatterExperts.userId.ngrams': 'Contact Information' 46 | }; 47 | 48 | public getMapping(name: string) { 49 | return this._mappings[name] || name; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/app/shared/services/tri-state-enum.enum.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export enum TriStateEnum { 17 | State1, 18 | State2, 19 | State3 20 | } 21 | -------------------------------------------------------------------------------- /src/app/shared/utils/app-icons.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export default { 17 | shareIcon: '', 18 | saveIcon: '', 19 | watchIcon: '', 20 | gridOnIcon: '', 21 | flowChartIcon: '' 22 | }; 23 | -------------------------------------------------------------------------------- /src/app/shared/utils/click-helper.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { DebugElement } from '@angular/core'; 17 | 18 | /** Button events to pass to `DebugElement.triggerEventHandler` for RouterLink event handler */ 19 | export const ButtonClickEvents = { 20 | left: {button: 0}, 21 | right: {button: 2} 22 | }; 23 | 24 | /** Simulate element click. Defaults to mouse left-button click event. */ 25 | export function click(el: DebugElement | HTMLElement, eventObj: any = ButtonClickEvents.left): void { 26 | if (el instanceof HTMLElement) { 27 | el.click(); 28 | } else { 29 | el.triggerEventHandler('click', eventObj); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/app/utils/utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { ActivatedRouteSnapshot, PRIMARY_OUTLET } from '@angular/router'; 17 | 18 | export class Utils { 19 | // this logic can be used to generate breadcrumbs if needed in the future. 20 | static findPrimaryRoute(route: ActivatedRouteSnapshot): ActivatedRouteSnapshot { 21 | const children: ActivatedRouteSnapshot[] = route.children; 22 | 23 | if (!children || children.length === 0) { 24 | return route; 25 | } 26 | 27 | for (const child of children) { 28 | if (child.outlet !== PRIMARY_OUTLET) { 29 | continue; 30 | } 31 | 32 | return this.findPrimaryRoute(child); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/assets/svg/maze.svg: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 21 | 26 | 29 | 31 | 32 | -------------------------------------------------------------------------------- /src/assets/svg/testing-image.svg: -------------------------------------------------------------------------------- 1 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/ckset.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // needed for the configuration of ckeditor 17 | (window as any).CKEDITOR_BASEPATH = '/assets/ckeditor/'; 18 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export const environment = { 17 | production: true, 18 | restBaseUri: '{{HERD_REST_BASE_URI}}', 19 | basicAuthRestBaseUri: '{{HERD_REST_BASE_URI2}}', 20 | helpUrl: '{{ORG_HELP_URL}}', 21 | supportEmail: '{{ORG_SUPPORT_EMAIL}}', 22 | brandHeader: '{{BRAND_HEADER}}', 23 | brandMotto: '{{BRAND_MOTO}}', 24 | docTitlePrefix: 'UDC', 25 | useBasicAuth: false, 26 | fipAuthCookieName: '{{FIP_AUTH_COOKIE_NAME}}', 27 | fipAuthEndpoint: '{{FIP_AUTH_ENDPOINT}}', 28 | alertDelayInSeconds: 10, 29 | trackAnalytics: true, 30 | bs: { 31 | beastEndpointUrl: '{{BEAST_ENDPOINT_URL}}', 32 | beastAgs: '{{BEAST_AGS}}' 33 | }, 34 | dataObjectListPermissionsResolution: '{{DATA_OBJECT_LINK_PERMISSIONS_RESOLUTION}}' 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export const environment = { 17 | production: false, 18 | restBaseUri: '{{HERD_REST_BASE_URI}}', 19 | basicAuthRestBaseUri: '{{HERD_REST_BASE_URI2}}', 20 | helpUrl: '{{ORG_HELP_URL}}', 21 | supportEmail: '{{ORG_SUPPORT_EMAIL}}', 22 | brandHeader: '{{BRAND_HEADER}}', 23 | brandMotto: '{{BRAND_MOTO}}', 24 | docTitlePrefix: 'UDC', 25 | useBasicAuth: false, 26 | fipAuthCookieName: '{{FIP_AUTH_COOKIE_NAME}}', 27 | fipAuthEndpoint: '{{FIP_AUTH_ENDPOINT}}', 28 | alertDelayInSeconds: 10, 29 | trackAnalytics: true, 30 | bs: { 31 | beastEndpointUrl: '{{BEAST_ENDPOINT_URL}}', 32 | beastAgs: '{{BEAST_AGS}}' 33 | }, 34 | dataObjectListPermissionsResolution: '{{DATA_OBJECT_LINK_PERMISSIONS_RESOLUTION}}' 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FINRAOS/herd-ui/e95096503662b35e2693c8dd1b3393803249e8e0/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 60 | 61 | 62 | 63 |
64 | 65 |
66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { enableProdMode } from '@angular/core'; 17 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 18 | 19 | import { AppModule } from './app/app.module'; 20 | import { environment } from './environments/environment'; 21 | 22 | if (environment.production) { 23 | enableProdMode(); 24 | } 25 | 26 | platformBrowserDynamic().bootstrapModule(AppModule); 27 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 17 | 18 | import 'zone.js/dist/zone-testing'; 19 | import { getTestBed } from '@angular/core/testing'; 20 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 21 | 22 | declare const require: any; 23 | 24 | // First, initialize the Angular testing environment. 25 | getTestBed().initTestEnvironment( 26 | BrowserDynamicTestingModule, 27 | platformBrowserDynamicTesting() 28 | ); 29 | // Then we find all the tests. 30 | const context = require.context('./', true, /\.spec\.ts$/); 31 | // And load the modules. 32 | context.keys().map(context); 33 | -------------------------------------------------------------------------------- /src/testing/mock-ckeditor.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import { Component, forwardRef, Input } from '@angular/core'; 17 | import { NG_VALUE_ACCESSOR } from '@angular/forms'; 18 | 19 | @Component({ 20 | // tslint:disable-next-line:component-selector 21 | selector: 'ckeditor', 22 | template: '
value
', 23 | providers: [ 24 | { 25 | provide: NG_VALUE_ACCESSOR, 26 | useExisting: forwardRef(() => MockCkeditorComponent), 27 | multi: true 28 | } 29 | ], 30 | }) 31 | export class MockCkeditorComponent { 32 | @Input() config: any; 33 | 34 | private _value = ''; 35 | get value(): any { 36 | return this._value; 37 | } 38 | 39 | @Input() set value(v) { 40 | if (v !== this._value) { 41 | this._value = v; 42 | } 43 | } 44 | 45 | /** 46 | * Implements ControlValueAccessor 47 | */ 48 | writeValue(value: any) { 49 | this._value = value; 50 | } 51 | 52 | onChange(_: any) { 53 | } 54 | 55 | onTouched() { 56 | } 57 | 58 | registerOnChange(fn: any) { 59 | this.onChange = fn; 60 | } 61 | 62 | registerOnTouched(fn: any) { 63 | this.onTouched = fn; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/testing/testing-utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | export function newEvent(eventName: string, bubbles = false, cancelable = false) { 17 | const evt = document.createEvent('CustomEvent'); // MUST be 'CustomEvent' 18 | evt.initCustomEvent(eventName, bubbles, cancelable, null); 19 | return evt; 20 | } 21 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "baseUrl": "", 7 | "types": [ 8 | "node" 9 | ] 10 | }, 11 | "exclude": [ 12 | "node_modules", 13 | "test.ts", 14 | "**/*.spec.ts", 15 | "**/testing/*.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "baseUrl": "", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts", 15 | "polyfills.ts" 16 | ], 17 | "exclude": [ 18 | "node_modules" 19 | ], 20 | "include": [ 21 | "**/*.spec.ts", 22 | "**/*.d.ts" 23 | ] 24 | } -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 herd-ui contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* SystemJS module definition */ 17 | declare var module: NodeModule; 18 | 19 | interface NodeModule { 20 | id: string; 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "baseUrl": "src", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2016", 17 | "dom" 18 | ], 19 | "module": "es2015", 20 | "skipLibCheck": true 21 | } 22 | } 23 | --------------------------------------------------------------------------------