This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* BarcodeGenerator.css */ | |
.THIS { | |
font-family: 'Arial', sans-serif; | |
max-width: 400px; | |
margin: 0 auto; | |
text-align: center; | |
padding: 20px; | |
border-radius: 10px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
validateBarcodeInput: function(barcodeValue, selectedFormat) { | |
// Check if the barcodeValue is empty | |
if (!barcodeValue || barcodeValue.trim() === '') { | |
return { success: false, errorMessage: "Barcode value cannot be empty.", checksum: "" }; | |
} | |
// Perform additional validation based on selected format | |
switch(selectedFormat) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
generateBarcode : function(component, event, helper) { | |
// Reset previous barcode output | |
component.set("v.barcodeGenerated", false); | |
// Get the barcode value and selected format | |
var barcodeValue = component.get("v.barcodeValue"); | |
var selectedFormat = component.get("v.selectedFormat"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component> | |
<ltng:require scripts="{!$Resource.Barcode + '/Barcode/JsBarcode.all.min.js'}"/> | |
<aura:attribute name="barcodeValue" type="String" /> | |
<aura:attribute name="selectedFormat" type="String" default="CODE128" /> | |
<aura:attribute name="barcodeGenerated" type="Boolean" default="false" /> | |
<aura:attribute name="errorMessage" type="String" /> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<apiVersion>59.0</apiVersion> | |
<isExposed>true</isExposed> | |
<targets> | |
<target>lightning__HomePage</target> | |
<target>lightning__RecordPage</target> | |
<target>lightningCommunity__Page</target> | |
<target>lightningCommunity__Default</target> | |
</targets> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, body { | |
min-height: 100%; | |
padding: 0; | |
margin: 0; | |
font-family: Roboto, Arial, sans-serif; | |
font-size: 14px; | |
color: #666; | |
} | |
h1 { | |
margin: 0 0 20px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.shadow-box { | |
box-shadow: 0 0 2px #0176d3; | |
margin-bottom: 5px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement, track } from 'lwc'; | |
import pullMessages from '@salesforce/apex/GoogleCloudPubSubService.pullMessages'; | |
export default class Cloud_Pub_Sub extends LightningElement { | |
@track messages = []; | |
getMessages() { | |
console.log('onclick'); | |
try { | |
pullMessages() | |
.then(result => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="slds-card"> | |
<div class="slds-card__header slds-grid"> | |
<header class="slds-media slds-media_center slds-has-flexi-truncate"> | |
<div class="slds-media__body"> | |
<h2 class="slds-card__header-title"> | |
<a href="#" class="slds-card__header-link slds-truncate" title="Data From Website"> | |
<span>Data From Website</span> | |
</a> | |
</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class GoogleCloudPubSubService { | |
// AuraEnabled annotation makes the method available to Lightning components | |
public static String Endpoint ='https://pubsub.googleapis.com/v1/<Replace with Your Subscription Name>:'; | |
public static String token = 'Bearer ' + '<Replace with your Generated token>'; | |
@AuraEnabled | |
public static List<Map<String, Object>> pullMessages() { | |
// Initialize a map to hold the response body | |
Map<String, Object> responseBody = new Map<String, Object>(); | |
// Initialize a list to hold the processed messages data | |
List<Map<String, Object>> messagesData = new List<Map<String, Object>>(); |
NewerOlder