diff --git a/src/app/adf-config/df-system-info/df-system-info.component.html b/src/app/adf-config/df-system-info/df-system-info.component.html index d1c71be8..61422d24 100644 --- a/src/app/adf-config/df-system-info/df-system-info.component.html +++ b/src/app/adf-config/df-system-info/df-system-info.component.html @@ -32,6 +32,7 @@

DreamFactory {{ 'systemInfo.instance.instance' | transloco }}

{{ 'version' | transloco }}: {{ environment.platform?.version }} +
  • UI {{ 'version' | transloco }}: 1.3.6
  • {{ 'systemInfo.instance.systemDatabase' | transloco }}: {{ environment.platform?.dbDriver }} diff --git a/src/app/adf-event-scripts/df-script-details/df-script-details.component.html b/src/app/adf-event-scripts/df-script-details/df-script-details.component.html index 3e4795a1..76cf3ce0 100644 --- a/src/app/adf-event-scripts/df-script-details/df-script-details.component.html +++ b/src/app/adf-event-scripts/df-script-details/df-script-details.component.html @@ -110,7 +110,7 @@ > {{ 'roles.accessOverview.tableHeadings.component' | transloco }} - + + + + + + {{ option }} + *ngFor="let option of filteredComponentArray[i]" + [value]="option"> + {{ option }} + diff --git a/src/app/adf-roles/df-roles-access/df-roles-access.component.scss b/src/app/adf-roles/df-roles-access/df-roles-access.component.scss index d6756233..d75198b0 100644 --- a/src/app/adf-roles/df-roles-access/df-roles-access.component.scss +++ b/src/app/adf-roles/df-roles-access/df-roles-access.component.scss @@ -40,3 +40,8 @@ tr.element-row:not(.example-expanded-row):active { .detail-input { margin-right: 20px; } +::ng-deep { + .cdk-overlay-pane { + width: max-content !important; + } +} diff --git a/src/app/adf-roles/df-roles-access/df-roles-access.component.ts b/src/app/adf-roles/df-roles-access/df-roles-access.component.ts index 928fb3dc..4c0c890f 100644 --- a/src/app/adf-roles/df-roles-access/df-roles-access.component.ts +++ b/src/app/adf-roles/df-roles-access/df-roles-access.component.ts @@ -5,6 +5,7 @@ import { FormGroup, ReactiveFormsModule, Validators, + FormBuilder, } from '@angular/forms'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; import { faPlus, faTrashCan } from '@fortawesome/free-solid-svg-icons'; @@ -19,6 +20,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatExpansionModule } from '@angular/material/expansion'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { MatButtonModule } from '@angular/material/button'; + import { UntilDestroy } from '@ngneat/until-destroy'; import { BehaviorSubject } from 'rxjs'; import { AsyncPipe } from '@angular/common'; @@ -112,13 +114,24 @@ export class DfRolesAccessComponent implements OnInit { { value: 'is null', label: 'is null' }, { value: 'is not null', label: 'is not null' }, ]; - + form: FormGroup; constructor( private activatedRoute: ActivatedRoute, @Inject(BASE_SERVICE_TOKEN) - private baseService: DfBaseCrudService - ) {} - + private baseService: DfBaseCrudService, + private fb: FormBuilder + ) { + this.form = this.fb.group({ + cFormArray: this.fb.array([this.createItem()]), + }); + } + createItem(): FormGroup { + return this.fb.group({ + service: [''], + component: [''], + }); + } + filteredComponentArray: Array> = []; ngOnInit() { // get services options this.activatedRoute.data.subscribe((data: any) => { @@ -165,10 +178,41 @@ export class DfRolesAccessComponent implements OnInit { }); } }); + this.initializeFilteredComponents(); this.updateDataSource(); } + get cFormArray(): FormArray { + return this.form.get('formArray') as FormArray; + } + initializeFilteredComponents() { + this.filteredComponentArray = this.formArray.controls.map((_, i) => + this.getComponentArray(i) + ); + } + getComponentArray(index: number): Array { + const serviceId = this.formArray.at(index).get('service')?.value; + const components = this.componentOptions.find( + option => option.serviceId === serviceId + )?.components; + return components || []; + } + + filterOptions(event: Event, index: number) { + const input = (event.target as HTMLInputElement).value.toLowerCase(); + const serviceId = this.formArray.at(index).get('service')?.value; + const components = + this.componentOptions.find(option => option.serviceId === serviceId) + ?.components || []; + this.filteredComponentArray[index] = components.filter(option => + option.toLowerCase().includes(input) + ); + } + + onSelectOpened(index: number) { + this.filteredComponentArray[index] = this.getComponentArray(index); + } async getComponents(index: number) { const serviceId = this.formArray.controls[index].get('service')?.value; const service = @@ -198,14 +242,6 @@ export class DfRolesAccessComponent implements OnInit { } } - getComponentArray(index: number) { - const serviceId = this.formArray.at(index).get('service')?.value; - const components = this.componentOptions.find( - option => option.serviceId === serviceId - )?.components; - return components || []; - } - getExtendOperator(index: number) { const serviceId = this.serviceAccess.at(index).get('extend-operator') ?.value; diff --git a/src/app/adf-services/df-service-details/df-service-details.component.html b/src/app/adf-services/df-service-details/df-service-details.component.html index aa25f41f..c6a3fff3 100644 --- a/src/app/adf-services/df-service-details/df-service-details.component.html +++ b/src/app/adf-services/df-service-details/df-service-details.component.html @@ -2,8 +2,8 @@ [formGroup]="serviceForm" class="details-section" [class]="(isDarkMode | async) ? 'dark-theme' : ''" - (ngSubmit)="save(false)"> - + (ngSubmit)="save()"> + @@ -280,25 +280,47 @@

    - - - {{ - 'services.controls.serviceType.label' | transloco - }} - - - {{ type.label }} - - - - + + + + {{ + 'services.controls.serviceType.label' | transloco + }} + + + {{ type.label }} + + + + + + + + {{ + 'services.controls.serviceType.label' | transloco + }} + + + {{ type.label }} + + + + + *ngIf="!subscriptionRequired" >{{ 'active' | transloco }} +
    + + + + + + + + +
    diff --git a/src/app/adf-services/df-service-details/df-service-details.component.ts b/src/app/adf-services/df-service-details/df-service-details.component.ts index 4c530b35..f1b2bbf6 100644 --- a/src/app/adf-services/df-service-details/df-service-details.component.ts +++ b/src/app/adf-services/df-service-details/df-service-details.component.ts @@ -463,7 +463,8 @@ export class DfServiceDetailsComponent implements OnInit { params ) .subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.activatedRoute }); + this.router.navigate([`/api-connections/api-docs/${data.name}`]); + // this.router.navigate(['../'], { relativeTo: this.activatedRoute }); }); } } @@ -472,6 +473,16 @@ export class DfServiceDetailsComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.activatedRoute }); } + gotoSchema() { + const data = this.serviceForm.getRawValue(); + this.router.navigate([`/admin-settings/schema/${data.name}`]); + } + + gotoAPIDocs() { + const data = this.serviceForm.getRawValue(); + this.router.navigate([`/api-connections/api-docs/${data.name}`]); + } + getBackgroundImage(typeLabel: string) { const image = this.images?.find(img => img.label == typeLabel); if (!image) { diff --git a/src/app/shared/components/df-link-service/df-link-service.component.html b/src/app/shared/components/df-link-service/df-link-service.component.html index ed781187..0c06628b 100644 --- a/src/app/shared/components/df-link-service/df-link-service.component.html +++ b/src/app/shared/components/df-link-service/df-link-service.component.html @@ -1,3 +1,85 @@ + +
    + + + + Link to Service + + + + Select Service + + + {{ service.label }} + + + + + Repository: + + + + Branch/Tag: + + + + Path + + +
    + + +
    +
    +
    +
    +
    +=======
    = []; + selectType = false; constructor( private themeService: DfThemeService, @@ -87,6 +96,24 @@ export class DfLinkServiceComponent implements OnInit { ngOnInit() { this.updateDataSource(); } + + ngOnChanges(changes: SimpleChanges) { + if (changes['storageServiceId']) { + this.findServiceById(); + } + } + + findServiceById() { + const select = this.storageServices.find( + service => service.name === this.storageServiceId + ); + if (select?.type === 'github') { + this.selectType = true; + } else { + this.selectType = false; + } + } + updateDataSource() { // } diff --git a/src/app/shared/components/df-script-editor/df-script-editor.component.html b/src/app/shared/components/df-script-editor/df-script-editor.component.html index 2968dc9f..39cb475d 100644 --- a/src/app/shared/components/df-script-editor/df-script-editor.component.html +++ b/src/app/shared/components/df-script-editor/df-script-editor.component.html @@ -23,22 +23,18 @@ {{ 'githubFile' | transloco }} - - - {{ 'path' | transloco }} - - + + {{ 'scripts.path' | transloco }}? + + + {{ 'path' | transloco }} + + +