Skip to content

Commit

Permalink
Merge pull request #7096 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Nov 7, 2023
2 parents a1e107d + 333809f commit 2681435
Show file tree
Hide file tree
Showing 53 changed files with 1,219 additions and 748 deletions.
13 changes: 7 additions & 6 deletions apps/gauzy/src/app/@core/services/github/github.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class GithubService {
*/
public autoSyncIssues(
integrationId: IIntegrationTenant['id'],
repository: IGithubRepository,
repository: IOrganizationGithubRepository,
options: {
organizationId: IOrganization['id'];
tenantId: IOrganization['tenantId'];
Expand All @@ -119,7 +119,7 @@ export class GithubService {
): Observable<any> {
return this._http.post(`${API_PREFIX}/integration/github/${integrationId}/auto-sync/issues`, {
integrationId,
repository: this._mapRepositoryPayload(repository),
repository,
projectId: options.projectId,
organizationId: options.organizationId,
tenantId: options.tenantId
Expand All @@ -135,7 +135,7 @@ export class GithubService {
*/
public manualSyncIssues(
integrationId: IIntegrationTenant['id'],
repository: IGithubRepository,
repository: IOrganizationGithubRepository,
options: {
organizationId: IOrganization['id'];
tenantId: IOrganization['tenantId'];
Expand All @@ -145,7 +145,7 @@ export class GithubService {
): Observable<any> {
return this._http.post(`${API_PREFIX}/integration/github/${integrationId}/manual-sync/issues`, {
integrationId,
repository: this._mapRepositoryPayload(repository),
repository,
issues: this._mapIssuePayload(options.issues),
projectId: options.projectId,
organizationId: options.organizationId,
Expand Down Expand Up @@ -181,12 +181,13 @@ export class GithubService {
* @returns An array of mapped issue payload data.
*/
private _mapIssuePayload(data: IGithubIssue[]): any[] {
return data.map(({ id, number, title, state, body }) => ({
return data.map(({ id, number, title, state, body, labels = [] }) => ({
id,
number,
title,
state,
body
body,
labels
}));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@
</nb-card-body>
</nb-card>

<ng-template #actionButtons >
<ng-template #actionButtons>
<div class="form-group action-buttons">
<button
class="mr-3"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<button
nbButton
status="primary"
class="mr-2"
debounceClick
(throttledClick)="onClicked($event)"
[disabled]="!rowData?.repository?.hasSyncEnabled"
>
<div class="sync-container">
<nb-icon class="sync" icon="sync-outline"></nb-icon>
{{ 'BUTTONS.RESYNC' | translate }}
</div>
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ViewCell } from 'ng2-smart-table';

@Component({
selector: 'ngx-resync-button',
templateUrl: './resync-button.component.html',
styleUrls: [],
})
export class ResyncButtonComponent implements ViewCell {

/**
* Getter and Setter for managing a dynamic value.
*/
_value: any;
/**
* Getter for retrieving the current value.
*
* @returns The current value of the dynamic element.
*/
get value(): any {
return this._value;
}
/**
* Setter for updating the dynamic value.
* This setter is decorated with @Input to allow external components to bind and update the value.
*
* @param value - The new value to set for the dynamic element.
*/
@Input() set value(value: any) {
// Stores the value in the local variable for future reference.
this._value = value;
}

/**
* An @Input property used to pass data from a parent component to this component.
*
*/
@Input() rowData: any;

/**
* An output property for emitting click events.
*
* This output property emits events of type Event when a click event occurs.
*/
@Output() clicked: EventEmitter<Event> = new EventEmitter();

/**
* Handle a click event, conditionally emitting it for further processing.
*
* @param event - The click event to be handled.
*/
onClicked(event: Event) {
// Access the repository data from the component's rowData.
const repository = this.rowData.repository;

// Check if the repository data exists and has synchronization enabled.
if (!repository || !repository.hasSyncEnabled) {
return; // If repository is missing or synchronization is not enabled, exit the function.
}

// Emit the event using an EventEmitter, possibly to notify other parts of the application.
this.clicked.emit(event);
}
}
1 change: 1 addition & 0 deletions apps/gauzy/src/app/@shared/table-components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ export * from './trust-html/trust-html.component';
export * from './toggle-switch/toggle-switch.component';
export * from './github/repository/repository.component';
export * from './github/issue-title-description/issue-title-description.component';
export * from './github/resync-button/resync-button.component';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
NbIconModule,
NbTooltipModule,
NbBadgeModule,
NbToggleModule
NbToggleModule,
NbButtonModule
} from '@nebular/theme';
import { DateViewComponent } from './date-view/date-view.component';
import { IncomeExpenseAmountComponent } from './income-amount/income-amount.component';
Expand Down Expand Up @@ -47,13 +48,15 @@ import { TrustHtmlLinkComponent } from './trust-html/trust-html.component';
import { ToggleSwitchComponent } from './toggle-switch/toggle-switch.component';
import { GithubRepositoryComponent } from './github/repository/repository.component';
import { GithubIssueTitleDescriptionComponent } from './github/issue-title-description/issue-title-description.component';
import { ResyncButtonComponent } from './github/resync-button/resync-button.component';
import { StatusBadgeModule } from '../status-badge';

@NgModule({
imports: [
CommonModule,
FormsModule,
NbBadgeModule,
NbButtonModule,
NbIconModule,
NbToggleModule,
NbTooltipModule,
Expand Down Expand Up @@ -100,7 +103,8 @@ import { StatusBadgeModule } from '../status-badge';
TrustHtmlLinkComponent,
ToggleSwitchComponent,
GithubRepositoryComponent,
GithubIssueTitleDescriptionComponent
GithubIssueTitleDescriptionComponent,
ResyncButtonComponent
],
exports: [
NotesWithTagsComponent,
Expand All @@ -125,7 +129,8 @@ import { StatusBadgeModule } from '../status-badge';
TrustHtmlLinkComponent,
GithubRepositoryComponent,
ToggleSwitchComponent,
GithubIssueTitleDescriptionComponent
GithubIssueTitleDescriptionComponent,
ResyncButtonComponent
],
providers: []
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export class IntegrationListComponent extends TranslationBaseComponent implement
* @returns The description of the integration provider, or undefined if the provider is missing or not found.
*/
getProviderDescription(integration: IIntegration): string | null {
if (!integration) {
return;
}
return integration.provider ? this.providers[integration.provider]?.description : null;
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2681435

Please sign in to comment.