Skip to content

Commit

Permalink
hide cli keys and devices on app portal (#1184)
Browse files Browse the repository at this point in the history
* update: hide cli keys and devices on app portal

* update: hide cli keys and devices with queryparam

* update: hide intercom launcher on app portal
  • Loading branch information
Oluwadaminiola authored Nov 25, 2022
1 parent 77159ad commit 900573a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion web/ui/dashboard/src/app/public/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<convoy-page>
<h2 class="font-semibold mb-20px">App Portal</h2>
<!-- <h2 class="font-semibold mb-20px">App Portal</h2> -->

<convoy-card className="mt-24px">
<div class="flex items-center justify-center">
Expand Down
28 changes: 11 additions & 17 deletions web/ui/dashboard/src/app/public/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,31 @@ export class AppComponent implements OnInit {
isDeletingSubscription = false;
subscriptionId = this.route.snapshot.params.id;
showCreateSubscription = false;
showCliKeysAndDevices = false;
showSubscriptionError = false;
showCliError = false;
isCliAvailable: boolean = false;

constructor(private appService: AppService, private route: ActivatedRoute, private router: Router) {}

ngOnInit(): void {
ngOnInit() {

this.getSubscripions();
this.checkFlags();

if (this.route.snapshot.queryParams?.showCli) localStorage.setItem('CONVOY_APP__SHOW_CLI', this.route.snapshot.queryParams?.showCli);
if (this.route.snapshot.queryParams?.createSub) localStorage.setItem('CONVOY_APP__SHOW_CREATE_SUB', this.route.snapshot.queryParams?.createSub);
const subscribeButtonState = localStorage.getItem('CONVOY_APP__SHOW_CREATE_SUB');

switch (subscribeButtonState) {
case 'true':
this.showCreateSubscription = true;
this.tableHead.pop();
break;
case 'false':
this.showCreateSubscription = false;
break;

default:
this.showCreateSubscription = true;
break;
}

const subscribeButtonState = localStorage.getItem('CONVOY_APP__SHOW_CREATE_SUB');
subscribeButtonState ? (this.showCreateSubscription = JSON.parse(subscribeButtonState)) : (this.showCreateSubscription = false);

const showCliKeysAndDevices = localStorage.getItem('CONVOY_APP__SHOW_CLI');
showCliKeysAndDevices ? (this.showCliKeysAndDevices = JSON.parse(showCliKeysAndDevices)) : (this.showCliKeysAndDevices = false);
}

async checkFlags() {
this.isCliAvailable = await this.appService.getFlag('can_create_cli_api_key', this.token);
if (this.isCliAvailable) this.tabs.push('cli keys', 'devices');
if (this.isCliAvailable && this.showCliKeysAndDevices) this.tabs.push('cli keys', 'devices');
}

async getSubscripions() {
Expand Down
3 changes: 2 additions & 1 deletion web/ui/dashboard/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@
<script>
window.intercomSettings = {
api_base: 'https://api-iam.intercom.io',
app_id: 'a5br6kfe'
app_id: 'a5br6kfe',
hide_default_launcher: window.location.pathname.includes('/app/') ? true : false
};
</script>

Expand Down

0 comments on commit 900573a

Please sign in to comment.