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

feat: log out of portal when no JWTLoginToken exist in localstorage #383

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
118 changes: 118 additions & 0 deletions apps/portal/src/app/graphql/graphql.queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,121 @@ export const LoginUser = gql`
}
}
`;

export const GetProvidersAndNotifications = gql`
query GetProvidersAndNotifications(
$providerLimit: Int!
$providerOffset: Int!
$providerFilters: [UniversalFilter!]
$notificationLimit: Int!
$notificationOffset: Int!
$notificationFilters: [UniversalFilter!]
) {
providers(
options: {
limit: $providerLimit
offset: $providerOffset
sortBy: "createdOn"
sortOrder: ASC
filters: $providerFilters
}
) {
providers {
applicationId
channelType
createdOn
name
providerId
status
updatedOn
}
total
offset
limit
}
notifications(
options: {
limit: $notificationLimit
offset: $notificationOffset
sortBy: "createdOn"
sortOrder: DESC
filters: $notificationFilters
}
) {
notifications {
channelType
createdBy
createdOn
data
deliveryStatus
id
result
status
updatedBy
updatedOn
}
total
offset
limit
}
}
`;

export const GetProvidersAndArchivedNotifications = gql`
query GetProvidersAndArchivedNotifications(
$providerLimit: Int!
$providerOffset: Int!
$providerFilters: [UniversalFilter!]
$notificationLimit: Int!
$notificationOffset: Int!
$notificationFilters: [UniversalFilter!]
) {
providers(
options: {
limit: $providerLimit
offset: $providerOffset
sortBy: "createdOn"
sortOrder: ASC
filters: $providerFilters
}
) {
providers {
applicationId
channelType
createdOn
name
providerId
status
updatedOn
}
total
offset
limit
}
archivedNotifications(
options: {
limit: $notificationLimit
offset: $notificationOffset
sortBy: "createdOn"
sortOrder: DESC
filters: $notificationFilters
}
) {
archivedNotifications {
channelType
createdBy
createdOn
data
deliveryStatus
notificationId
result
status
updatedBy
updatedOn
}
total
offset
limit
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface GetApplicationsResponse {
export class ApplicationsService {
constructor(private graphqlService: GraphqlService) {}

getApplications(variables, inputToken): Observable<ApplicationResponse> {
getApplications(variables: unknown, inputToken: string): Observable<ApplicationResponse> {
return this.graphqlService.query(GetApplications, variables, inputToken).pipe(
map((response: ApolloQueryResult<GetApplicationsResponse>) => {
const applicationArray = response.data?.applications.applications;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ <h2 class="p-col-12">Notifications</h2>
<div class="p-grid">
<div class="p-col-12 p-md-3 filter-row">
<p-dropdown
[options]="channelTypes"
[(ngModel)]="selectedChannelType"
placeholder="Select a Channel Type"
[options]="providers"
[(ngModel)]="selectedProvider"
placeholder="Select a Provider"
class="grid-dropdown"
[showClear]="true"
(onChange)="loadNotificationsLazy({ first: 0, rows: this.pageSize })"
Expand Down Expand Up @@ -52,7 +52,9 @@ <h2 class="p-col-12">Notifications</h2>
placeholder="Select an Application"
class="grid-dropdown"
[showClear]="false"
(onChange)="loadNotificationsLazy({ first: 0, rows: this.pageSize })"
(onChange)="
loadProvidersAndNotificationsForSelectedApplication({ first: 0, rows: this.pageSize })
"
*ngIf="applications.length !== 0"
></p-dropdown>
</div>
Expand Down
Loading
Loading