-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3746 from ColoredCow/master
[Release]: 4 Nov
- Loading branch information
Showing
23 changed files
with
498 additions
and
101 deletions.
There are no files selected for viewing
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
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
36 changes: 36 additions & 0 deletions
36
Modules/Prospect/Database/Migrations/2024_10_25_220553_prospect-insights.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class ProspectInsights extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('prospect_insights', function (Blueprint $table) { | ||
$table->bigIncrements('id'); | ||
$table->unsignedBigInteger('prospect_id'); | ||
$table->integer('user_id')->unsigned(); | ||
$table->longText('insight_learning'); | ||
$table->timestamps(); | ||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); | ||
$table->foreign('prospect_id')->references('id')->on('prospects')->onDelete('cascade'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('prospect_insights'); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
Modules/Prospect/Database/Migrations/2024_10_28_221259_added-client-id-project-name.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddedClientIdProjectName extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('prospects', function (Blueprint $table) { | ||
$table->unsignedBigInteger('client_id')->nullable(); | ||
$table->string('project_name')->nullable(); | ||
$table->string('organization_name')->nullable()->change(); | ||
|
||
$table->foreign('client_id')->references('id')->on('clients'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('prospects', function (Blueprint $table) { | ||
$table->dropForeign(['client_id']); | ||
$table->dropColumn('client_id'); | ||
$table->dropColumn('project_name'); | ||
$table->string('organization_name')->nullable(false)->change(); | ||
}); | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Modules\Prospect\Entities; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Modules\User\Entities\User; | ||
|
||
class ProspectInsight extends Model | ||
{ | ||
protected $fillable = []; | ||
|
||
protected $table = 'prospect_insights'; | ||
|
||
public function prospect() | ||
{ | ||
return $this->belongsTo(Prospect::class); | ||
} | ||
|
||
public function user() | ||
{ | ||
return $this->belongsTo(User::class); | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const CUSTOMER_TYPES = { | ||
NEW: 'new', | ||
EXISTING: 'existing', | ||
DORMANT: 'dormant' | ||
}; | ||
document.addEventListener('DOMContentLoaded', function () { | ||
const customerTypeField = document.getElementById('customer_type'); | ||
const orgNameTextField = document.getElementById('org_name_text_field'); | ||
const orgNameSelectField = document.getElementById('org_name_select_field'); | ||
const orgNameTextInput = document.getElementById('org_name'); | ||
const orgNameSelectInput = document.getElementById('org_name_select'); | ||
|
||
function toggleOrgNameField() { | ||
if (customerTypeField.value === CUSTOMER_TYPES.NEW) { | ||
orgNameTextField.classList.remove('d-none'); | ||
orgNameSelectField.classList.add('d-none'); | ||
orgNameTextInput.required = true; | ||
orgNameSelectInput.value = ''; | ||
orgNameSelectInput.required = false; | ||
} else if (customerTypeField.value === CUSTOMER_TYPES.EXISTING) { | ||
orgNameTextField.classList.add('d-none'); | ||
orgNameSelectField.classList.remove('d-none'); | ||
orgNameSelectInput.required = true; | ||
orgNameTextInput.required = false; | ||
orgNameTextInput.value = null; | ||
} else { | ||
orgNameTextField.classList.remove('d-none'); | ||
orgNameSelectField.classList.add('d-none'); | ||
orgNameTextInput.required = true; | ||
orgNameSelectInput.value = ''; | ||
orgNameSelectInput.required = false; | ||
} | ||
} | ||
|
||
toggleOrgNameField(); | ||
|
||
customerTypeField.addEventListener('change', toggleOrgNameField); | ||
}); |
Oops, something went wrong.