示例#1
0
def add_case_callback(
    n_clicks,
    account_id,
    origin,
    reason,
    subject,
    contact_id,
    case_type,
    status,
    description,
    priority,
    current_df,
):
    if n_clicks > 0:
        query = {
            "AccountId": account_id,
            "Origin": origin,
            "Reason": reason,
            "Subject": subject,
            "ContactId": contact_id,
            "Type": case_type,
            "Status": status,
            "Description": description,
            "Priority": priority,
        }

        sf_manager.add_case(query)
        df = sf_manager.get_cases()
        return df.to_json(orient="split")

    return current_df
示例#2
0
     ),
     dcc.Store(  # finance df
         id="finance_df",
         data="data/df_actual_vs_budget.csv",
         #data=csv_manager.get_data(),
     ),
     dcc.Store(  # opportunities df
         id="opportunities_df",
         data=sf_manager.get_opportunities().to_json(orient="split"),
     ),
     dcc.Store(  # leads df
         id="leads_df",
         data=sf_manager.get_leads().to_json(orient="split")),
     dcc.Store(
         id="cases_df",
         data=sf_manager.get_cases().to_json(orient="split")),  # cases df
     dcc.Location(id="url", refresh=False),
     html.Div(id="tab_content"),
     html.Link(
         href="https://use.fontawesome.com/releases/v5.2.0/css/all.css",
         rel="stylesheet",
     ),
     html.Link(href="https://fonts.googleapis.com/css?family=Dosis",
               rel="stylesheet"),
     html.Link(href="https://fonts.googleapis.com/css?family=Open+Sans",
               rel="stylesheet"),
     html.Link(href="https://fonts.googleapis.com/css?family=Ubuntu",
               rel="stylesheet"),
 ],
 className="row",
 style={"margin": "0%"},
示例#3
0
                value="leads_tab",
            )
        ],
                 className="row tabs_div"),

        # divs that save dataframe for each tab
        html.Div(
            sf_manager.get_opportunities().to_json(
                orient="split"),  # opportunities df
            id="opportunities_df",
            style={"display": "none"},
        ),
        html.Div(sf_manager.get_leads().to_json(orient="split"),
                 id="leads_df",
                 style={"display": "none"}),  # leads df
        html.Div(sf_manager.get_cases().to_json(orient="split"),
                 id="cases_df",
                 style={"display": "none"}),  # cases df

        # Tab content
        html.Div(id="tab_content", className="row", style={"margin": "2% 3%"}),
        html.Link(
            href="https://use.fontawesome.com/releases/v5.2.0/css/all.css",
            rel="stylesheet"),
        html.Link(
            href=
            "https://cdn.rawgit.com/plotly/dash-app-stylesheets/2d266c578d2a6e8850ebce48fdb52759b2aef506/stylesheet-oil-and-gas.css",
            rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Dosis",
                  rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Open+Sans",
示例#4
0
                ],
                value="leads_tab",
            )

        ],
            className="row tabs_div"
        ),

        # divs that save dataframe for each tab
        html.Div(
            sf_manager.get_opportunities().to_json(orient="split"),  # opportunities df
            id="opportunities_df",
            style={"display": "none"},
        ),
        html.Div(sf_manager.get_leads().to_json(orient="split"), id="leads_df", style={"display": "none"}),  # leads df
        html.Div(sf_manager.get_cases().to_json(orient="split"), id="cases_df", style={"display": "none"}),  # cases df

        # Tab content
        html.Div(id="tab_content", className="row", style={"margin": "2% 3%"}),

        html.Link(href="https://use.fontawesome.com/releases/v5.2.0/css/all.css", rel="stylesheet"),
        html.Link(
            href="https://cdn.rawgit.com/plotly/dash-app-stylesheets/2d266c578d2a6e8850ebce48fdb52759b2aef506/stylesheet-oil-and-gas.css",
            rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Dosis", rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Open+Sans", rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Ubuntu", rel="stylesheet"),
        html.Link(
            href="https://cdn.rawgit.com/amadoukane96/8a8cfdac5d2cecad866952c52a70a50e/raw/cd5a9bf0b30856f4fc7e3812162c74bfc0ebe011/dash_crm.css",
            rel="stylesheet")
    ],
示例#5
0
     style={"display": "none"},
     children=[
         dcc.Link("Opportunities", href="/"),
         dcc.Link("Leads", href="/"),
         dcc.Link("Cases", href="/"),
     ],
 ),
 dcc.Store(  # opportunities df
     id="opportunities_df",
     data=sf_manager.get_opportunities().to_json(orient="split"),
 ),
 dcc.Store(  # leads df
     id="leads_df", data=sf_manager.get_leads().to_json(orient="split")
 ),
 dcc.Store(
     id="cases_df", data=sf_manager.get_cases().to_json(orient="split")
 ),  # cases df
 dcc.Location(id="url", refresh=False),
 html.Div(id="tab_content"),
 html.Link(
     href="https://use.fontawesome.com/releases/v5.2.0/css/all.css",
     rel="stylesheet",
 ),
 html.Link(
     href="https://fonts.googleapis.com/css?family=Dosis", rel="stylesheet"
 ),
 html.Link(
     href="https://fonts.googleapis.com/css?family=Open+Sans", rel="stylesheet"
 ),
 html.Link(
     href="https://fonts.googleapis.com/css?family=Ubuntu", rel="stylesheet"