Skip to content

Commit c1cdae4

Browse files
paulbertdogi
andauthored
all: smoother components standalone handling (fixes #9829) (#9830)
Co-authored-by: dogi <dogi@users.noreply.github.com>
1 parent 590424c commit c1cdae4

194 files changed

Lines changed: 2084 additions & 762 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "planet",
33
"license": "AGPL-3.0",
4-
"version": "0.22.41",
4+
"version": "0.22.42",
55
"myplanet": {
66
"latest": "v0.52.60",
77
"min": "v0.51.90"

src/app/app.component.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import { Observable } from 'rxjs/Observable';
66

77
describe('App', () => {
88
beforeEach(() => {
9-
TestBed.configureTestingModule({
10-
imports: [ RouterTestingModule ],
11-
declarations: [ AppComponent ]
9+
TestBed.configureTestingModule({
10+
imports: [RouterTestingModule, AppComponent]
1211
});
1312
});
1413

src/app/app.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { Component } from '@angular/core';
22
import { DomSanitizer } from '@angular/platform-browser';
33
import { MatIconRegistry } from '@angular/material/icon';
4-
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
5-
import { StateService } from './shared/state.service';
4+
import { Router, NavigationStart, NavigationEnd, RouterOutlet } from '@angular/router';
5+
import { StateService } from './shared/state.service';
6+
import { Dir } from '@angular/cdk/bidi';
67
declare let gtag: (type: string, account: string, params: { 'page_path': string }) => void;
78

8-
@Component({
9-
selector: 'planet-app',
10-
template: '<div i18n-dir dir="ltr"><router-outlet></router-outlet></div>',
11-
standalone: false
9+
@Component({
10+
selector: 'planet-app',
11+
template: '<div i18n-dir dir="ltr"><router-outlet></router-outlet></div>',
12+
imports: [Dir, RouterOutlet]
1213
})
1314
export class AppComponent {
1415
constructor(

src/app/app.module.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/app/chat/chat-sidebar/chat-sidebar.component.ts

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit, OnDestroy, HostListener } from '@angular/core';
2-
import { NonNullableFormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
2+
import { NonNullableFormBuilder, FormGroup, Validators, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
33
import { MatDialog } from '@angular/material/dialog';
44
import { Subject } from 'rxjs';
55
import { takeUntil } from 'rxjs/operators';
@@ -12,6 +12,20 @@ import { DialogsChatShareComponent } from '../../shared/dialogs/dialogs-chat-sha
1212
import { SearchService } from '../../shared/forms/search.service';
1313
import { showFormErrors, trackById } from '../../shared/table-helpers';
1414
import { UserService } from '../../shared/user.service';
15+
import { MatDrawerContainer, MatDrawer } from '@angular/material/sidenav';
16+
import { MatButton, MatMiniFabButton, MatIconButton } from '@angular/material/button';
17+
import { MatIcon } from '@angular/material/icon';
18+
import { NgIf, NgFor, NgTemplateOutlet } from '@angular/common';
19+
import { MatFormField, MatLabel, MatError } from '@angular/material/form-field';
20+
import { MatInput } from '@angular/material/input';
21+
import { MatTooltip } from '@angular/material/tooltip';
22+
import { MatCheckbox } from '@angular/material/checkbox';
23+
import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay';
24+
import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle';
25+
import { FormErrorMessagesComponent } from '../../shared/forms/form-error-messages.component';
26+
import { PlanetLoadingSpinnerComponent } from '../../shared/planet-loading-spinner.component';
27+
import { ChatWindowComponent } from '../chat-window/chat-window.component';
28+
import { TruncateTextPipe } from '../../shared/truncate-text.pipe';
1529

1630
interface TitleForm {
1731
title: FormControl<string>;
@@ -21,7 +35,33 @@ interface TitleForm {
2135
selector: 'planet-chat-sidebar',
2236
templateUrl: './chat-sidebar.component.html',
2337
styleUrls: ['./chat-sidebar.scss'],
24-
standalone: false
38+
imports: [
39+
MatDrawerContainer,
40+
MatDrawer,
41+
MatButton,
42+
MatIcon,
43+
NgIf,
44+
MatMiniFabButton,
45+
MatFormField,
46+
MatLabel,
47+
MatInput,
48+
FormsModule,
49+
MatIconButton,
50+
MatTooltip,
51+
MatCheckbox,
52+
CdkOverlayOrigin,
53+
CdkConnectedOverlay,
54+
MatButtonToggleGroup,
55+
MatButtonToggle,
56+
NgFor,
57+
ReactiveFormsModule,
58+
MatError,
59+
FormErrorMessagesComponent,
60+
NgTemplateOutlet,
61+
PlanetLoadingSpinnerComponent,
62+
ChatWindowComponent,
63+
TruncateTextPipe
64+
]
2565
})
2666
export class ChatSidebarComponent implements OnInit, OnDestroy {
2767
readonly dbName = 'chat_history';

src/app/chat/chat-window/chat-window.component.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit, OnDestroy, ViewChild, ElementRef, ChangeDetectorRef, Input, AfterViewInit } from '@angular/core';
2-
import { NonNullableFormBuilder, FormGroup, FormControl } from '@angular/forms';
2+
import { NonNullableFormBuilder, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
33
import { Subject } from 'rxjs';
44
import { filter, takeUntil } from 'rxjs/operators';
55
import { CustomValidators } from '../../validators/custom-validators';
@@ -8,14 +8,36 @@ import { ChatService } from '../../shared/chat.service';
88
import { showFormErrors, trackByIdVal } from '../../shared/table-helpers';
99
import { UserService } from '../../shared/user.service';
1010
import { StateService } from '../../shared/state.service';
11+
import { NgFor, NgClass } from '@angular/common';
12+
import { ChatOutputDirective } from '../../shared/chat-output.directive';
13+
import { MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field';
14+
import { MatInput } from '@angular/material/input';
15+
import { MatIconButton } from '@angular/material/button';
16+
import { MatTooltip } from '@angular/material/tooltip';
17+
import { SubmitDirective } from '../../shared/submit.directive';
18+
import { MatIcon } from '@angular/material/icon';
1119

1220
type PromptFormGroup = FormGroup<{ prompt: FormControl<string> }>;
1321

1422
@Component({
1523
selector: 'planet-chat-window',
1624
templateUrl: './chat-window.component.html',
1725
styleUrls: ['./chat-window.scss'],
18-
standalone: false
26+
imports: [
27+
NgFor,
28+
ChatOutputDirective,
29+
NgClass,
30+
FormsModule,
31+
ReactiveFormsModule,
32+
MatFormField,
33+
MatLabel,
34+
MatInput,
35+
MatIconButton,
36+
MatSuffix,
37+
MatTooltip,
38+
SubmitDirective,
39+
MatIcon
40+
]
1941
})
2042
export class ChatWindowComponent implements OnInit, OnDestroy, AfterViewInit {
2143
@Input() context: any;

src/app/chat/chat.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ import { ActivatedRoute, Router } from '@angular/router';
33

44
import { ChatService } from '../shared/chat.service';
55
import { AIProvider, ProviderName } from './chat.model';
6+
import { MatToolbar } from '@angular/material/toolbar';
7+
import { MatIconButton } from '@angular/material/button';
8+
import { MatIcon } from '@angular/material/icon';
9+
import { NgIf, NgFor } from '@angular/common';
10+
import { MatFormField } from '@angular/material/form-field';
11+
import { MatSelect } from '@angular/material/select';
12+
import { FormsModule } from '@angular/forms';
13+
import { MatOption } from '@angular/material/autocomplete';
14+
import { ChatSidebarComponent } from './chat-sidebar/chat-sidebar.component';
615

716
@Component({
817
selector: 'planet-chat',
918
templateUrl: './chat.component.html',
1019
styleUrls: ['./chat.scss'],
11-
standalone: false
20+
imports: [MatToolbar, MatIconButton, MatIcon, NgIf, MatFormField, MatSelect, FormsModule, NgFor, MatOption, ChatSidebarComponent]
1221
})
1322
export class ChatComponent implements OnInit {
1423
activeService?: ProviderName;

src/app/chat/chat.module.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ import { DialogsChatShareComponent } from '../shared/dialogs/dialogs-chat-share.
2121
ReactiveFormsModule,
2222
SharedComponentsModule,
2323
ChatRouterModule,
24-
TeamsModule
25-
],
26-
declarations: [
24+
TeamsModule,
2725
ChatComponent,
2826
ChatSidebarComponent,
2927
ChatWindowComponent,
3028
DialogsChatShareComponent
3129
],
32-
exports: [ ChatWindowComponent, ChatComponent ]
30+
exports: [ChatWindowComponent, ChatComponent]
3331
})
3432
export class ChatModule {}

src/app/community/community-link-dialog.component.ts

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
import { Component, ViewChild, Inject } from '@angular/core';
2-
import { NonNullableFormBuilder, FormControl, FormGroup } from '@angular/forms';
3-
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
4-
import { MatStepper } from '@angular/material/stepper';
2+
import { NonNullableFormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
3+
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
4+
import { MatStepper, MatStep } from '@angular/material/stepper';
55
import { StepperSelectionEvent } from '@angular/cdk/stepper';
66
import { CustomValidators } from '../validators/custom-validators';
77
import { TeamsService } from '../teams/teams.service';
88
import { switchMap } from 'rxjs/operators';
99
import { ValidatorService } from '../validators/validator.service';
1010
import { PlanetMessageService } from '../shared/planet-message.service';
11+
import { CdkScrollable } from '@angular/cdk/scrolling';
12+
import { MatFormField, MatLabel, MatError } from '@angular/material/form-field';
13+
import { MatSelect, MatSelectTrigger } from '@angular/material/select';
14+
import { NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';
15+
import { MatOption } from '@angular/material/autocomplete';
16+
import { TeamsComponent } from '../teams/teams.component';
17+
import { MatInput } from '@angular/material/input';
18+
import { FormErrorMessagesComponent } from '../shared/forms/form-error-messages.component';
19+
import { MatIcon } from '@angular/material/icon';
20+
import { MatButton } from '@angular/material/button';
1121

1222
interface CommunityLinkForm {
1323
title: FormControl<string>;
@@ -32,13 +42,38 @@ interface TeamSelectionEvent {
3242

3343
@Component({
3444
templateUrl: './community-link-dialog.component.html',
35-
styles: [ `
45+
styles: [`
3646
.platform-icon {
3747
vertical-align: middle;
3848
margin-right: 5px;
3949
}
40-
` ],
41-
standalone: false,
50+
`],
51+
imports: [
52+
MatDialogTitle,
53+
CdkScrollable,
54+
MatDialogContent,
55+
MatFormField,
56+
MatLabel,
57+
MatSelect,
58+
FormsModule,
59+
NgFor,
60+
MatOption,
61+
NgIf,
62+
ReactiveFormsModule,
63+
MatStepper,
64+
MatStep,
65+
TeamsComponent,
66+
MatInput,
67+
MatError,
68+
FormErrorMessagesComponent,
69+
MatSelectTrigger,
70+
NgSwitch,
71+
NgSwitchCase,
72+
MatIcon,
73+
NgSwitchDefault,
74+
MatDialogActions,
75+
MatButton,
76+
],
4277
})
4378
export class CommunityLinkDialogComponent {
4479

src/app/community/community-list-dialog.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { Component, Inject } from '@angular/core';
2-
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
2+
import { MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
3+
import { CdkScrollable } from '@angular/cdk/scrolling';
4+
import { CommunityListComponent } from './community-list.component';
5+
import { MatButton } from '@angular/material/button';
36

47
@Component({
58
templateUrl: './community-list-dialog.component.html',
@@ -8,7 +11,7 @@ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
811
min-width: 33vw;
912
}
1013
`],
11-
standalone: false
14+
imports: [MatDialogTitle, CdkScrollable, MatDialogContent, CommunityListComponent, MatDialogActions, MatButton]
1215
})
1316
export class CommunityListDialogComponent {
1417

0 commit comments

Comments
 (0)