Skip to content

Commit

Permalink
feat: get provider, notifications together on application change
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitij-k-osmosys committed Dec 18, 2024
1 parent ed29e08 commit ff6011d
Show file tree
Hide file tree
Showing 5 changed files with 301 additions and 93 deletions.
109 changes: 100 additions & 9 deletions apps/portal/src/app/graphql/graphql.queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,30 @@ export const GetApplications = gql`
}
`;

export const GetProviders = gql`
query GetProviders($limit: Int!, $offset: Int!, $filters: [UniversalFilter!]) {
export const LoginUser = gql`
mutation LoginUser($username: String!, $password: String!) {
login(loginUserInput: { username: $username, password: $password }) {
token
}
}
`;

export const GetProvidersAndNotifications = gql`
query GetProvidersAndNotifications(
$providerLimit: Int!
$providerOffset: Int!
$providerFilters: [UniversalFilter!]
$notificationLimit: Int!
$notificationOffset: Int!
$notificationFilters: [UniversalFilter!]
) {
providers(
options: {
limit: $limit
offset: $offset
limit: $providerLimit
offset: $providerOffset
sortBy: "createdOn"
sortOrder: ASC
filters: $filters
filters: $providerFilters
}
) {
providers {
Expand All @@ -110,13 +125,89 @@ export const GetProviders = gql`
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 LoginUser = gql`
mutation LoginUser($username: String!, $password: String!) {
login(loginUserInput: { username: $username, password: $password }) {
token
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 @@ -53,8 +53,7 @@ <h2 class="p-col-12">Notifications</h2>
class="grid-dropdown"
[showClear]="false"
(onChange)="
loadNotificationsLazy({ first: 0, rows: this.pageSize });
getProvidersForSelectedApplication()
loadProvidersAndNotificationsForSelectedApplication({ first: 0, rows: this.pageSize })
"
*ngIf="applications.length !== 0"
></p-dropdown>
Expand Down
Loading

0 comments on commit ff6011d

Please sign in to comment.