Source name
@@ -176,8 +176,8 @@ Configure Basic Auth
+ {{ getDataReadableValue('sourceType', source.type)?.viewValue }}
- {{ source.verifier.type }}
+ {{ getDataReadableValue('verifier', source.verifier.type)?.viewValue }}
|
@@ -138,7 +138,10 @@ S
-
-
+
diff --git a/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.scss b/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.scss
index 67ab3a5a9a..a7903f6c87 100644
--- a/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.scss
+++ b/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.scss
@@ -25,12 +25,16 @@ tbody {
}
}
+.table--container.smaller table {
+ tbody td:nth-of-type(4) div {
+ width: 197px;
+ }
+}
+
@media only screen and (max-device-width: 1340px) and (-webkit-min-device-pixel-ratio: 1) {
.table--container.smaller table {
tbody td:nth-of-type(4) div {
width: 100px;
- overflow: hidden;
- text-overflow: ellipsis;
}
}
}
@@ -39,8 +43,6 @@ tbody {
table {
tbody td:nth-of-type(4) div {
width: 100px;
- overflow: hidden;
- text-overflow: ellipsis;
}
}
}
diff --git a/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.ts b/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.ts
index f87bee373d..a05a358172 100644
--- a/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.ts
+++ b/web/ui/dashboard/src/app/private/pages/project/sources/sources.component.ts
@@ -12,17 +12,41 @@ import { SourcesService } from './sources.service';
styleUrls: ['./sources.component.scss']
})
export class SourcesComponent implements OnInit {
- sourcesTableHead: string[] = ['Source name', 'Source type', 'Verifier', 'URL', 'Date created', ''];
- shouldShowCreateSourceModal = this.router.url.split('/')[4] === 'new';
+ sourcesTableHead: string[] = ['Name', 'Type', 'Verifier', 'URL', 'Date created', ''];
+ shouldShowCreateSourceModal = false;
+ shouldShowUpdateSourceModal = false;
activeSource?: SOURCE;
sources!: { content: SOURCE[]; pagination: PAGINATION };
isLoadingSources = false;
projectId = this.privateService.activeProjectDetails.uid;
+ sourceTypes = [
+ { value: 'http', viewValue: 'http' },
+ { value: 'rest_api', viewValue: 'Rest API' },
+ { value: 'pub_sub', viewValue: 'Pub/Sub' },
+ { value: 'db_change_stream', viewValue: 'Database' }
+ ];
+ httpTypes = [
+ { value: 'hmac', viewValue: 'HMAC' },
+ { value: 'basic_auth', viewValue: 'Basic Auth' },
+ { value: 'api_key', viewValue: 'API Key' }
+ ];
constructor(private route: ActivatedRoute, private router: Router, private sourcesService: SourcesService, public privateService: PrivateService, private generalService: GeneralService) {
- this.route.queryParams.subscribe(params => {
- this.activeSource = this.sources?.content.find(source => source.uid === params?.id);
- });
+ this.route.queryParams.subscribe(params => (this.activeSource = this.sources?.content.find(source => source.uid === params?.id)));
+
+ const urlParam = route.snapshot.params.id;
+ if (urlParam && urlParam === 'new') this.shouldShowCreateSourceModal = true;
+ if (urlParam && urlParam !== 'new') this.shouldShowUpdateSourceModal = true;
+ }
+
+ getDataReadableValue(type: 'sourceType' | 'verifier', value: string): { value: string; viewValue: string } | null {
+ if (type === 'sourceType') {
+ return this.sourceTypes.find(source => source.value === value)!;
+ }
+ if (type === 'verifier') {
+ return this.httpTypes.find(source => source.value === value)!;
+ }
+ return null;
}
ngOnInit() {
@@ -55,7 +79,7 @@ export class SourcesComponent implements OnInit {
}
closeCreateSourceModal() {
- this.generalService.showNotification({ message: 'Source created successfully', style: 'success' });
+ this.generalService.showNotification({ message: `Source ${this.shouldShowUpdateSourceModal ? 'updat' : 'creat'}ed successfully`, style: 'success' });
this.router.navigateByUrl('/projects/' + this.projectId + '/sources');
}
diff --git a/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.html b/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.html
index 3b9ed31dd3..6faf0fb789 100644
--- a/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.html
+++ b/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.html
@@ -232,7 +232,7 @@ {
-
+
diff --git a/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.ts b/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.ts
index 9f1c26e288..ea3674e99a 100644
--- a/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.ts
+++ b/web/ui/dashboard/src/app/private/pages/project/subscriptions/subscriptions.component.ts
@@ -13,23 +13,25 @@ import { SubscriptionsService } from './subscriptions.service';
})
export class SubscriptionsComponent implements OnInit {
activeSubscription?: SUBSCRIPTION;
- shouldShowCreateSubscriptionModal = this.router.url.split('/')[4] === 'new';
+ shouldShowCreateSubscriptionModal = false;
projectId!: string;
subscriptions!: { content: SUBSCRIPTION[]; pagination: PAGINATION };
subscriptionsLoaders = [1, 2, 3, 4, 5];
isLoadindingSubscriptions = false;
isDeletingSubscription = false;
- showUpdateSubscription = false;
+ showUpdateSubscriptionModal = false;
constructor(private route: ActivatedRoute, public privateService: PrivateService, private router: Router, private subscriptionsService: SubscriptionsService, private generalService: GeneralService) {
+ this.route.queryParams.subscribe(params => (this.activeSubscription = this.subscriptions?.content.find(source => source.uid === params?.id)));
this.projectId = this.privateService.activeProjectDetails.uid;
- this.showUpdateSubscription = !!route.snapshot.params.id;
+
+ const urlParam = route.snapshot.params.id;
+ if (urlParam && urlParam === 'new') this.shouldShowCreateSubscriptionModal = true;
+ if (urlParam && urlParam !== 'new') this.showUpdateSubscriptionModal = true;
}
async ngOnInit() {
await this.getSubscriptions();
-
- this.route.queryParams.subscribe(params => (this.activeSubscription = this.subscriptions?.content.find(source => source.uid === params?.id)));
}
async getSubscriptions(requestDetails?: { page?: number }) {
diff --git a/web/ui/dashboard/src/index.html b/web/ui/dashboard/src/index.html
index 4e139ebc43..e4f0c4f61f 100644
--- a/web/ui/dashboard/src/index.html
+++ b/web/ui/dashboard/src/index.html
@@ -62,10 +62,10 @@
-
-
-
-
+
+
+
+
|