A tonne of updates; site info, documentation, campaign phone numbers, soccial share buttons, and several other things
This commit is contained in:
@@ -1053,6 +1053,12 @@ create_campaigns_table() {
|
||||
"uidt": "Checkbox",
|
||||
"cdf": "true"
|
||||
},
|
||||
{
|
||||
"column_name": "show_call_count",
|
||||
"title": "Show Call Count",
|
||||
"uidt": "Checkbox",
|
||||
"cdf": "true"
|
||||
},
|
||||
{
|
||||
"column_name": "allow_email_editing",
|
||||
"title": "Allow Email Editing",
|
||||
@@ -1217,6 +1223,91 @@ create_campaign_emails_table() {
|
||||
create_table "$base_id" "influence_campaign_emails" "$table_data" "Campaign email tracking"
|
||||
}
|
||||
|
||||
# Function to create the call logs table
|
||||
create_call_logs_table() {
|
||||
local base_id=$1
|
||||
|
||||
local table_data='{
|
||||
"table_name": "influence_call_logs",
|
||||
"title": "Influence Call Logs",
|
||||
"columns": [
|
||||
{
|
||||
"column_name": "id",
|
||||
"title": "ID",
|
||||
"uidt": "ID"
|
||||
},
|
||||
{
|
||||
"column_name": "representative_name",
|
||||
"title": "Representative Name",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "representative_title",
|
||||
"title": "Representative Title",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "phone_number",
|
||||
"title": "Phone Number",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "office_type",
|
||||
"title": "Office Type",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "caller_name",
|
||||
"title": "Caller Name",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "caller_email",
|
||||
"title": "Caller Email",
|
||||
"uidt": "Email",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "postal_code",
|
||||
"title": "Postal Code",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "campaign_id",
|
||||
"title": "Campaign ID",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "campaign_slug",
|
||||
"title": "Campaign Slug",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "caller_ip",
|
||||
"title": "Caller IP",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "called_at",
|
||||
"title": "Called At",
|
||||
"uidt": "DateTime",
|
||||
"rqd": false
|
||||
}
|
||||
]
|
||||
}'
|
||||
|
||||
create_table "$base_id" "influence_call_logs" "$table_data" "Phone call tracking logs"
|
||||
}
|
||||
|
||||
# Function to create the users table
|
||||
create_users_table() {
|
||||
local base_id="$1"
|
||||
@@ -1337,6 +1428,7 @@ update_env_with_table_ids() {
|
||||
local campaigns_table_id=$5
|
||||
local campaign_emails_table_id=$6
|
||||
local users_table_id=$7
|
||||
local call_logs_table_id=$8
|
||||
|
||||
print_status "Updating .env file with NocoDB project and table IDs..."
|
||||
|
||||
@@ -1371,6 +1463,7 @@ update_env_with_table_ids() {
|
||||
update_env_var "NOCODB_TABLE_CAMPAIGNS" "$campaigns_table_id"
|
||||
update_env_var "NOCODB_TABLE_CAMPAIGN_EMAILS" "$campaign_emails_table_id"
|
||||
update_env_var "NOCODB_TABLE_USERS" "$users_table_id"
|
||||
update_env_var "NOCODB_TABLE_CALLS" "$call_logs_table_id"
|
||||
|
||||
print_success "Successfully updated .env file with all table IDs"
|
||||
|
||||
@@ -1384,6 +1477,7 @@ update_env_with_table_ids() {
|
||||
print_status "NOCODB_TABLE_CAMPAIGNS=$campaigns_table_id"
|
||||
print_status "NOCODB_TABLE_CAMPAIGN_EMAILS=$campaign_emails_table_id"
|
||||
print_status "NOCODB_TABLE_USERS=$users_table_id"
|
||||
print_status "NOCODB_TABLE_CALLS=$call_logs_table_id"
|
||||
}
|
||||
|
||||
|
||||
@@ -1484,8 +1578,15 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create call logs table
|
||||
CALL_LOGS_TABLE_ID=$(create_call_logs_table "$BASE_ID")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
print_error "Failed to create call logs table"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate all table IDs were created successfully
|
||||
if ! validate_table_ids "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID"; then
|
||||
if ! validate_table_ids "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID" "$CALL_LOGS_TABLE_ID"; then
|
||||
print_error "One or more table IDs are invalid"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1506,6 +1607,7 @@ main() {
|
||||
table_mapping["influence_campaigns"]="$CAMPAIGNS_TABLE_ID"
|
||||
table_mapping["influence_campaign_emails"]="$CAMPAIGN_EMAILS_TABLE_ID"
|
||||
table_mapping["influence_users"]="$USERS_TABLE_ID"
|
||||
table_mapping["influence_call_logs"]="$CALL_LOGS_TABLE_ID"
|
||||
|
||||
# Get source table information
|
||||
local source_tables_response
|
||||
@@ -1557,6 +1659,7 @@ main() {
|
||||
print_status " - influence_campaigns (ID: $CAMPAIGNS_TABLE_ID)"
|
||||
print_status " - influence_campaign_emails (ID: $CAMPAIGN_EMAILS_TABLE_ID)"
|
||||
print_status " - influence_users (ID: $USERS_TABLE_ID)"
|
||||
print_status " - influence_call_logs (ID: $CALL_LOGS_TABLE_ID)"
|
||||
|
||||
# Automatically update .env file with new project ID
|
||||
print_status ""
|
||||
@@ -1579,7 +1682,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Update .env file with table IDs
|
||||
update_env_with_table_ids "$BASE_ID" "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID"
|
||||
update_env_with_table_ids "$BASE_ID" "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID" "$CALL_LOGS_TABLE_ID"
|
||||
|
||||
print_status ""
|
||||
print_status "============================================================"
|
||||
|
||||
Reference in New Issue
Block a user