Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix project settings #1953

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/ui/dashboard/src/app/models/endpoint.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface ENDPOINT {
status?: string;
secrets?: SECRET[];
name?: string;
url: string;
target_url: string;
updated_at: string;
rate_limit: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,48 @@ export class CreateProjectComponent implements OnInit {
try {
this.projectDetails = this.privateService.getProjectDetails;

this.setSignatureVersions();

if (this.projectDetails?.type === 'incoming') this.tabs = this.tabs.filter(tab => tab.label !== 'signature history');

this.projectForm.patchValue(this.projectDetails);
this.projectForm.get('config.strategy')?.patchValue(this.projectDetails.config.strategy);
this.projectForm.get('config.signature')?.patchValue(this.projectDetails.config.signature);
this.projectForm.get('config.ratelimit')?.patchValue(this.projectDetails.config.ratelimit);

// set meta events config
this.projectDetails.config.meta_event && this.projectDetails.config.meta_event.is_enabled
? this.projectForm.get('config.meta_event.is_enabled')?.patchValue(this.projectDetails.config.meta_event.is_enabled)
: this.projectForm.get('config.meta_event.is_enabled')?.patchValue(false);


const search_policy = this.projectDetails.config.retention_policy.search_policy.match(/\d+/g);

this.projectForm.get('config.retention_policy.search_policy')?.patchValue(search_policy);
const policy = this.projectDetails.config.retention_policy.policy.match(/\d+/g);
this.projectForm.get('config.retention_policy.policy')?.patchValue(policy);

this.projectForm.get('config.meta_event.type')?.patchValue('http');

let filteredConfigs: string[] = [];
if (this.projectDetails?.type === 'incoming') filteredConfigs.push('signature');
if (!this.projectDetails?.config.retention_policy_enabled) filteredConfigs.push('retention_policy');

this.configurations.filter(item => !filteredConfigs.includes(item.uid)).forEach(config => this.toggleConfigForm(config.uid));
} catch {}
}

const versions = this.projectDetails.config.signature.versions;
if (!versions?.length) return;
this.signatureVersions = this.generalService.setContentDisplayed(versions);
versions.forEach((version: { encoding: any; hash: any }, index: number) => {
this.addVersion();
this.versions.at(index)?.patchValue({
encoding: version.encoding,
hash: version.hash
});
setSignatureVersions() {
const versions = this.projectDetails.config.signature.versions;
if (!versions?.length) return;
this.signatureVersions = this.generalService.setContentDisplayed(versions);
versions.forEach((version: { encoding: any; hash: any }, index: number) => {
this.addVersion();
this.versions.at(index)?.patchValue({
encoding: version.encoding,
hash: version.hash
});
} catch {}
});
}

async createProject() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ <h1 class="text-18 font-bold text-neutral-12 mr-10px">Endpoints</h1>
<tr convoy-table-row *ngFor="let endpoint of endpointGroup.content; let index = index"
[id]="'endpoint' + i" class="border-b border-b-new.primary-25"
(click)="selectedEndpoint = endpoint">
<td convoy-table-cell class="w-[450px]">
<div class="truncate max-w-[440px] pl-16px">{{ endpoint.name }}</div>
<td convoy-table-cell class="w-[300px]">
<div class="truncate max-w-[290px] pl-16px">{{ endpoint.name }}</div>
</td>
<td convoy-table-cell class="w-100px">
<convoy-tag *ngIf="endpoint.status" [color]="endpoint.status | statuscolor"
Expand All @@ -79,10 +79,10 @@ <h1 class="text-18 font-bold text-neutral-12 mr-10px">Endpoints</h1>
<td convoy-table-cell class="relative">
<div convoy-tag color="gray"
class="mr-8px w-[260px] !gap-16px truncate flex items-center">
{{ endpoint.uid }}
{{ endpoint.url }}
<convoy-copy-button size="sm"
[notificationText]="endpoint.name + ' ID has been copied to clipboard'"
[text]="endpoint.uid"></convoy-copy-button>
[notificationText]="endpoint.name + ' Url has been copied to clipboard'"
[text]="endpoint.url"></convoy-copy-button>
</div>
</td>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class EndpointsComponent implements OnInit {

showCreateEndpointModal = this.router.url.split('/')[4] === 'new';
showEditEndpointModal = this.router.url.split('/')[5] === 'edit';
endpointsTableHead = ['Name', 'Status', 'ID', '', '', ''];
endpointsTableHead = ['Name', 'Status', 'Url', '', '', ''];
displayedEndpoints?: { date: string; content: ENDPOINT[] }[];
endpoints?: { pagination?: PAGINATION; content?: ENDPOINT[] };
selectedEndpoint?: ENDPOINT;
Expand Down
2 changes: 1 addition & 1 deletion web/ui/dashboard/src/app/private/private.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="bg-white-100 min-h-screen overflow-y-auto flex flex-col justify-between">
<header class="w-full border-b border-b-neutral-a3 bg-neutral-a2 fixed z-20">
<header class="w-full border-b border-b-neutral-a3 bg-neutral-a2 fixed z-[50]">
<div class="flex items-center justify-between w-full max-w-[1440px] m-auto px-24px py-12px">
<div class="flex items-center">
<a routerLink="/" rel="noreferrer">
Expand Down
2 changes: 1 addition & 1 deletion web/ui/dashboard/src/app/services/http/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class HttpService {

const requestHeader = {
Authorization: `Bearer ${this.token || this.authDetails()?.access_token}`,
'X-Convoy-Version': '2024-01-01'
'X-Convoy-Version': '2024-03-06'
};

// process URL
Expand Down
Loading