Skip to content

Instantly share code, notes, and snippets.

View arun12209's full-sized avatar
🥑

Arun Kumar arun12209

🥑
View GitHub Profile
@arun12209
arun12209 / Covid19_NewsController
Created April 5, 2020 08:33
Covid19_NewsController
({
doInit : function(component, event, helper) {
helper.fetchNewsData(component, event, helper);
}
})
@arun12209
arun12209 / Covid19_News
Created April 5, 2020 08:32
Covid19_News
<aura:component controller="Covid19_IND_TrackerController" access="global">
<aura:attribute name="newsData" type="Object"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<div class="slds-grid">
<div class="slds-col slds-size--12-of-12">
<div aura:id="new_content" style="padding:20px;">
<aura:iteration items="{!v.newsData}" var="news" >
<div class="contain" >
@arun12209
arun12209 / JsonNewsWrapper
Created April 5, 2020 08:31
JsonNewsWrapper
public class JsonNewWrapper{
@AuraEnabled
public String status;
@AuraEnabled
public Integer totalResults;
@AuraEnabled
public List<Articles> articles;
public class Articles {
@AuraEnabled
@arun12209
arun12209 / covid19DataParser
Created April 5, 2020 08:30
covid19DataParser
public class covid19DataParser {
@AuraEnabled
public List<Cases_time_series> cases_time_series;
@AuraEnabled
public List<Key_values> key_values;
@AuraEnabled
public List<Statewise> statewise;
@AuraEnabled
@arun12209
arun12209 / Covid19_IND_TrackerController
Created April 5, 2020 08:29
Covid19_IND_TrackerController
public class Covid19_IND_TrackerController {
@AuraEnabled
public static covid19DataParser fecthCovid19Data(){
string baseURL='https://api.covid19india.org/data.json';
HttpRequest reqest = new HttpRequest();
reqest.setEndpoint(baseURL);
reqest.setMethod('GET');
reqest.setHeader('Accept','application/json');
@arun12209
arun12209 / Covid19_IND_TrackerCSS
Created April 5, 2020 08:28
Covid19_IND_TrackerCSS
.THIS #one__item{
font-size:20px;
}
.THIS #two__item{
font-size:20px;
}
.THIS #three__item{
font-size:20px;
}
.THIS #four__item{
@arun12209
arun12209 / Covid19_IND_TrackerHelper
Created April 5, 2020 08:27
Covid19_IND_TrackerHelper
({
COLUMNS:[
{label: 'STATE/UT', fieldName: 'STATEUT', type: 'text'},
{label: 'CNFMD', fieldName: 'CNFMD_CASE',
type: 'number',
sortable: true,
cellAttributes: { alignment: 'left' }},
{label: 'ACTIVE', fieldName: 'ACTIVE_CASE', type: 'text'},
{label: 'RCVRD', fieldName: 'RCVRD_CASE', type: 'text'},
{label: 'DECEASED', fieldName: 'DEATH', type: 'text'}
@arun12209
arun12209 / Covid19_IND_TrackerController
Created April 5, 2020 08:26
Covid19_IND_TrackerController
({
doInit : function(component, event, helper) {
helper.fetchData(component,event,helper);
helper.setColumns(component);
helper.setData(component);
},
handleSort: function(component, event, helper) {
helper.handleSort(component, event);
},
// this function automatic call by aura:waiting event
<aura:component controller="Covid19_IND_TrackerController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="total" type="String"/>
<aura:attribute name="confirmed" type="String"/>
<aura:attribute name="active" type="String"/>
<aura:attribute name="recovered" type="String"/>
<aura:attribute name="deaths" type="String"/>
<!-- attributes -->
<aura:attribute name="sortDirection" type="String" default="asc" />
<aura:attribute name="defaultSortDirection" type="String" default="asc" />
@arun12209
arun12209 / LightningMapCntrl
Created February 21, 2020 18:05
LightningMapCntrl
public class LightningMapCntrl {
@AuraEnabled
public static List<Account> fetchAllAccounts(){
List<Account> accList = [Select Id,Name,Website,BillingCity,BillingStreet,BillingPostalCode,BillingState,BillingCountry from Account ];
return accList;
}
}