Base solution for your next web application

Activities of "maberry"

InvoiceNotificationAsync method is located in the AppNotifer file.

The method is being called from the HostAccountAppService file at the end of the update method.

Mass notifications and "regular" notifications are stored in the same DB table. The table has a CreatorUserId field. If I create a mass notification the CreatorUserId is populated; however, the field is null if I create a "regular" in app notification. Am I doing something wrong, or is this the expected behavior? If it is the expected behavior, how can I get the CreatorUserId saved when creating all notification types?

    public async Task InvoiceNotificationAsync(Vendor vendor, string hostName, long userId, string userName)
    {
        Logger.Warn($"InvoiceRequestNotificationAsync called");

        var vendorTenantId = 1073;

        var notificationData = new LocalizableMessageNotificationData(
            new LocalizableString(
                "message",
                ERAConsts.LocalizationSourceName
            )
        );

        notificationData["hostName"] = hostName;
        notificationData["recordId"] = vendor.Id;
        notificationData["recordType"] = "vendor";
        notificationData["htmlCheck"] = "Yes";
        notificationData["TenantName"] = vendor.TenantName;
        notificationData["userId"] = userId;
        notificationData["userName"] = userName;

        notificationData["OrderNumber"] = vendor.OrderNumber;
        notificationData["InvoiceRequestDate"] = vendor.InvoiceRequestDate;

        await CurrentUnitOfWork.SaveChangesAsync();

        await _notificationPublisher.PublishAsync(AppNotificationNames.InvoiceRequested, notificationData,
                severity: NotificationSeverity.Warn, 
            tenantIds: new int?[] { vendorTenantId });                
    }

END GOAL

Scenario: User1 creates an order, which triggers a notification to inform User2 a task needs to be completed. User1 then realizes the order needs to be modified so he/she cancels the order. The task is removed from User2's view; however, the notification remains. I've been trying to figure out how to delete the notification when User1 cancels the order. I found this method:

    public async Task<GetPublishedNotificationsOutput> GetNotificationsPublishedByUser(
        GetPublishedNotificationsInput input)
    {
        return new GetPublishedNotificationsOutput(
            await _notificationStore.GetNotificationsPublishedByUserAsync(AbpSession.ToUserIdentifier(),
                AppNotificationNames.MassNotification, input.StartDate, input.EndDate)
        );
    }

I created a copy and changed AppNotificationNames.MassNotification to AppNotificationNames.InvoiceRequested, but then I realized the CreatorUserId is not saved.

What is the best way to set up a publicly available form in my multi-tenant application?

Version 12.3 Angular 16.1.2 Typescript 5.1.6

Once it is set up as public, if I understand correctly people could access the page via www.tenant1.myApplication.com/request where tenant1 is the name of the tenant, request is the name of the component, and myApplication is the domain. Is that correct?

Thanks,

Steven

Question

I am using the built in message service when initiating an html to PDF generation. The confirmation dialog does not close until the PDF has been generated. How can I force it to close after confirming so my user is not sitting there waiting for five seconds?

I am using the latest version of aspnetzero Angular and jsPDF and html2canvas to convert html to PDF.

    onGeneratePDF() {

        if (this.paymentInstaller.paymentStatus === PaymentStatusEnum.InvoiceSent) {
            this.message.confirm(
                '',
                this.l('pdfConfirmation'),
                (isConfirmed) => {
                    if (isConfirmed) {
                        this.generatePDF();
                    }
                }
            );
        }
    }


        async generatePDF() {
        const elementToPrint = this.pdfContent.nativeElement;
        this.fileName = this.invoiceNumber + '.pdf';
        const options = {
            margin: 36,
            filename: this.fileName,
            image: { type: 'jpeg', quality: 1 },
            html2canvas: { scale: 3 },
            jsPDF: { unit: 'pt', format: 'letter', orientation: 'portrait' }
        };

        let pdfData = await html2pdf().set(options).from(elementToPrint).toPdf().output('arraybuffer');

        // Convert the array buffer to a Blob
        const pdfBlob1 = new Blob([pdfData], { type: 'application/pdf' });

        this.uploadAndSave(pdfBlob1);
    }

    uploadAndSave(pdfBlob1: Blob) {
        // Convert the Uint8Array to a Blob
        const pdfBlob = new Blob([pdfBlob1], { type: 'application/pdf' });

        // Create a File object from the Blob
        const pdfFile = new File([pdfBlob], this.fileName, { type: 'application/pdf' });

        // Initialize the uploader and save the generated invoice
        this.invoiceFileUploader = this.initializeUploader(
            AppConsts.remoteServiceBaseUrl + '/GeneratedInvoices/UploadinvoiceFile',
            (fileToken) => {
                this.saveGeneratedInvoice(fileToken);
            }
        );

        this.invoiceFileUploader.clearQueue();
        this.invoiceFileUploader.addToQueue([pdfFile]);
        this.invoiceFileUploader.uploadAll();
    }

Answer

Thanks for the response. I have already modified the theme so the "aside" provides the navigation. I would like to project the sub-menu content (in red below) to where the top-bar-menu (in green) would "normally" be placed.

Question

I am using the most current version of AspNetZero / Angular with the current version of Metronic.

I created a new theme using a copy of Theme 6. Theme 6 has an aside menu, but it is not populated by default. I modified my new theme (themeX) so the "aside" provides the navigation, and I am only using the top-bar-menu in small screen/mobile situations.

I would like to project the <sub-menu> to where the <top-bar-menu> would "normally" be placed. I tried several things that have worked in past applications that were not aspnetzero, but I guess the framework does not make it as easy as it should be.

Can you please tell me what code should be put in my themeX-layout-component.html to project the <sub-menu> from the active page's html to the themeX header?

Do you still not have a "viable resolution" to this issue?

Is it possible to get an update? I continue to have this issue.

Hi @maberry

We have sent you an email but didn't get a reply. Could you check your spam folder ?

Thanks,

Hi - Do you have an update? I replied to your email two weeks ago.

Hi @maberry

We have sent you an email but didn't get a reply. Could you check your spam folder ?

Thanks,

Hi - Do you have an update? I replied to your email two weeks ago.

Showing 1 to 10 of 19 entries