| 1 | /* |
| 2 | * Copyright (c) 2024 sovity GmbH |
| 3 | * |
| 4 | * This program and the accompanying materials are made available under the |
| 5 | * terms of the Apache License, Version 2.0 which is available at |
| 6 | * https://www.apache.org/licenses/LICENSE-2.0 |
| 7 | * |
| 8 | * SPDX-License-Identifier: Apache-2.0 |
| 9 | * |
| 10 | * Contributors: |
| 11 | * sovity GmbH - initial implementation |
| 12 | */ |
| 13 | import {ClipboardModule} from '@angular/cdk/clipboard'; |
| 14 | import {CommonModule} from '@angular/common'; |
| 15 | import {NgModule} from '@angular/core'; |
| 16 | import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
| 17 | import {MatAutocompleteModule} from '@angular/material/autocomplete'; |
| 18 | import {MatBadgeModule} from '@angular/material/badge'; |
| 19 | import {MatButtonModule} from '@angular/material/button'; |
| 20 | import {MatButtonToggleModule} from '@angular/material/button-toggle'; |
| 21 | import {MatCardModule} from '@angular/material/card'; |
| 22 | import {MatCheckboxModule} from '@angular/material/checkbox'; |
| 23 | import {MatChipsModule} from '@angular/material/chips'; |
| 24 | import {MatLineModule} from '@angular/material/core'; |
| 25 | import {MatDatepickerModule} from '@angular/material/datepicker'; |
| 26 | import {MatDialogModule} from '@angular/material/dialog'; |
| 27 | import {MatDividerModule} from '@angular/material/divider'; |
| 28 | import {MatExpansionModule} from '@angular/material/expansion'; |
| 29 | import {MatFormFieldModule} from '@angular/material/form-field'; |
| 30 | import {MatIconModule} from '@angular/material/icon'; |
| 31 | import {MatInputModule} from '@angular/material/input'; |
| 32 | import {MatLegacyChipsModule} from '@angular/material/legacy-chips'; |
| 33 | import {MatListModule} from '@angular/material/list'; |
| 34 | import {MatMenuModule} from '@angular/material/menu'; |
| 35 | import {MatPaginatorModule} from '@angular/material/paginator'; |
| 36 | import {MatRadioModule} from '@angular/material/radio'; |
| 37 | import {MatSelectModule} from '@angular/material/select'; |
| 38 | import {MatSlideToggleModule} from '@angular/material/slide-toggle'; |
| 39 | import {MatStepperModule} from '@angular/material/stepper'; |
| 40 | import {MatTableModule} from '@angular/material/table'; |
| 41 | import {MatTabsModule} from '@angular/material/tabs'; |
| 42 | import {MatToolbarModule} from '@angular/material/toolbar'; |
| 43 | import {MatTooltipModule} from '@angular/material/tooltip'; |
| 44 | import {RouterModule} from '@angular/router'; |
| 45 | import {SvgIconServiceService} from 'src/app/core/services/svg-icon.service.service'; |
| 46 | import {ConnectorRegisteringSuccessMessagePageComponent} from './business/connector-registering-success-message-page/connector-registering-success-message-page.component'; |
| 47 | import {ConnectorStatusLedComponent} from './business/connector-status-led/connector-status-led.component'; |
| 48 | import {DeleteConnectorModalComponent} from './business/delete-connector-modal/delete-connector-modal.component'; |
| 49 | import {OrganizationCreateFormComponent} from './business/organization-create-form/organization-create-form.component'; |
| 50 | import {OrganizationDeleteDialogComponent} from './business/organization-delete-dialog/organization-delete-dialog.component'; |
| 51 | import {OrganizationDeleteDialogService} from './business/organization-delete-dialog/organization-delete-dialog.service'; |
| 52 | import {OrganizationEditFormComponent} from './business/organization-edit-form/organization-edit-form.component'; |
| 53 | import {SharedConnectorDetailComponent} from './business/shared-connector-detail/shared-connector-detail.component'; |
| 54 | import {SharedOrganizationDetailComponent} from './business/shared-organization-detail/shared-organization-detail.component'; |
| 55 | import {SharedUserDetailComponent} from './business/shared-user-detail/shared-user-detail.component'; |
| 56 | import {SharedUserListComponent} from './business/shared-user-list/shared-user-list.component'; |
| 57 | import {UserCreateFormComponent} from './business/user-create-form/user-create-form.component'; |
| 58 | import {UserDeleteDialogComponent} from './business/user-delete-dialog/user-delete-dialog.component'; |
| 59 | import {UserDeleteDialogService} from './business/user-delete-dialog/user-delete-dialog.service'; |
| 60 | import {UserEditFormComponent} from './business/user-edit-form/user-edit-form.component'; |
| 61 | import {UserOnboardFormComponent} from './business/user-onboard-form/user-onboard-form.component'; |
| 62 | import {AgoComponent} from './common/ago/ago.component'; |
| 63 | import {ConfirmationDialogComponent} from './common/confirmation-dialog/confirmation-dialog.component'; |
| 64 | import {EmptyElementComponent} from './common/empty-element/empty-element.component'; |
| 65 | import {ErrorElementComponent} from './common/error-element/error-element.component'; |
| 66 | import {FilterBarComponent} from './common/filter-bar/filter-bar.component'; |
| 67 | import {HeaderBarComponent} from './common/header-bar/header-bar.component'; |
| 68 | import {LoadingElementComponent} from './common/loading-element/loading-element.component'; |
| 69 | import {LogoutButtonComponent} from './common/logout-button/logout-button.component'; |
| 70 | import {AvatarComponent} from './common/portal-layout/avatar/avatar.component'; |
| 71 | import {BreadcrumbComponent} from './common/portal-layout/breadcrumb/breadcrumb.component'; |
| 72 | import {ControlCenterComponent} from './common/portal-layout/control-center/control-center.component'; |
| 73 | import {FooterCopyrightComponent} from './common/portal-layout/footer-copyright/footer-copyright.component'; |
| 74 | import {FooterForFullPageComponent} from './common/portal-layout/footer-for-full-page/footer-for-full-page.component'; |
| 75 | import {FooterLinksComponent} from './common/portal-layout/footer-links/footer-links.component'; |
| 76 | import {PortalLayoutComponent} from './common/portal-layout/portal-layout/portal-layout.component'; |
| 77 | import {SidebarElementComponent} from './common/portal-layout/sidebar-element/sidebar-element.component'; |
| 78 | import {SidebarComponent} from './common/portal-layout/sidebar/sidebar.component'; |
| 79 | import {TitleBarComponent} from './common/portal-layout/title-bar/title-bar.component'; |
| 80 | import {ToolbarComponent} from './common/portal-layout/toolbar/toolbar.component'; |
| 81 | import {SelectionBoxComponent} from './common/selection-box/selection-box.component'; |
| 82 | import {SlideOverComponent} from './common/slide-over/slide-over.component'; |
| 83 | import {ToastNotificationsComponent} from './common/toast-notifications/toast-notifications.component'; |
| 84 | import {E2EDevUserSwitcherComponent} from './dev-utils/e2e-dev-user-switcher/e2e-dev-user-switcher.component'; |
| 85 | import {EnvBannerComponent} from './dev-utils/env-banner/env-banner.component'; |
| 86 | import {EnvSwitcherComponent} from './dev-utils/env-switcher/env-switcher.component'; |
| 87 | import {FakeBackendUserSwitcherComponent} from './dev-utils/fake-backend-user-switcher/fake-backend-user-switcher.component'; |
| 88 | import {ApplicationRolesTooltipComponent} from './form-elements/application-roles-tooltip/application-roles-tooltip.component'; |
| 89 | import {CertificateInputFormComponent} from './form-elements/certificate-input-form/certificate-input-form.component'; |
| 90 | import {CertificateInputComponent} from './form-elements/certificate-input/certificate-input.component'; |
| 91 | import {ConnectorUrlInputComponent} from './form-elements/connector-url-input/connector-url-input.component'; |
| 92 | import {IndustrySelectComponent} from './form-elements/industry-select/industry-select.component'; |
| 93 | import {OrganizationRolesTooltipComponent} from './form-elements/organization-roles-tooltip/organization-roles-tooltip.component'; |
| 94 | import {OrganizationSelectComponent} from './form-elements/organization-select/organization-select.component'; |
| 95 | import {PasswordInputComponent} from './form-elements/password-input/password-input.component'; |
| 96 | import {PasswordRepeatInputComponent} from './form-elements/password-repeat-input/password-repeat-input.component'; |
| 97 | import {ReadonlyTextInputComponent} from './form-elements/readonly-text-input/readonly-text-input.component'; |
| 98 | import {TextAreaComponent} from './form-elements/text-area/text-area.component'; |
| 99 | import {TextInputComponent} from './form-elements/text-input/text-input.component'; |
| 100 | import {TosCheckComponent} from './form-elements/tos-check/tos-check.component'; |
| 101 | import {AgoPipe} from './pipes-and-directives/ago.pipe'; |
| 102 | import {AutofocusDirective} from './pipes-and-directives/autofocus.direcitive'; |
| 103 | import {CheckIfNotCurrentUserPipe} from './pipes-and-directives/check-if-not-current-user.pipe'; |
| 104 | import {CompareByFieldPipe} from './pipes-and-directives/compare-by-field.pipe'; |
| 105 | import {DisabledButtonDirective} from './pipes-and-directives/disabled-button.directive'; |
| 106 | import {ExternalLinkDirective} from './pipes-and-directives/external-link.directive'; |
| 107 | import {FilterByRegistrationStatusPipe} from './pipes-and-directives/filter-by-registration-status.pipe'; |
| 108 | import {FormControlErrorDirective} from './pipes-and-directives/form-control-error.directive'; |
| 109 | import {FormatIntegerPipe} from './pipes-and-directives/format-integer.pipe'; |
| 110 | import {HasAnyRolePipe} from './pipes-and-directives/has-any-role.pipe'; |
| 111 | import {HasRolePipe} from './pipes-and-directives/has-role.pipe'; |
| 112 | import {IsActiveFeaturePipe} from './pipes-and-directives/is-active-feature.pipe'; |
| 113 | import {RemoveClassDirective} from './pipes-and-directives/remove-class.directive'; |
| 114 | import {SentenceCasePipe} from './pipes-and-directives/sentence-case.pipe'; |
| 115 | import {TrackByFieldDirective} from './pipes-and-directives/track-by-field.directive'; |
| 116 | import {ValuesPipe} from './pipes-and-directives/values.pipe'; |
| 117 | |
| 118 | const COMPONENTS = [ |
| 119 | // ./business |
| 120 | ConnectorRegisteringSuccessMessagePageComponent, |
| 121 | ConnectorStatusLedComponent, |
| 122 | DeleteConnectorModalComponent, |
| 123 | OrganizationCreateFormComponent, |
| 124 | OrganizationDeleteDialogComponent, |
| 125 | OrganizationEditFormComponent, |
| 126 | SharedConnectorDetailComponent, |
| 127 | SharedOrganizationDetailComponent, |
| 128 | SharedUserDetailComponent, |
| 129 | SharedUserListComponent, |
| 130 | UserCreateFormComponent, |
| 131 | UserDeleteDialogComponent, |
| 132 | UserEditFormComponent, |
| 133 | UserOnboardFormComponent, |
| 134 | |
| 135 | // ./common |
| 136 | AgoComponent, |
| 137 | ConfirmationDialogComponent, |
| 138 | EmptyElementComponent, |
| 139 | ErrorElementComponent, |
| 140 | FilterBarComponent, |
| 141 | HeaderBarComponent, |
| 142 | LoadingElementComponent, |
| 143 | LogoutButtonComponent, |
| 144 | SelectionBoxComponent, |
| 145 | SlideOverComponent, |
| 146 | ToastNotificationsComponent, |
| 147 | |
| 148 | // ./common/portal-layout |
| 149 | AvatarComponent, |
| 150 | BreadcrumbComponent, |
| 151 | ControlCenterComponent, |
| 152 | FooterCopyrightComponent, |
| 153 | FooterForFullPageComponent, |
| 154 | FooterLinksComponent, |
| 155 | PortalLayoutComponent, |
| 156 | SidebarComponent, |
| 157 | SidebarElementComponent, |
| 158 | TitleBarComponent, |
| 159 | ToolbarComponent, |
| 160 | |
| 161 | // ./dev-utils |
| 162 | E2EDevUserSwitcherComponent, |
| 163 | EnvBannerComponent, |
| 164 | EnvSwitcherComponent, |
| 165 | FakeBackendUserSwitcherComponent, |
| 166 | |
| 167 | // ./form-elements |
| 168 | ApplicationRolesTooltipComponent, |
| 169 | CertificateInputComponent, |
| 170 | CertificateInputFormComponent, |
| 171 | ConnectorUrlInputComponent, |
| 172 | IndustrySelectComponent, |
| 173 | OrganizationRolesTooltipComponent, |
| 174 | OrganizationSelectComponent, |
| 175 | PasswordInputComponent, |
| 176 | PasswordRepeatInputComponent, |
| 177 | ReadonlyTextInputComponent, |
| 178 | TextAreaComponent, |
| 179 | TextInputComponent, |
| 180 | TosCheckComponent, |
| 181 | |
| 182 | // ./pipes-and-directives |
| 183 | AgoPipe, |
| 184 | AutofocusDirective, |
| 185 | CheckIfNotCurrentUserPipe, |
| 186 | CompareByFieldPipe, |
| 187 | DisabledButtonDirective, |
| 188 | ExternalLinkDirective, |
| 189 | FilterByRegistrationStatusPipe, |
| 190 | FormatIntegerPipe, |
| 191 | FormControlErrorDirective, |
| 192 | HasAnyRolePipe, |
| 193 | HasRolePipe, |
| 194 | IsActiveFeaturePipe, |
| 195 | RemoveClassDirective, |
| 196 | SentenceCasePipe, |
| 197 | TrackByFieldDirective, |
| 198 | ValuesPipe, |
| 199 | ]; |
| 200 | |
| 201 | const MODULES = [ |
| 202 | // Angular Material |
| 203 | MatAutocompleteModule, |
| 204 | MatButtonModule, |
| 205 | MatButtonToggleModule, |
| 206 | MatCheckboxModule, |
| 207 | MatChipsModule, |
| 208 | MatDialogModule, |
| 209 | MatFormFieldModule, |
| 210 | MatIconModule, |
| 211 | MatInputModule, |
| 212 | MatLineModule, |
| 213 | MatMenuModule, |
| 214 | MatRadioModule, |
| 215 | MatSelectModule, |
| 216 | MatSlideToggleModule, |
| 217 | MatStepperModule, |
| 218 | MatTabsModule, |
| 219 | MatToolbarModule, |
| 220 | MatDividerModule, |
| 221 | MatDatepickerModule, |
| 222 | MatTooltipModule, |
| 223 | |
| 224 | // For Catalog? |
| 225 | MatBadgeModule, |
| 226 | MatCardModule, |
| 227 | MatExpansionModule, |
| 228 | MatListModule, |
| 229 | MatPaginatorModule, |
| 230 | MatTableModule, |
| 231 | MatLegacyChipsModule, |
| 232 | |
| 233 | // Angular CDK |
| 234 | ClipboardModule, |
| 235 | ]; |
| 236 | |
| 237 | @NgModule({ |
| 238 | declarations: COMPONENTS, |
| 239 | imports: [ |
| 240 | CommonModule, |
| 241 | RouterModule, |
| 242 | FormsModule, |
| 243 | ReactiveFormsModule, |
| 244 | ...MODULES, |
| 245 | ], |
| 246 | exports: [...COMPONENTS, ...MODULES], |
| 247 | providers: [UserDeleteDialogService, OrganizationDeleteDialogService], |
| 248 | }) |
| 249 | export class SharedModule { |
| 250 | constructor(private svgIconServiceService: SvgIconServiceService) { |
| 251 | const iconsList = [ |
| 252 | 'account-circle', |
| 253 | 'arrow-down-tray', |
| 254 | 'arrow-left-on-rectangle', |
| 255 | 'bell', |
| 256 | 'briefcase', |
| 257 | 'building-office-2', |
| 258 | 'building-office', |
| 259 | 'checkbox', |
| 260 | 'chevron-down', |
| 261 | 'chevron-left', |
| 262 | 'chevron-up', |
| 263 | 'connector-2', |
| 264 | 'connector', |
| 265 | 'dashboard', |
| 266 | 'document-text', |
| 267 | 'ellipsis-horizontal', |
| 268 | 'extension', |
| 269 | 'github', |
| 270 | 'home', |
| 271 | 'navigation-next', |
| 272 | 'pencil', |
| 273 | 'question-mark-circle', |
| 274 | 'search', |
| 275 | 'status', |
| 276 | 'support', |
| 277 | 'tag', |
| 278 | 'user', |
| 279 | 'users', |
| 280 | 'profile', |
| 281 | ]; |
| 282 | this.svgIconServiceService.initializeIcons(iconsList); // to registers all the SVG icons in matIconRegistry |
| 283 | } |
| 284 | } |