Skip to content

Commit

Permalink
Remove Stripe/Slack/Canvas from codebase and db (#1620)
Browse files Browse the repository at this point in the history
* Added migration to remove intercom col from waitinglist tbl.

* Removed slack code refs from client-participation.

* Removed slack code refs from server.

* Added SQL migration to remove slack features from database.

* Removed Stripe related code refs from server.

* Added SQL migration to remove Stripe features from database.

* remove stripe/coupon/plan migrations entirely;
DROP IF EXISTS

* remove remaining plans/stripe/trial from client-participation

* remove remaining plans/stripe/trial from server

* DROP COLUMN IF EXISTS

* remove slack from db up migrations

* Removed Canvas LMS related code refs from server.

* Added SQL migration to remove Canvas LMS features from database.

* remove remaining LTI code

* remove LTI/Canvas up migrations;
use DROP TABLE IF EXISTS in down migration

* consolidate new DROP migrations into one file

* add migration to readme

* remove old/inaccurate comment

---------

Co-authored-by: Patrick Connolly <[email protected]>
Co-authored-by: Christopher Small <[email protected]>
  • Loading branch information
3 people authored Mar 5, 2023
1 parent 914d7ba commit 683a75f
Show file tree
Hide file tree
Showing 25 changed files with 153 additions and 3,294 deletions.
27 changes: 0 additions & 27 deletions client-participation/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,10 @@ window.addEventListener("message", function(event) {
// check for token within URL
if (p.match(/^\/inbox\//) ||
p.match(/^\/settings\/ep1_[A-Za-z0-9]+/) ||
p.match(/^\/settings\/enterprise\/ep1_[A-Za-z0-9]+/) ||
p.match(/^\/conversation\/create\//) ||
p.match(/^\/[0-9][A-Za-z0-9]+\/ep1_[A-Za-z0-9]+/)
) {
// expecting params (added to support LTI)
var params = Utils.decodeParams(encodedParams);
if (params.xPolisLti) {
token = params.xPolisLti;
window.authenticatedByHeader = true;
}
if (params.context) {
window.context = params.context;
}
Expand Down Expand Up @@ -285,27 +279,6 @@ Handlebars.registerHelper('inboxHref', function(arg0, options) {
});



Handlebars.registerHelper("trialDaysRemaining", function(arg0, options) {
return Utils.trialDaysRemaining();
});
Handlebars.registerHelper("ifTrial", function(arg0) {
return Utils.isTrialUser() ? arg0.fn(this) : "";
});
Handlebars.registerHelper("ifIndividual", function(arg0) {
return Utils.isIndividualUser() ? arg0.fn(this) : "";
});
Handlebars.registerHelper("ifStudent", function(arg0) {
return Utils.isStudentUser() ? arg0.fn(this) : "";
});
Handlebars.registerHelper("ifParticipantPays", function(arg0) {
return Utils.isPpUser() ? arg0.fn(this) : "";
});
Handlebars.registerHelper("ifEnterprise", function(arg0) {
return Utils.isEnterpriseUser() ? arg0.fn(this) : "";
});


Handlebars.registerHelper("ifDebugCommentProjection", function(arg0) {
return Utils.debugCommentProjection ? arg0.fn(this) : "";
});
Expand Down
56 changes: 0 additions & 56 deletions client-participation/js/routers/main-polis-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ var metric = require("../util/gaMetric");
var ParticipantModel = require("../models/participant");
var ParticipationView = require("../views/participation");
var PolisStorage = require("../util/polisStorage");
var PlanUpgradeView = require("../views/plan-upgrade");
var preloadHelper = require("../util/preloadHelper");
var RootView = require("../views/root");
var Constants = require("../util/constants");

var SettingsEnterpriseView = require("../views/settingsEnterprise.js");
var SettingsView = require("../views/settings.js");

var UserModel = require("../models/user");
Expand Down Expand Up @@ -64,7 +61,6 @@ var polisRouter = Backbone.Router.extend({
this.r(/^demo\/([0-9][0-9A-Za-z]+)/, "demoConversation");

this.r(/^settings(\/ep1_[0-9A-Za-z]+)?/, "settings");
this.r(/^settings\/enterprise(\/ep1_[0-9A-Za-z]+)?/, "settingsEnterprise");

//this.r(/^summary\/([0-9][0-9A-Za-z]+)$/, "summaryView"); // summary/conversation_id

Expand Down Expand Up @@ -102,32 +98,6 @@ var polisRouter = Backbone.Router.extend({
});
},

upgradePlan: function(plan_id) {
var promise;
if (!authenticated()) {
window.planId = plan_id;
promise = this.doLogin(false);
} else if (!hasEmail() && !window.authenticatedByHeader) {
window.planId = plan_id;
promise = this.doLogin(true);
} else {
if (_.isUndefined(plan_id) && !_.isUndefined(window.plan_id)) {
plan_id = window.planId;
}
promise = $.Deferred().resolve();
}
promise.then(function() {
var userModel = new UserModel();
bbFetch(userModel).then(function() {
var view = new PlanUpgradeView({
model: userModel,
plan_id: plan_id,
});
RootView.getInstance().setView(view);
});
});
},

landingPageView: function() {
console.log('landingPageView');
if (!authenticated()) {
Expand Down Expand Up @@ -168,32 +138,6 @@ var polisRouter = Backbone.Router.extend({
});
},

settingsEnterprise: function(encodedStringifiedJson) {
var o = {};
if (encodedStringifiedJson && encodedStringifiedJson.length) {
o = Utils.decodeParams(encodedStringifiedJson);
}
// alert(o.monthly);
// alert(o.maxUsers);
var promise = $.Deferred().resolve();
if (!authenticated()) {
promise = this.doLogin(false);
} else if (!hasEmail() && !window.authenticatedByHeader) {
promise = this.doLogin(true);
}
promise.then(function() {
var userModel = new UserModel();
bbFetch(userModel).then(function() {
var v = new SettingsEnterpriseView({
model: userModel,
proposal: o
});
RootView.getInstance().setView(v);
});
});
},


deregister: function(dest) {
window.deregister(dest);
},
Expand Down
3 changes: 0 additions & 3 deletions client-participation/js/stores/polis.js
Original file line number Diff line number Diff line change
Expand Up @@ -2098,7 +2098,6 @@ module.exports = function(params) {
var numComments = pcaCenter.length;
var numVotes = o.votes.length;

// https://files.slack.com/files-pri/T02G773HK-F02N30MKD/slack_for_ios_upload.jpg
if (numVotes > 0 && (o.pid !== -1 || USE_JETPACK_FOR_SELF)) {
var jetpack_aka_sparsity_compensation_factor = Math.sqrt(numComments / numVotes);
x *= jetpack_aka_sparsity_compensation_factor;
Expand Down Expand Up @@ -2427,8 +2426,6 @@ module.exports = function(params) {

var numComments = pcaCenter.length;

// https://files.slack.com/files-pri/T02G773HK-F02N30MKD/slack_for_ios_upload.jpg

var numVotes = 1; // pretend the comment is a person who voted for only itself
var jetpack_aka_sparsity_compensation_factor = Math.sqrt(numComments / numVotes);

Expand Down
77 changes: 0 additions & 77 deletions client-participation/js/templates/plan-upgrade.handlebars

This file was deleted.

71 changes: 0 additions & 71 deletions client-participation/js/templates/settings.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -63,77 +63,6 @@

{{view settingsTwitter}}

<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title HeadingB">Plan</h3>
</div>
<div class="panel-body">
{{#ifTrial}}
<div class="Notification Notification--warning" role="alert">
<i class="fa fa-bell-o"></i>&nbsp;{{> trialRemainingStatement}}
</div>
{{/ifTrial}}


<table class="table">
<thead>
<tr>
<th class="HeadingF">Plan
</th>
<th class="HeadingF">Price
</th>
<th> {{! buttons column}}
</th>
</tr>
</thead>
<tr>
<td>Individual</td>
<td>$100/month</td>
<td>
{{#ifTrial}}<form action="/api/v3/charge" method="POST" id="stripeForm"></form>
{{/ifTrial}}
{{#ifIndividual}}Your plan{{/ifIndividual}}
</td>
</tr>
{{!-- <tr>
<td>Teacher</td>
<td>Free (students will pay $3/month)</td>
<td>
{{#ifTrial}}<button id="participantsPayButton">Choose</button>
{{/ifTrial}}
{{#ifParticipantPays}}Your plan{{/ifParticipantPays}}
</td>
</tr>
<tr>
<td>Student</td>
<td>$3/month</td>
<td>
{{#ifTrial}}<form action="/api/v3/charge" method="POST" id="stripeFormStudents"></form>
{{/ifTrial}}
{{#ifStudent}}Your plan{{/ifStudent}}
</td>
</tr> --}}
<tr>
<td>Trial</td>
<td>Free for 10 days</td>
<td>
{{#ifTrial}} Your plan {{/ifTrial}}
{{#ifIndividual}} {{! should probably be a downgrade button }} {{/ifIndividual}}
</td>
</tr>
</table>
</div>
</div>

<!--This script tag should really be in the head, but for now...-->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script type="text/javascript">
// This identifies your website in the createToken call below
var stripeKey = /localhost|preprod.pol.is/.test(document.domain) ? "pk_test_x6ETDQy1aCvKnaIJ2dyYFVVj" : "pk_live_zSFep14gq0gqnVkKVp6vI9eM";
Stripe.setPublishableKey(stripeKey);
// ...
</script>


{{!
<div class="panel panel-default">
Expand Down
Loading

0 comments on commit 683a75f

Please sign in to comment.