cedar-embeddable-editor 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +18 -0
- package/.editorconfig +16 -0
- package/README.md +302 -0
- package/angular.json +153 -0
- package/cedar-embeddable-editor-0.9.0.tgz +0 -0
- package/e2e/protractor.conf.js +36 -0
- package/e2e/src/app.e2e-spec.ts +23 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.json +14 -0
- package/karma.conf.js +32 -0
- package/license.txt +26 -0
- package/package.json +61 -0
- package/src/app/app.component.dev.ts +74 -0
- package/src/app/app.component.html +5 -0
- package/src/app/app.component.prod.ts +76 -0
- package/src/app/app.component.scss +1 -0
- package/src/app/app.module.dev.ts +58 -0
- package/src/app/app.module.prod.ts +56 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.html +0 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.ts +39 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.html +25 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.ts +91 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.ts +104 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.html +22 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.ts +135 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.html +44 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.ts +451 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.html +16 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.ts +91 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.html +16 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.ts +92 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.html +18 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.scss +5 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.ts +78 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.html +15 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.ts +169 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.html +15 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.ts +94 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.html +19 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.ts +108 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.html +25 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.ts +125 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.ts +40 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.html +20 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.scss +24 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.ts +36 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.html +2 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.spec.ts +25 -0
- package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.ts +35 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.html +8 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.ts +39 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.html +6 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.scss +0 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.spec.ts +24 -0
- package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.ts +42 -0
- package/src/app/modules/input-types/input-types.module.ts +139 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.html +13 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.scss +12 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.ts +42 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.html +117 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.scss +5 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.ts +101 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.html +22 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.scss +23 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.spec.ts +24 -0
- package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.ts +139 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.html +56 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.scss +13 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.ts +184 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.html +15 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.scss +2 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.ts +240 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.html +35 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.scss +41 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.spec.ts +25 -0
- package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.ts +282 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.html +46 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.scss +7 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.spec.ts +25 -0
- package/src/app/modules/shared/components/date-picker/date-picker.component.ts +100 -0
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.spec.ts +33 -0
- package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.ts +16 -0
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.spec.ts +54 -0
- package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.ts +67 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.html +26 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.scss +55 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.spec.ts +25 -0
- package/src/app/modules/shared/components/file-uploader/file-uploader.component.ts +67 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.html +42 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.scss +31 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.spec.ts +177 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.ts +145 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.service.ts +21 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.html +1 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.scss +0 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.spec.ts +59 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.ts +139 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.spec.ts +33 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.ts +17 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.module.ts +35 -0
- package/src/app/modules/shared/components/file-uploader/mat-file-upload.type.ts +24 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.html +18 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.scss +0 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.spec.ts +23 -0
- package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.ts +10 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.html +16 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.scss +0 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.spec.ts +25 -0
- package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.ts +89 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.html +19 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.scss +0 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.spec.ts +25 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.component.ts +66 -0
- package/src/app/modules/shared/components/sample-templates/sample-templates.service.ts +175 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.html +98 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.scss +0 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.spec.ts +25 -0
- package/src/app/modules/shared/components/source-panels/source-panels.component.ts +36 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.html +17 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.scss +110 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.spec.ts +25 -0
- package/src/app/modules/shared/components/static-footer/static-footer.component.ts +16 -0
- package/src/app/modules/shared/components/static-header/static-header.component.html +10 -0
- package/src/app/modules/shared/components/static-header/static-header.component.scss +13 -0
- package/src/app/modules/shared/components/static-header/static-header.component.spec.ts +25 -0
- package/src/app/modules/shared/components/static-header/static-header.component.ts +21 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.html +16 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.scss +0 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.spec.ts +25 -0
- package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.ts +251 -0
- package/src/app/modules/shared/factory/template-representation.factory.ts +323 -0
- package/src/app/modules/shared/handler/component-type.handler.ts +51 -0
- package/src/app/modules/shared/handler/data-object-builder.handler.ts +159 -0
- package/src/app/modules/shared/handler/data-object-data-value.handler.ts +270 -0
- package/src/app/modules/shared/handler/data-object-structure.handler.ts +145 -0
- package/src/app/modules/shared/handler/multi-instance-object.handler.ts +317 -0
- package/src/app/modules/shared/models/cedar-input-template.model.ts +3 -0
- package/src/app/modules/shared/models/cedar-model.model.ts +48 -0
- package/src/app/modules/shared/models/component/cedar-component.model.ts +16 -0
- package/src/app/modules/shared/models/component/component-representation.model.ts +30 -0
- package/src/app/modules/shared/models/component/element-component.model.ts +11 -0
- package/src/app/modules/shared/models/component/field-component.model.ts +23 -0
- package/src/app/modules/shared/models/component/multi-component.model.ts +10 -0
- package/src/app/modules/shared/models/component/null-component.model.ts +20 -0
- package/src/app/modules/shared/models/component/single-component.model.ts +6 -0
- package/src/app/modules/shared/models/element/abstract-element-component.model.ts +26 -0
- package/src/app/modules/shared/models/element/multi-element-component.model.ts +19 -0
- package/src/app/modules/shared/models/element/single-element-component.model.ts +16 -0
- package/src/app/modules/shared/models/enum/data-object-building-mode.model.ts +6 -0
- package/src/app/modules/shared/models/field/abstract-field-component.model.ts +28 -0
- package/src/app/modules/shared/models/field/multi-field-component.model.ts +21 -0
- package/src/app/modules/shared/models/field/single-field-component.model.ts +18 -0
- package/src/app/modules/shared/models/info/basic-info.model.ts +8 -0
- package/src/app/modules/shared/models/info/choice-info.model.ts +9 -0
- package/src/app/modules/shared/models/info/choice-option.model.ts +6 -0
- package/src/app/modules/shared/models/info/content-info.model.ts +5 -0
- package/src/app/modules/shared/models/info/controlled-info.model.ts +8 -0
- package/src/app/modules/shared/models/info/current-multi-info.model.ts +7 -0
- package/src/app/modules/shared/models/info/label-info.model.ts +7 -0
- package/src/app/modules/shared/models/info/multi-info.model.ts +10 -0
- package/src/app/modules/shared/models/info/multi-instance-info.model.ts +20 -0
- package/src/app/modules/shared/models/info/multi-instance-object-info.model.ts +30 -0
- package/src/app/modules/shared/models/info/number-info.model.ts +9 -0
- package/src/app/modules/shared/models/info/value-info.model.ts +9 -0
- package/src/app/modules/shared/models/input-type.model.ts +21 -0
- package/src/app/modules/shared/models/instance-extract-data.model.ts +3 -0
- package/src/app/modules/shared/models/instance-full-data.model.ts +5 -0
- package/src/app/modules/shared/models/javascript-types.model.ts +7 -0
- package/src/app/modules/shared/models/json-schema.model.ts +39 -0
- package/src/app/modules/shared/models/numbers.model.ts +10 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-parameter-object.ts +8 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-value-constraints.ts +8 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request.ts +9 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response-item.ts +10 -0
- package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response.ts +13 -0
- package/src/app/modules/shared/models/static/static-field-component.model.ts +24 -0
- package/src/app/modules/shared/models/template/cedar-template.model.ts +24 -0
- package/src/app/modules/shared/models/template/empty-template.model.ts +5 -0
- package/src/app/modules/shared/models/template/null-template.model.ts +23 -0
- package/src/app/modules/shared/models/template/template-component.model.ts +12 -0
- package/src/app/modules/shared/models/temporal.model.ts +13 -0
- package/src/app/modules/shared/models/ui/cedar-ui-component.model.ts +17 -0
- package/src/app/modules/shared/models/xsd.model.ts +11 -0
- package/src/app/modules/shared/pipe/keep-html.pipe.ts +13 -0
- package/src/app/modules/shared/pipe/rdf.pipe.ts +10 -0
- package/src/app/modules/shared/service/active-component-registry.service.ts +134 -0
- package/src/app/modules/shared/service/component-data.service.ts +25 -0
- package/src/app/modules/shared/service/controlled-field-data.service.ts +37 -0
- package/src/app/modules/shared/service/date-time/custom-date-adapter.ts +19 -0
- package/src/app/modules/shared/service/date-time/date-time.service.ts +30 -0
- package/src/app/modules/shared/service/local-settings.service.ts +22 -0
- package/src/app/modules/shared/service/message-handler.service.ts +35 -0
- package/src/app/modules/shared/service/page-break-paginator.service.ts +78 -0
- package/src/app/modules/shared/shared.module.ts +97 -0
- package/src/app/modules/shared/util/data-context.ts +42 -0
- package/src/app/modules/shared/util/data-object-util.ts +102 -0
- package/src/app/modules/shared/util/handler-context.ts +81 -0
- package/src/app/modules/shared/util/template-object-util.ts +21 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.eot +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.ttf +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff +0 -0
- package/src/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
- package/src/assets/i18n-cee/en.json +86 -0
- package/src/assets/i18n-cee/hu.json +86 -0
- package/src/assets/images/bmir-logo.png +0 -0
- package/src/assets/images/cedar-logo-80x80.png +0 -0
- package/src/environments/environment.prod.ts +5 -0
- package/src/environments/environment.ts +18 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +16 -0
- package/src/main.ts +28 -0
- package/src/polyfills.ts +65 -0
- package/src/styles-own.scss +352 -0
- package/src/styles.scss +116 -0
- package/src/test.ts +25 -0
- package/tsconfig.app.json +16 -0
- package/tsconfig.base.json +20 -0
- package/tsconfig.json +20 -0
- package/tsconfig.spec.json +18 -0
- package/tslint.json +152 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { PreferencesMenu } from './preferences-menu.component';
|
|
4
|
+
|
|
5
|
+
describe('PreferencesMenuComponent', () => {
|
|
6
|
+
let component: PreferencesMenu;
|
|
7
|
+
let fixture: ComponentFixture<PreferencesMenu>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ PreferencesMenu ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(PreferencesMenu);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<mat-form-field class="full-width">
|
|
2
|
+
<mat-select [formControl]="templateCtrl"
|
|
3
|
+
placeholder="{{'Extra.SampleTemplate.Select' | translate}}"
|
|
4
|
+
(selectionChange)="inputChanged($event)">
|
|
5
|
+
<mat-option>
|
|
6
|
+
<ngx-mat-select-search
|
|
7
|
+
[formControl]="templateFilterCtrl"
|
|
8
|
+
placeholderLabel="{{'Extra.SampleTemplate.Find' | translate}}"
|
|
9
|
+
noEntriesFoundLabel="{{'Extra.SampleTemplate.FindNoMatch' | translate}}"
|
|
10
|
+
></ngx-mat-select-search>
|
|
11
|
+
</mat-option>
|
|
12
|
+
<mat-option *ngFor="let template of filteredTemplates | async"
|
|
13
|
+
[value]="template[sampleTemplateService.TEMPLATE_NUMBER]"
|
|
14
|
+
>{{template[sampleTemplateService.TEMPLATE_LABEL]}}</mat-option>
|
|
15
|
+
</mat-select>
|
|
16
|
+
</mat-form-field>
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SampleTemplateSelectComponent } from './sample-template-select.component';
|
|
4
|
+
|
|
5
|
+
describe('SampleTemplateSelectComponent', () => {
|
|
6
|
+
let component: SampleTemplateSelectComponent;
|
|
7
|
+
let fixture: ComponentFixture<SampleTemplateSelectComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ SampleTemplateSelectComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(SampleTemplateSelectComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {Component, Input, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {SampleTemplatesService} from '../sample-templates.service';
|
|
3
|
+
import {
|
|
4
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
5
|
+
} from '../../cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component';
|
|
6
|
+
import {FormControl} from '@angular/forms';
|
|
7
|
+
import {ReplaySubject, Subject} from 'rxjs';
|
|
8
|
+
import {takeUntil} from 'rxjs/operators';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-sample-template-select',
|
|
12
|
+
templateUrl: './sample-template-select.component.html',
|
|
13
|
+
styleUrls: ['./sample-template-select.component.scss'],
|
|
14
|
+
encapsulation: ViewEncapsulation.None
|
|
15
|
+
})
|
|
16
|
+
export class SampleTemplateSelectComponent implements OnInit, OnDestroy {
|
|
17
|
+
@Input() callbackOwnerObject: any = null;
|
|
18
|
+
sampleTemplates: object[];
|
|
19
|
+
templateLocationPrefix: string;
|
|
20
|
+
templateCtrl: FormControl = new FormControl();
|
|
21
|
+
templateFilterCtrl: FormControl = new FormControl();
|
|
22
|
+
filteredTemplates: ReplaySubject<object[]> = new ReplaySubject<object[]>(1);
|
|
23
|
+
protected _onDestroy = new Subject<void>();
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
constructor(public sampleTemplateService: SampleTemplatesService) {
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ngOnInit(): void {
|
|
30
|
+
this.templateLocationPrefix = this.callbackOwnerObject.
|
|
31
|
+
innerConfig[CedarEmbeddableMetadataEditorWrapperComponent.TEMPLATE_LOCATION_PREFIX];
|
|
32
|
+
this.sampleTemplateService.getSampleTemplatesFromRegistry(this.templateLocationPrefix)
|
|
33
|
+
.pipe(takeUntil(this._onDestroy))
|
|
34
|
+
.subscribe(
|
|
35
|
+
(templates: object[]) => {
|
|
36
|
+
this.sampleTemplates = templates;
|
|
37
|
+
this.filteredTemplates.next(this.sampleTemplates);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
this.sampleTemplateService.templateJson$
|
|
42
|
+
.pipe(takeUntil(this._onDestroy))
|
|
43
|
+
.subscribe( templateJson => {
|
|
44
|
+
this.templateCtrl.setValue(Object.keys(templateJson)[0]);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// listen for search field value changes
|
|
48
|
+
this.templateFilterCtrl.valueChanges
|
|
49
|
+
.pipe(takeUntil(this._onDestroy))
|
|
50
|
+
.subscribe(() => {
|
|
51
|
+
this.filterTemplates();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ngOnDestroy(): void {
|
|
56
|
+
this._onDestroy.next();
|
|
57
|
+
this._onDestroy.complete();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
filterTemplates(): void {
|
|
61
|
+
if (!this.sampleTemplates) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// get the search keyword
|
|
65
|
+
let search = this.templateFilterCtrl.value;
|
|
66
|
+
if (!search) {
|
|
67
|
+
this.filteredTemplates.next(this.sampleTemplates.slice());
|
|
68
|
+
return;
|
|
69
|
+
} else {
|
|
70
|
+
search = search.toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
this.filteredTemplates.next(
|
|
73
|
+
this.sampleTemplates.filter(
|
|
74
|
+
template => template[this.sampleTemplateService.TEMPLATE_LABEL].toLowerCase().indexOf(search) > -1)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
loadBuiltinTemplate(templateNum: string): void {
|
|
79
|
+
this.sampleTemplateService.loadTemplate(this.templateLocationPrefix, templateNum);
|
|
80
|
+
window.scroll(0, 0);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
inputChanged(event): void {
|
|
84
|
+
if (event) {
|
|
85
|
+
this.loadBuiltinTemplate(event.value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<mat-expansion-panel expanded="{{expandedSampleTemplateLinks}}">
|
|
2
|
+
<mat-expansion-panel-header>
|
|
3
|
+
<mat-panel-title>
|
|
4
|
+
<mat-icon>subject</mat-icon>
|
|
5
|
+
{{'Extra.SampleTemplate.Title' | translate}}
|
|
6
|
+
</mat-panel-title>
|
|
7
|
+
</mat-expansion-panel-header>
|
|
8
|
+
|
|
9
|
+
<ng-template matExpansionPanelContent *ngIf="sampleTemplates">
|
|
10
|
+
<mat-selection-list #templates
|
|
11
|
+
[formControl]="templateCtrl"
|
|
12
|
+
[multiple]="false"
|
|
13
|
+
(click)="selectionClicked({option : templates.selectedOptions.selected[0]})">
|
|
14
|
+
<mat-list-option *ngFor="let template of sampleTemplates"
|
|
15
|
+
[value]="template[sampleTemplateService.TEMPLATE_NUMBER]"
|
|
16
|
+
>{{template[sampleTemplateService.TEMPLATE_LABEL]}}</mat-list-option>
|
|
17
|
+
</mat-selection-list>
|
|
18
|
+
</ng-template>
|
|
19
|
+
</mat-expansion-panel>
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SampleTemplatesComponent } from './sample-templates.component';
|
|
4
|
+
|
|
5
|
+
describe('SampleTemplatesComponent', () => {
|
|
6
|
+
let component: SampleTemplatesComponent;
|
|
7
|
+
let fixture: ComponentFixture<SampleTemplatesComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ SampleTemplatesComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(SampleTemplatesComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {Component, Input, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {MatListOption} from '@angular/material/list';
|
|
3
|
+
import {
|
|
4
|
+
CedarEmbeddableMetadataEditorWrapperComponent
|
|
5
|
+
} from '../cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component';
|
|
6
|
+
import {HttpClient} from '@angular/common/http';
|
|
7
|
+
import {SampleTemplatesService} from './sample-templates.service';
|
|
8
|
+
import {Subject} from 'rxjs';
|
|
9
|
+
import {FormControl} from '@angular/forms';
|
|
10
|
+
import {takeUntil} from 'rxjs/operators';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'app-sample-templates',
|
|
14
|
+
templateUrl: './sample-templates.component.html',
|
|
15
|
+
styleUrls: ['./sample-templates.component.scss'],
|
|
16
|
+
encapsulation: ViewEncapsulation.None
|
|
17
|
+
})
|
|
18
|
+
export class SampleTemplatesComponent implements OnInit, OnDestroy {
|
|
19
|
+
|
|
20
|
+
@Input() callbackOwnerObject: any = null;
|
|
21
|
+
@Input() expandedSampleTemplateLinks: boolean;
|
|
22
|
+
templateLocationPrefix: string;
|
|
23
|
+
templateCtrl: FormControl = new FormControl();
|
|
24
|
+
sampleTemplates: object[] = [];
|
|
25
|
+
protected _onDestroy = new Subject<void>();
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
private http: HttpClient,
|
|
30
|
+
public sampleTemplateService: SampleTemplatesService
|
|
31
|
+
) {
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ngOnInit(): void {
|
|
35
|
+
this.templateLocationPrefix = this.callbackOwnerObject.
|
|
36
|
+
innerConfig[CedarEmbeddableMetadataEditorWrapperComponent.TEMPLATE_LOCATION_PREFIX];
|
|
37
|
+
this.sampleTemplateService.getSampleTemplatesFromRegistry(this.templateLocationPrefix)
|
|
38
|
+
.pipe(takeUntil(this._onDestroy))
|
|
39
|
+
.subscribe(
|
|
40
|
+
(templates: object[]) => {
|
|
41
|
+
this.sampleTemplates.push(...templates);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
this.sampleTemplateService.templateJson$
|
|
46
|
+
.pipe(takeUntil(this._onDestroy))
|
|
47
|
+
.subscribe( templateJson => {
|
|
48
|
+
this.templateCtrl.setValue([Object.keys(templateJson)[0]]);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
loadBuiltinTemplate(templateNum: string): void {
|
|
53
|
+
this.sampleTemplateService.loadTemplate(this.templateLocationPrefix, templateNum);
|
|
54
|
+
window.scroll(0, 0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
selectionClicked({option}: { option: MatListOption }): void {
|
|
58
|
+
this.loadBuiltinTemplate(option.value);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ngOnDestroy(): void {
|
|
62
|
+
this._onDestroy.next();
|
|
63
|
+
this._onDestroy.complete();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import {Injectable} from '@angular/core';
|
|
2
|
+
import {JsonSchema} from '../../models/json-schema.model';
|
|
3
|
+
import {HttpClient} from '@angular/common/http';
|
|
4
|
+
import {of, Observable, from, Subject, EMPTY, BehaviorSubject} from 'rxjs';
|
|
5
|
+
import {catchError, concatMap, map, takeUntil} from 'rxjs/operators';
|
|
6
|
+
import {MessageHandlerService} from '../../service/message-handler.service';
|
|
7
|
+
|
|
8
|
+
@Injectable({
|
|
9
|
+
providedIn: 'root'
|
|
10
|
+
})
|
|
11
|
+
export class SampleTemplatesService {
|
|
12
|
+
|
|
13
|
+
private readonly MAX_CHECK = 500;
|
|
14
|
+
readonly TEMPLATE_FILENAME = 'template.json';
|
|
15
|
+
readonly TEMPLATE_REGISTRY_FILENAME = 'registry.json';
|
|
16
|
+
readonly TEMPLATE_NUMBER = 'num';
|
|
17
|
+
readonly TEMPLATE_LABEL = 'label';
|
|
18
|
+
private allTemplates: Observable<object[]>;
|
|
19
|
+
private templateJsonSubject = new BehaviorSubject<object>(null);
|
|
20
|
+
templateJson$ = this.templateJsonSubject.asObservable();
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
private http: HttpClient,
|
|
25
|
+
private messageHandlerService: MessageHandlerService
|
|
26
|
+
) {
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
loadTemplate(templateLocationPrefix: string, templateNum: string): void {
|
|
30
|
+
templateLocationPrefix = this.fixedLocationPrefix(templateLocationPrefix);
|
|
31
|
+
const templateUrl = templateLocationPrefix + templateNum + '/' + this.TEMPLATE_FILENAME;
|
|
32
|
+
this.loadTemplateFromURL(templateUrl, templateNum);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
loadTemplateFromURL(templateUrl: string, templateNum: string = null): void {
|
|
36
|
+
if (!templateNum) {
|
|
37
|
+
templateNum = this.templateNumberFromUrl(templateUrl);
|
|
38
|
+
}
|
|
39
|
+
this.http.get(templateUrl).subscribe(
|
|
40
|
+
value => {
|
|
41
|
+
const valObj = {};
|
|
42
|
+
valObj[templateNum] = value;
|
|
43
|
+
this.templateJsonSubject.next(valObj);
|
|
44
|
+
this.messageHandlerService.trace('Loaded template: ' + templateUrl + ' (' + JSON.stringify(value).length + ' characters)');
|
|
45
|
+
},
|
|
46
|
+
error => {
|
|
47
|
+
this.messageHandlerService.error('Error while loading sample template from: ' + templateUrl);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getSampleTemplatesFromRegistry(templateLocationPrefix: string): Observable<object[]> {
|
|
53
|
+
if (this.allTemplates) {
|
|
54
|
+
return this.allTemplates;
|
|
55
|
+
}
|
|
56
|
+
templateLocationPrefix = this.fixedLocationPrefix(templateLocationPrefix);
|
|
57
|
+
const registryUrl = templateLocationPrefix + this.TEMPLATE_REGISTRY_FILENAME;
|
|
58
|
+
this.allTemplates = this.http.get(registryUrl)
|
|
59
|
+
.pipe(
|
|
60
|
+
map(
|
|
61
|
+
(resp: object) => {
|
|
62
|
+
return Object.keys(resp).sort().map( (key, index) => {
|
|
63
|
+
const entry = {};
|
|
64
|
+
entry[this.TEMPLATE_NUMBER] = key;
|
|
65
|
+
entry[this.TEMPLATE_LABEL] = resp[key];
|
|
66
|
+
return entry;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
catchError(
|
|
71
|
+
error => {
|
|
72
|
+
this.messageHandlerService.errorObject(error['message'], error);
|
|
73
|
+
return EMPTY;
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
return this.allTemplates;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
getSampleTemplatesDynamically(templateLocationPrefix: string): Observable<object> {
|
|
80
|
+
if (!this.allTemplates) {
|
|
81
|
+
templateLocationPrefix = this.fixedLocationPrefix(templateLocationPrefix);
|
|
82
|
+
this.buildAllTemplatesDynamically(templateLocationPrefix);
|
|
83
|
+
}
|
|
84
|
+
return this.allTemplates;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private buildAllTemplatesDynamically(templateLocationPrefix: string): void {
|
|
88
|
+
const allTemplates = [];
|
|
89
|
+
this.getAllTemplatesSubscription(templateLocationPrefix).subscribe(
|
|
90
|
+
resp => {
|
|
91
|
+
const entry = {};
|
|
92
|
+
entry[this.TEMPLATE_NUMBER] = Object.keys(resp)[0];
|
|
93
|
+
entry[this.TEMPLATE_LABEL] = Object.values(resp)[0];
|
|
94
|
+
allTemplates.push(entry);
|
|
95
|
+
});
|
|
96
|
+
this.allTemplates = of(allTemplates);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private getAllTemplatesSubscription(templateLocationPrefix: string): Observable<object> {
|
|
100
|
+
const singleUrls: string[] = [];
|
|
101
|
+
const closeRequest$ = new Subject<void>();
|
|
102
|
+
let errorIndex = 0;
|
|
103
|
+
|
|
104
|
+
for (let i = 1; i <= this.MAX_CHECK; i++) {
|
|
105
|
+
const templateName = (i < 10) ? '0' + i.toString() : i.toString();
|
|
106
|
+
const templateUrl = templateLocationPrefix + templateName + '/' + this.TEMPLATE_FILENAME;
|
|
107
|
+
singleUrls.push(templateUrl);
|
|
108
|
+
}
|
|
109
|
+
return from(singleUrls)
|
|
110
|
+
.pipe(
|
|
111
|
+
concatMap(singleUrl => {
|
|
112
|
+
const templateNum = this.templateNumberFromUrl(singleUrl);
|
|
113
|
+
return this.getSingleTemplateLabel(singleUrl)
|
|
114
|
+
.pipe(
|
|
115
|
+
map ( templateLabel => {
|
|
116
|
+
errorIndex = 0;
|
|
117
|
+
const templateEntry = {};
|
|
118
|
+
templateEntry[templateNum] = 'Template ' + templateNum + ' - ' + templateLabel;
|
|
119
|
+
return templateEntry;
|
|
120
|
+
}),
|
|
121
|
+
// if encounter two consecutive error requests, finish polling
|
|
122
|
+
catchError(error => {
|
|
123
|
+
if (error.status === 0) {
|
|
124
|
+
errorIndex++;
|
|
125
|
+
} else {
|
|
126
|
+
this.messageHandlerService.errorObject(error['message'], error);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (errorIndex > 1) {
|
|
130
|
+
closeRequest$.next();
|
|
131
|
+
closeRequest$.complete();
|
|
132
|
+
}
|
|
133
|
+
return EMPTY;
|
|
134
|
+
})
|
|
135
|
+
);
|
|
136
|
+
}),
|
|
137
|
+
takeUntil(closeRequest$)
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private getSingleTemplateLabel(templateUrl: string): Observable<string> {
|
|
142
|
+
return this.http.get(templateUrl)
|
|
143
|
+
.pipe(
|
|
144
|
+
map(response => {
|
|
145
|
+
if (response == null || !response[JsonSchema.schemaName]) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
return response[JsonSchema.schemaName];
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private templateNumberFromUrl(url): string {
|
|
154
|
+
const templateNumPatternStr = '\\/(\\d+)\\/' + this.TEMPLATE_FILENAME;
|
|
155
|
+
const templateNumPattern = new RegExp(templateNumPatternStr);
|
|
156
|
+
const templateNumMatch = url.match(templateNumPattern);
|
|
157
|
+
|
|
158
|
+
if (templateNumMatch && templateNumMatch.length > 1) {
|
|
159
|
+
return templateNumMatch[1];
|
|
160
|
+
}
|
|
161
|
+
return '-1';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
private fixedLocationPrefix(locationPrefix: string): string {
|
|
165
|
+
const locationPrefixPatternStr = '\\/$';
|
|
166
|
+
const locationPrefixPattern = new RegExp(locationPrefixPatternStr);
|
|
167
|
+
const locationPrefixMatch = locationPrefix.match(locationPrefixPattern);
|
|
168
|
+
|
|
169
|
+
if (!locationPrefixMatch) {
|
|
170
|
+
locationPrefix += '/';
|
|
171
|
+
}
|
|
172
|
+
return locationPrefix;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<mat-accordion class="source-accordion" multi>
|
|
2
|
+
|
|
3
|
+
<mat-expansion-panel *ngIf="showInstanceDataCore" expanded="{{expandedInstanceDataCore}}">
|
|
4
|
+
<mat-expansion-panel-header>
|
|
5
|
+
<mat-panel-title>
|
|
6
|
+
<mat-icon>device_hub</mat-icon>
|
|
7
|
+
{{'Extra.JsonLD.InstanceCore' | translate}}
|
|
8
|
+
</mat-panel-title>
|
|
9
|
+
<mat-panel-description>
|
|
10
|
+
|
|
11
|
+
<mat-icon matRipple [cdkCopyToClipboard]="dataContext.instanceExtractData | json" (click)="stopPropagation($event)" matTooltip="{{'Generic.Copy' | translate}}">content_copy</mat-icon>
|
|
12
|
+
</mat-panel-description>
|
|
13
|
+
</mat-expansion-panel-header>
|
|
14
|
+
|
|
15
|
+
<ng-template matExpansionPanelContent>
|
|
16
|
+
<mat-card>
|
|
17
|
+
<pre>{{dataContext.instanceExtractData | json}}</pre>
|
|
18
|
+
</mat-card>
|
|
19
|
+
</ng-template>
|
|
20
|
+
</mat-expansion-panel>
|
|
21
|
+
|
|
22
|
+
<mat-expansion-panel *ngIf="showInstanceDataFull" expanded="{{expandedInstanceDataFull}}">
|
|
23
|
+
<mat-expansion-panel-header>
|
|
24
|
+
<mat-panel-title>
|
|
25
|
+
<mat-icon>device_hub</mat-icon>
|
|
26
|
+
{{'Extra.JsonLD.Instance' | translate}}
|
|
27
|
+
</mat-panel-title>
|
|
28
|
+
<mat-panel-description>
|
|
29
|
+
|
|
30
|
+
<mat-icon matRipple [cdkCopyToClipboard]="dataContext.instanceFullData | json" (click)="stopPropagation($event)" matTooltip="{{'Generic.Copy' | translate}}">content_copy</mat-icon>
|
|
31
|
+
</mat-panel-description>
|
|
32
|
+
</mat-expansion-panel-header>
|
|
33
|
+
|
|
34
|
+
<ng-template matExpansionPanelContent>
|
|
35
|
+
<mat-card>
|
|
36
|
+
<pre>{{dataContext.instanceFullData | json}}</pre>
|
|
37
|
+
</mat-card>
|
|
38
|
+
</ng-template>
|
|
39
|
+
</mat-expansion-panel>
|
|
40
|
+
|
|
41
|
+
<mat-expansion-panel *ngIf="showTemplateSourceData" expanded="{{expandedTemplateSourceData}}">
|
|
42
|
+
<mat-expansion-panel-header>
|
|
43
|
+
<mat-panel-title>
|
|
44
|
+
<mat-icon>view_module</mat-icon>
|
|
45
|
+
{{'Extra.JsonSchemaTemplate' | translate}}
|
|
46
|
+
</mat-panel-title>
|
|
47
|
+
<mat-panel-description>
|
|
48
|
+
|
|
49
|
+
<mat-icon matRipple [cdkCopyToClipboard]="dataContext.templateInput | json" (click)="stopPropagation($event)" matTooltip="{{'Generic.Copy' | translate}}">content_copy</mat-icon>
|
|
50
|
+
</mat-panel-description>
|
|
51
|
+
</mat-expansion-panel-header>
|
|
52
|
+
|
|
53
|
+
<ng-template matExpansionPanelContent>
|
|
54
|
+
<mat-card>
|
|
55
|
+
<pre>{{dataContext.templateInput | json}}</pre>
|
|
56
|
+
</mat-card>
|
|
57
|
+
</ng-template>
|
|
58
|
+
</mat-expansion-panel>
|
|
59
|
+
|
|
60
|
+
<mat-expansion-panel *ngIf="showTemplateRenderingRepresentation" expanded="{{expandedTemplateRenderingRepresentation}}">
|
|
61
|
+
<mat-expansion-panel-header>
|
|
62
|
+
<mat-panel-title>
|
|
63
|
+
<mat-icon>list_alt</mat-icon>
|
|
64
|
+
{{'Extra.TemplateRendering' | translate}}
|
|
65
|
+
</mat-panel-title>
|
|
66
|
+
<mat-panel-description>
|
|
67
|
+
|
|
68
|
+
<mat-icon matRipple [cdkCopyToClipboard]="dataContext.templateRepresentation | json" (click)="stopPropagation($event)" matTooltip="{{'Generic.Copy' | translate}}">content_copy</mat-icon>
|
|
69
|
+
</mat-panel-description>
|
|
70
|
+
</mat-expansion-panel-header>
|
|
71
|
+
|
|
72
|
+
<ng-template matExpansionPanelContent>
|
|
73
|
+
<mat-card>
|
|
74
|
+
<pre>{{dataContext.templateRepresentation | json}}</pre>
|
|
75
|
+
</mat-card>
|
|
76
|
+
</ng-template>
|
|
77
|
+
</mat-expansion-panel>
|
|
78
|
+
|
|
79
|
+
<mat-expansion-panel *ngIf="showMultiInstanceInfo" expanded="{{expandedMultiInstanceInfo}}">
|
|
80
|
+
<mat-expansion-panel-header>
|
|
81
|
+
<mat-panel-title>
|
|
82
|
+
<mat-icon>list_alt</mat-icon>
|
|
83
|
+
{{'Extra.MultiInstance' | translate}}
|
|
84
|
+
</mat-panel-title>
|
|
85
|
+
<mat-panel-description>
|
|
86
|
+
|
|
87
|
+
<mat-icon matRipple [cdkCopyToClipboard]="dataContext.multiInstanceData | json" (click)="stopPropagation($event)" matTooltip="{{'Generic.Copy' | translate}}">content_copy</mat-icon>
|
|
88
|
+
</mat-panel-description>
|
|
89
|
+
</mat-expansion-panel-header>
|
|
90
|
+
|
|
91
|
+
<ng-template matExpansionPanelContent>
|
|
92
|
+
<mat-card>
|
|
93
|
+
<pre>{{dataContext.multiInstanceData | json}}</pre>
|
|
94
|
+
</mat-card>
|
|
95
|
+
</ng-template>
|
|
96
|
+
</mat-expansion-panel>
|
|
97
|
+
|
|
98
|
+
</mat-accordion>
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SourcePanelsComponent } from './source-panels.component';
|
|
4
|
+
|
|
5
|
+
describe('SourcePanelsComponent', () => {
|
|
6
|
+
let component: SourcePanelsComponent;
|
|
7
|
+
let fixture: ComponentFixture<SourcePanelsComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ SourcePanelsComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(SourcePanelsComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core';
|
|
2
|
+
import {DataContext} from '../../util/data-context';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-source-panels',
|
|
6
|
+
templateUrl: './source-panels.component.html',
|
|
7
|
+
styleUrls: ['./source-panels.component.scss'],
|
|
8
|
+
encapsulation: ViewEncapsulation.None
|
|
9
|
+
})
|
|
10
|
+
export class SourcePanelsComponent implements OnInit {
|
|
11
|
+
|
|
12
|
+
@Input() dataContext: DataContext = null;
|
|
13
|
+
|
|
14
|
+
@Input() showTemplateRenderingRepresentation: boolean;
|
|
15
|
+
@Input() showMultiInstanceInfo: boolean;
|
|
16
|
+
@Input() showTemplateSourceData: boolean;
|
|
17
|
+
@Input() showInstanceDataCore: boolean;
|
|
18
|
+
@Input() showInstanceDataFull: boolean;
|
|
19
|
+
|
|
20
|
+
@Input() expandedInstanceDataCore = false;
|
|
21
|
+
@Input() expandedInstanceDataFull = false;
|
|
22
|
+
@Input() expandedTemplateSourceData = false;
|
|
23
|
+
@Input() expandedTemplateRenderingRepresentation = false;
|
|
24
|
+
@Input() expandedMultiInstanceInfo = false;
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ngOnInit(): void {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
stopPropagation(event): void {
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="wide-container">
|
|
2
|
+
|
|
3
|
+
<footer class="main__footer">
|
|
4
|
+
<div class="flex">
|
|
5
|
+
<a href="https://bmir.stanford.edu" target="_blank"><img src="assets/images/bmir-logo.png" class="bmir-logo" matTooltip="{{'Generic.BMIR' | translate}}"></a>
|
|
6
|
+
<div class="paragraph__section">
|
|
7
|
+
<p>
|
|
8
|
+
{{'App.Maintained' | translate}}
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<a href="https://more.metadatacenter.org/tools-training/support/#contact" target="_blank">{{'App.Contact' | translate}}</a>
|
|
12
|
+
</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</footer>
|
|
16
|
+
|
|
17
|
+
</div>
|