Skip to content

Commit

Permalink
refactor(demo-app-web): minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Feb 22, 2024
1 parent 9bac8fe commit 42293c4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ template.innerHTML = `
:host .card.apis .card-actions button {
margin-left: 14px;
}
@media only screen and (max-width: 600px) {
:host .card.apis .card-actions {
flex-direction: column;
}
:host .card.apis .card-actions button {
margin-top: 12px;
margin-left: 0;
padding: 2px 10px;
min-width: 104px;
align-self: flex-start;
}
:host .card.apis .input label {
text-align: left;
}
:host .card.apis .input {
flex-direction: column;
align-items: flex-start;
gap: 10px;
}
:host .card.apis input {
width: inherit;
align-self: normal;
}
}
</style>
<div class="card apis">
Expand Down
11 changes: 8 additions & 3 deletions projects/demo-app/web/ngx-auth/src/app/demo/demo.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@

.route {
&.query-params {
margin: 14px 0 10px 10px;
margin: 14px 0 10px 0;

.info {
width: 100%;
display: flex;
flex-direction: column;
flex: 1;
text-align: center;

input {
width: 70%;
width: inherit;
align-self: normal;
}
}
}
Expand Down
18 changes: 10 additions & 8 deletions projects/demo-app/web/ngx-auth/src/app/demo/demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ export class DemoComponent implements AfterViewInit {
const settings = window.appSettings.getCurrentUserSettings().otherSettings;
this.roles = settings?.['roles'] as string;
this.queryParams = settings?.['queryParams'] as Params;
let queryParamsString = '';
Object.entries(this.queryParams).forEach(([key, value], index) => {
if (index > 0) {
queryParamsString += '&';
}
queryParamsString += `${key}=${value}`;
});
this.queryParamsInputEl.nativeElement.value = queryParamsString;
if (this.queryParams) {
let queryParamsString = '';
Object.entries(this.queryParams).forEach(([key, value], index) => {
if (index > 0) {
queryParamsString += '&';
}
queryParamsString += `${key}=${value}`;
});
this.queryParamsInputEl.nativeElement.value = queryParamsString;
}
});
}

Expand Down

0 comments on commit 42293c4

Please sign in to comment.