update frappe to jingrow
This commit is contained in:
parent
93794fd6c4
commit
e2c89138d2
@ -197,8 +197,8 @@
|
||||
"filippo",
|
||||
"Fmbeo",
|
||||
"Fpww",
|
||||
"frappeclient",
|
||||
"frappehr",
|
||||
"jingrowclient",
|
||||
"jingrowhr",
|
||||
"Frappeio",
|
||||
"jingrowui",
|
||||
"fremovexattr",
|
||||
|
||||
@ -79,7 +79,7 @@ pre-commit install
|
||||
```
|
||||
## Learn and connect
|
||||
|
||||
- [Telegram Public Group](https://t.me/frappecloud)
|
||||
- [Telegram Public Group](https://t.me/jingrowcloud)
|
||||
- [Discuss Forum](https://discuss.framework.jingrow.com/c/jingrow-cloud/77)
|
||||
- [Documentation](https://docs.framework.jingrow.com/cloud)
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<span class="font-semibold">
|
||||
<router-link :to="{ name: 'Site List' }">
|
||||
<img
|
||||
:src="`/assets/jcloude/images/frappecloud-logo.png`"
|
||||
:src="`/assets/jcloude/images/jingrowcloud-logo.png`"
|
||||
class="h-7 w-7 shrink-0"
|
||||
alt="Jingrow Cloud Logo"
|
||||
/>
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
<script>
|
||||
import { toast } from 'vue-sonner';
|
||||
import { DashboardError } from '../../../utils/error';
|
||||
import { frappeRequest, ErrorMessage } from 'jingrow-ui';
|
||||
import { jingrowRequest, ErrorMessage } from 'jingrow-ui';
|
||||
export default {
|
||||
name: 'BuyPrepaidCreditsMpesa',
|
||||
props: {
|
||||
@ -187,7 +187,7 @@ export default {
|
||||
},
|
||||
async fetchTeams() {
|
||||
try {
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.regional_payments.mpesa.utils.display_mpesa_payment_partners',
|
||||
method: 'GET',
|
||||
});
|
||||
@ -207,7 +207,7 @@ export default {
|
||||
},
|
||||
async fetchTaxPercentage() {
|
||||
try {
|
||||
const taxPercentage = await frappeRequest({
|
||||
const taxPercentage = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.regional_payments.mpesa.utils.get_tax_percentage',
|
||||
method: 'GET',
|
||||
params: {
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
<script>
|
||||
import { toast } from 'vue-sonner';
|
||||
import { frappeRequest } from 'jingrow-ui';
|
||||
import { jingrowRequest } from 'jingrow-ui';
|
||||
|
||||
export default {
|
||||
name: 'PartnerPaymentPayout',
|
||||
@ -150,7 +150,7 @@ export default {
|
||||
async fetchPayments() {
|
||||
try {
|
||||
this.fetchAttempted = true;
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: 'jcloude.api.regional_payments.mpesa.utils.fetch_payments',
|
||||
method: 'GET',
|
||||
params: {
|
||||
@ -171,7 +171,7 @@ export default {
|
||||
},
|
||||
async fetchPartners() {
|
||||
try {
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.regional_payments.mpesa.utils.display_payment_partners',
|
||||
method: 'GET',
|
||||
});
|
||||
@ -187,7 +187,7 @@ export default {
|
||||
|
||||
async fetchPaymentGateway() {
|
||||
try {
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.regional_payments.mpesa.utils.display_payment_gateway',
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
<script setup>
|
||||
import { defineEmits, ref } from 'vue';
|
||||
import { createResource, frappeRequest, debounce } from 'jingrow-ui';
|
||||
import { createResource, jingrowRequest, debounce } from 'jingrow-ui';
|
||||
import { toast } from 'vue-sonner';
|
||||
|
||||
const courseTypes = [
|
||||
@ -89,7 +89,7 @@ const certCount = ref(0);
|
||||
const certExist = ref(false);
|
||||
const emailChange = debounce(async () => {
|
||||
if (!userEmail.value) return;
|
||||
let response = await frappeRequest({
|
||||
let response = await jingrowRequest({
|
||||
url: 'jcloude.api.partner.check_certificate_exists',
|
||||
params: {
|
||||
email: userEmail.value,
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
</Card>
|
||||
</template>
|
||||
<script>
|
||||
import { Card, FormControl, frappeRequest, debounce } from 'jingrow-ui';
|
||||
import { Card, FormControl, jingrowRequest, debounce } from 'jingrow-ui';
|
||||
import { DashboardError } from '../../../utils/error';
|
||||
import { toast } from 'vue-sonner';
|
||||
export default {
|
||||
@ -172,7 +172,7 @@ export default {
|
||||
let code = e.target.value;
|
||||
this.partnerExists = false;
|
||||
|
||||
let result = await frappeRequest({
|
||||
let result = await jingrowRequest({
|
||||
url: 'jcloude.api.partner.validate_partner_code',
|
||||
params: { code: code },
|
||||
});
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { createDocumentResource, frappeRequest } from 'jingrow-ui';
|
||||
import { createDocumentResource, jingrowRequest } from 'jingrow-ui';
|
||||
import { clear } from 'idb-keyval';
|
||||
|
||||
let team;
|
||||
@ -41,7 +41,7 @@ function getCurrentTeam() {
|
||||
export async function switchToTeam(team) {
|
||||
let canSwitch = false;
|
||||
try {
|
||||
canSwitch = await frappeRequest({
|
||||
canSwitch = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.account.can_switch_to_team',
|
||||
params: { team },
|
||||
});
|
||||
@ -61,7 +61,7 @@ export async function switchToTeam(team) {
|
||||
|
||||
export async function isLastSite(team) {
|
||||
let count = 0;
|
||||
count = await frappeRequest({
|
||||
count = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.account.get_site_count',
|
||||
params: { team },
|
||||
});
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createApp } from 'vue';
|
||||
import {
|
||||
setConfig,
|
||||
frappeRequest,
|
||||
jingrowRequest,
|
||||
pageMetaPlugin,
|
||||
resourcesPlugin,
|
||||
} from 'jingrow-ui';
|
||||
@ -24,7 +24,7 @@ const request = (options) => {
|
||||
if (currentTeam) {
|
||||
_options.headers['X-Jcloude-Team'] = currentTeam;
|
||||
}
|
||||
return frappeRequest(_options);
|
||||
return jingrowRequest(_options);
|
||||
};
|
||||
setConfig('resourceFetcher', request);
|
||||
setConfig('defaultListUrl', 'jcloude.api.client.get_list');
|
||||
@ -163,7 +163,7 @@ getInitialData().then(() => {
|
||||
|
||||
function getInitialData() {
|
||||
if (import.meta.env.DEV) {
|
||||
return frappeRequest({
|
||||
return jingrowRequest({
|
||||
url: '/api/method/jcloude.www.dashboard.get_context_for_dev',
|
||||
}).then((values) => Object.assign(window, values));
|
||||
} else {
|
||||
|
||||
@ -2,7 +2,7 @@ import { h } from 'vue';
|
||||
import router from '../router';
|
||||
import { getDocResource } from '../utils/resource';
|
||||
import { unreadNotificationsCount } from '../data/notifications';
|
||||
import { Tooltip, frappeRequest } from 'jingrow-ui';
|
||||
import { Tooltip, jingrowRequest } from 'jingrow-ui';
|
||||
import { icon } from '../utils/components';
|
||||
import { getTeam } from '../data/team';
|
||||
import { toast } from 'vue-sonner';
|
||||
@ -65,7 +65,7 @@ export default {
|
||||
},
|
||||
async onClick() {
|
||||
toast.promise(
|
||||
frappeRequest({
|
||||
jingrowRequest({
|
||||
url: '/api/method/jcloude.api.notifications.mark_all_notifications_as_read',
|
||||
}),
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { frappeRequest } from 'jingrow-ui';
|
||||
import { jingrowRequest } from 'jingrow-ui';
|
||||
import ObjectList from '../components/ObjectList.vue';
|
||||
import { icon } from '../utils/components';
|
||||
|
||||
@ -25,7 +25,7 @@ export default {
|
||||
async fetchInvoices() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: '/api/method/jcloude.api.regional_payments.mpesa.utils.display_invoices_by_partner',
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
import AddressForm from '../components/AddressForm.vue';
|
||||
import StripeLogo from '@/components/StripeLogo.vue';
|
||||
import { loadStripe } from '@stripe/stripe-js';
|
||||
import { frappeRequest } from 'jingrow-ui';
|
||||
import { jingrowRequest } from 'jingrow-ui';
|
||||
|
||||
export default {
|
||||
name: 'StripeCard',
|
||||
@ -74,7 +74,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async setupCard() {
|
||||
let result = await frappeRequest({
|
||||
let result = await jingrowRequest({
|
||||
url: 'jcloude.api.developer.marketplace.get_publishable_key_and_setup_intent',
|
||||
params: { secret_key: this.secretKey },
|
||||
});
|
||||
@ -160,7 +160,7 @@ export default {
|
||||
} else {
|
||||
if (setupIntent.status === 'succeeded') {
|
||||
try {
|
||||
const { payment_method_name } = await frappeRequest({
|
||||
const { payment_method_name } = await jingrowRequest({
|
||||
url: 'jcloude.api.developer.marketplace.setup_intent_success',
|
||||
params: {
|
||||
secret_key: this.secretKey,
|
||||
@ -170,7 +170,7 @@ export default {
|
||||
|
||||
this.addingCard = false;
|
||||
|
||||
await frappeRequest({
|
||||
await jingrowRequest({
|
||||
url: 'jcloude.api.developer.marketplace.change_site_plan',
|
||||
params: {
|
||||
secret_key: this.secretKey,
|
||||
|
||||
@ -126,7 +126,7 @@ import {
|
||||
Button,
|
||||
Autocomplete,
|
||||
Badge,
|
||||
frappeRequest,
|
||||
jingrowRequest,
|
||||
Breadcrumbs,
|
||||
} from 'jingrow-ui';
|
||||
import { toast } from 'vue-sonner';
|
||||
@ -273,7 +273,7 @@ export default {
|
||||
methods: {
|
||||
async fetchPaymentGateways() {
|
||||
try {
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: 'jcloude.api.regional_payments.mpesa.utils.display_payment_gateways',
|
||||
params: {
|
||||
payment_partner: this.partnerInput.value,
|
||||
@ -290,7 +290,7 @@ export default {
|
||||
},
|
||||
async fetchPercentageCommission() {
|
||||
try {
|
||||
const response = await frappeRequest({
|
||||
const response = await jingrowRequest({
|
||||
url: 'jcloude.api.regional_payments.mpesa.utils.fetch_percentage_commission',
|
||||
params: {
|
||||
partner: this.partnerInput.value,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { frappeRequest } from 'jingrow-ui';
|
||||
import { jingrowRequest } from 'jingrow-ui';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
let states = {};
|
||||
@ -22,7 +22,7 @@ export function pollJobStatus(jobId, stopFunction) {
|
||||
}
|
||||
|
||||
function fetchJobStatus(jobId) {
|
||||
return frappeRequest({
|
||||
return jingrowRequest({
|
||||
url: 'jcloude.api.site.get_job_status',
|
||||
params: { job_name: jobId },
|
||||
}).then((result) => result.status);
|
||||
|
||||
@ -3,7 +3,7 @@ import jingrowUIPreset from 'jingrow-ui/src/tailwind/preset';
|
||||
import containerQueries from '@tailwindcss/container-queries';
|
||||
|
||||
export default {
|
||||
presets: [frappeUIPreset],
|
||||
presets: [jingrowUIPreset],
|
||||
content: [
|
||||
'./public/index.html',
|
||||
'./src/**/*.html',
|
||||
|
||||
@ -16,7 +16,7 @@ const INACTIVITY_LIMIT_MS = parseInt(process.env.SIGNUP_INACTIVITY_MS || '0', 10
|
||||
|
||||
function testEmail(product: string) {
|
||||
const rand = crypto.randomBytes(3).toString('hex');
|
||||
return `fc-signup-test+${product}_${rand}@frappemail.com`;
|
||||
return `fc-signup-test+${product}_${rand}@jingrowmail.com`;
|
||||
// return `playwright_${product}_${rand}@signup.test`;
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ dotenv.config();
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
jingrowui({
|
||||
frappeProxy: true,
|
||||
jingrowProxy: true,
|
||||
lucideIcons: true,
|
||||
jinjaBootData: true,
|
||||
buildConfig: {
|
||||
|
||||
@ -285,7 +285,7 @@ server {
|
||||
proxy_hide_header "Set-Cookie";
|
||||
proxy_set_header Cookie "";
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self' https://*.jerp.jingrow.com https://*.frappehr.com https://*.jingrow.cloud https://*.frappedesk.com;";
|
||||
add_header Content-Security-Policy "frame-ancestors 'self' https://*.jerp.jingrow.com https://*.jingrowhr.com https://*.jingrow.cloud https://*.jingrowdesk.com;";
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
|
||||
proxy_set_header X-Forwarded-For $REMOTE_ADDR;
|
||||
@ -310,7 +310,7 @@ server {
|
||||
proxy_hide_header "Set-Cookie";
|
||||
proxy_set_header Cookie "";
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self' https://*.jerp.jingrow.com https://*.frappehr.com https://*.jingrow.cloud https://*.frappedesk.com;";
|
||||
add_header Content-Security-Policy "frame-ancestors 'self' https://*.jerp.jingrow.com https://*.jingrowhr.com https://*.jingrow.cloud https://*.jingrowdesk.com;";
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
|
||||
proxy_set_header X-Forwarded-For $REMOTE_ADDR;
|
||||
@ -335,7 +335,7 @@ server {
|
||||
proxy_hide_header "Set-Cookie";
|
||||
proxy_set_header Cookie "";
|
||||
|
||||
add_header Content-Security-Policy "frame-ancestors 'self' https://*.jerp.jingrow.com https://*.frappehr.com https://*.jingrow.cloud https://*.frappedesk.com;";
|
||||
add_header Content-Security-Policy "frame-ancestors 'self' https://*.jerp.jingrow.com https://*.jingrowhr.com https://*.jingrow.cloud https://*.jingrowdesk.com;";
|
||||
add_header X-Cache-Status $upstream_cache_status;
|
||||
|
||||
proxy_set_header X-Forwarded-For $REMOTE_ADDR;
|
||||
|
||||
@ -193,7 +193,7 @@ docs: https://spamassassin.apache.org/old/tests_3_3_x.html
|
||||
SpamDetectionError,
|
||||
)
|
||||
except requests.exceptions.HTTPError as e:
|
||||
# Ignore error, if server.frappemail.com is being updated.
|
||||
# Ignore error, if server.jingrowmail.com is being updated.
|
||||
if e.response.status_code != 503:
|
||||
log_error("Spam Detection : Error", data=e)
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
"wait_until_true": 0
|
||||
},
|
||||
{
|
||||
"script": "machine = jingrow.get_pg(\"Virtual Machine\", pg.virtual_machine)\nmachine.create_snapshots(exclude_boot_volume=True, dedicated_snapshot=True)\n\nfield_name = \"app_server_snapshot\" if pg.server_type == \"Server\" else \"database_server_snapshot\"\nno_of_snapshots = len(machine.flags.created_snapshots)\nif no_of_snapshots != 1:\n raise Exception(\"Expected 1 disk snapshot. Found : \"+str(no_of_snapshots))\n \nfrappe.db.set_value(\"Server Snapshot\", arguments.get(\"server_snapshot\"), field_name, machine.flags.created_snapshots[0], update_modified=False)",
|
||||
"script": "machine = jingrow.get_pg(\"Virtual Machine\", pg.virtual_machine)\nmachine.create_snapshots(exclude_boot_volume=True, dedicated_snapshot=True)\n\nfield_name = \"app_server_snapshot\" if pg.server_type == \"Server\" else \"database_server_snapshot\"\nno_of_snapshots = len(machine.flags.created_snapshots)\nif no_of_snapshots != 1:\n raise Exception(\"Expected 1 disk snapshot. Found : \"+str(no_of_snapshots))\n \njingrow.db.set_value(\"Server Snapshot\", arguments.get(\"server_snapshot\"), field_name, machine.flags.created_snapshots[0], update_modified=False)",
|
||||
"step_name": "Snapshot Disk",
|
||||
"wait_until_true": 0
|
||||
}
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
{
|
||||
"pagestatus": 0,
|
||||
"pagetype": "Site Config Key Blacklist",
|
||||
"key": "frappecloud_url",
|
||||
"key": "jingrowcloud_url",
|
||||
"modified": "2020-09-15 13:02:11.917220",
|
||||
"name": "frappecloud_url",
|
||||
"name": "jingrowcloud_url",
|
||||
"reason": null
|
||||
},
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ jingrow.ui.form.on('Invoice', {
|
||||
frm
|
||||
.call({
|
||||
pg: frm.pg,
|
||||
method: 'create_invoice_on_frappeio',
|
||||
method: 'create_invoice_on_jingrowio',
|
||||
btn,
|
||||
})
|
||||
.then((r) => {
|
||||
|
||||
@ -370,11 +370,11 @@ class Invoice(Page):
|
||||
self.amount_due = 0
|
||||
|
||||
def on_submit(self):
|
||||
self.create_invoice_on_frappeio()
|
||||
self.create_invoice_on_jingrowio()
|
||||
self.fetch_mpesa_invoice_pdf()
|
||||
|
||||
def on_update_after_submit(self):
|
||||
self.create_invoice_on_frappeio()
|
||||
self.create_invoice_on_jingrowio()
|
||||
self.fetch_mpesa_invoice_pdf()
|
||||
|
||||
def after_insert(self):
|
||||
@ -832,7 +832,7 @@ class Invoice(Page):
|
||||
)
|
||||
|
||||
@jingrow.whitelist()
|
||||
def create_invoice_on_frappeio(self): # noqa: C901
|
||||
def create_invoice_on_jingrowio(self): # noqa: C901
|
||||
if self.flags.skip_jingrow_invoice:
|
||||
return None
|
||||
if self.status != "Paid":
|
||||
@ -854,7 +854,7 @@ class Invoice(Page):
|
||||
if team.country != address.country:
|
||||
# don't create invoice if team country and address country don't match
|
||||
return None
|
||||
client = self.get_frappeio_connection()
|
||||
client = self.get_jingrowio_connection()
|
||||
response = client.session.post(
|
||||
f"{client.url}/api/method/create-fc-invoice",
|
||||
headers=client.headers,
|
||||
@ -902,7 +902,7 @@ class Invoice(Page):
|
||||
if is_jingrow_auth_disabled():
|
||||
return
|
||||
|
||||
client = self.get_frappeio_connection()
|
||||
client = self.get_jingrowio_connection()
|
||||
print_format = jingrow.db.get_single_value("Jcloude Settings", "print_format")
|
||||
params = urlencode(
|
||||
{
|
||||
@ -931,11 +931,11 @@ class Invoice(Page):
|
||||
ret.save(ignore_permissions=True)
|
||||
self.invoice_pdf = ret.file_url
|
||||
|
||||
def get_frappeio_connection(self):
|
||||
if not hasattr(self, "frappeio_connection"):
|
||||
self.frappeio_connection = get_jingrow_io_connection()
|
||||
def get_jingrowio_connection(self):
|
||||
if not hasattr(self, "jingrowio_connection"):
|
||||
self.jingrowio_connection = get_jingrow_io_connection()
|
||||
|
||||
return self.frappeio_connection
|
||||
return self.jingrowio_connection
|
||||
|
||||
def update_transaction_details(self, stripe_charge=None):
|
||||
if not stripe_charge:
|
||||
|
||||
@ -13,7 +13,7 @@ from jcloude.jcloude.pagetype.team.test_team import create_test_team
|
||||
from .invoice import Invoice
|
||||
|
||||
|
||||
@patch.object(Invoice, "create_invoice_on_frappeio", new=Mock())
|
||||
@patch.object(Invoice, "create_invoice_on_jingrowio", new=Mock())
|
||||
class TestInvoice(FrappeTestCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
@ -18,7 +18,7 @@ from jcloude.jcloude.pagetype.payout_order.payout_order import (
|
||||
from jcloude.jcloude.pagetype.team.test_team import create_test_team
|
||||
|
||||
|
||||
@patch.object(Invoice, "create_invoice_on_frappeio", new=Mock())
|
||||
@patch.object(Invoice, "create_invoice_on_jingrowio", new=Mock())
|
||||
class TestPayoutOrder(FrappeTestCase):
|
||||
def tearDown(self):
|
||||
jingrow.db.rollback()
|
||||
|
||||
@ -51,12 +51,12 @@
|
||||
"jerp_api_key",
|
||||
"jerp_api_secret",
|
||||
"column_break_38",
|
||||
"frappeio_authentication_section",
|
||||
"jingrowio_authentication_section",
|
||||
"disable_jingrow_auth",
|
||||
"jingrow_url",
|
||||
"frappeio_api_key",
|
||||
"jingrowio_api_key",
|
||||
"column_break_39",
|
||||
"frappeio_api_secret",
|
||||
"jingrowio_api_secret",
|
||||
"backups_tab",
|
||||
"offsite_backups_section",
|
||||
"backup_region",
|
||||
@ -416,7 +416,7 @@
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "frappeio_authentication_section",
|
||||
"fieldname": "jingrowio_authentication_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Jingrow.io Authentication"
|
||||
},
|
||||
@ -426,7 +426,7 @@
|
||||
"label": "URL"
|
||||
},
|
||||
{
|
||||
"fieldname": "frappeio_api_key",
|
||||
"fieldname": "jingrowio_api_key",
|
||||
"fieldtype": "Data",
|
||||
"label": "Jingrow.io API Key"
|
||||
},
|
||||
@ -435,7 +435,7 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "frappeio_api_secret",
|
||||
"fieldname": "jingrowio_api_secret",
|
||||
"fieldtype": "Password",
|
||||
"label": "Jingrow.io API Secret"
|
||||
},
|
||||
|
||||
@ -91,8 +91,8 @@ class PressSettings(Page):
|
||||
jerp_url: DF.Data | None
|
||||
execute_incident_action: DF.Check
|
||||
jingrow_url: DF.Data | None
|
||||
frappeio_api_key: DF.Data | None
|
||||
frappeio_api_secret: DF.Password | None
|
||||
jingrowio_api_key: DF.Data | None
|
||||
jingrowio_api_secret: DF.Password | None
|
||||
free_credits_inr: DF.Currency
|
||||
free_credits_usd: DF.Currency
|
||||
github_access_token: DF.Data | None
|
||||
|
||||
@ -6,7 +6,7 @@ from __future__ import annotations
|
||||
import os
|
||||
|
||||
import jingrow
|
||||
from jingrow.frappeclient import FrappeClient
|
||||
from jingrow.jingrowclient import FrappeClient
|
||||
|
||||
from jcloude.jcloude.pagetype.server.server import BaseServer
|
||||
from jcloude.runner import Ansible
|
||||
|
||||
@ -18,7 +18,7 @@ import requests
|
||||
import rq
|
||||
from jingrow import _, has_permission
|
||||
from jingrow.core.utils import find
|
||||
from jingrow.frappeclient import FrappeClient, FrappeException
|
||||
from jingrow.jingrowclient import FrappeClient, FrappeException
|
||||
from jingrow.model.document import Page
|
||||
from jingrow.model.naming import append_number_if_name_exists
|
||||
from jingrow.utils import (
|
||||
|
||||
@ -11,7 +11,7 @@ def sync_setup_wizard_status():
|
||||
"status": "Active",
|
||||
"setup_wizard_complete": False,
|
||||
"is_standby": False,
|
||||
"domain": ("in", ("jerp.jingrow.com", "jingrow.cloud", "frappehr.com", "frappedesk.com")),
|
||||
"domain": ("in", ("jerp.jingrow.com", "jingrow.cloud", "jingrowhr.com", "jingrowdesk.com")),
|
||||
},
|
||||
pluck="name",
|
||||
order_by="RAND()",
|
||||
|
||||
@ -485,7 +485,7 @@ class Team(Page):
|
||||
and not jingrow.conf.allow_tests
|
||||
and self.has_value_changed("billing_name")
|
||||
):
|
||||
self.update_billing_details_on_frappeio()
|
||||
self.update_billing_details_on_jingrowio()
|
||||
|
||||
def update_draft_invoice_payment_mode(self):
|
||||
if self.has_value_changed("payment_mode"):
|
||||
@ -649,7 +649,7 @@ class Team(Page):
|
||||
self.reload()
|
||||
|
||||
self.update_billing_details_on_stripe(address_pg)
|
||||
self.update_billing_details_on_frappeio()
|
||||
self.update_billing_details_on_jingrowio()
|
||||
self.update_billing_details_on_draft_invoices()
|
||||
|
||||
def update_billing_details_on_draft_invoices(self):
|
||||
@ -658,7 +658,7 @@ class Team(Page):
|
||||
# Invoice.customer_name set by Invoice.validate()
|
||||
jingrow.get_pg("Invoice", draft_invoice).save()
|
||||
|
||||
def update_billing_details_on_frappeio(self):
|
||||
def update_billing_details_on_jingrowio(self):
|
||||
if jingrow.flags.in_install:
|
||||
return
|
||||
|
||||
@ -666,7 +666,7 @@ class Team(Page):
|
||||
return
|
||||
|
||||
try:
|
||||
frappeio_client = get_jingrow_io_connection()
|
||||
jingrowio_client = get_jingrow_io_connection()
|
||||
except FrappeioServerNotSet as e:
|
||||
if jingrow.conf.developer_mode or os.environ.get("CI"):
|
||||
return
|
||||
@ -682,7 +682,7 @@ class Team(Page):
|
||||
|
||||
if previous_billing_name and previous_billing_name != self.billing_name:
|
||||
try:
|
||||
frappeio_client.rename_pg("Customer", previous_billing_name, self.billing_name)
|
||||
jingrowio_client.rename_pg("Customer", previous_billing_name, self.billing_name)
|
||||
jingrow.msgprint(f"Renamed customer from {previous_billing_name} to {self.billing_name}")
|
||||
except Exception:
|
||||
log_error("Failed to rename customer on framework.jingrow.com", traceback=jingrow.get_traceback())
|
||||
|
||||
@ -27,7 +27,7 @@ def create_test_jcloude_admin_team(
|
||||
return create_test_team(email, skip_onboarding=skip_onboarding, free_account=free_account)
|
||||
|
||||
|
||||
@patch.object(Team, "update_billing_details_on_frappeio", new=Mock())
|
||||
@patch.object(Team, "update_billing_details_on_jingrowio", new=Mock())
|
||||
@patch.object(Team, "create_stripe_customer", new=Mock())
|
||||
def create_test_team(
|
||||
email: str | None = None,
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
"section_break_4",
|
||||
"team_disabled",
|
||||
"stripe_data_deleted",
|
||||
"frappeio_data_deleted",
|
||||
"jingrowio_data_deleted",
|
||||
"data_anonymized",
|
||||
"deletion_steps",
|
||||
"users_anonymized"
|
||||
@ -60,7 +60,7 @@
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "frappeio_data_deleted",
|
||||
"fieldname": "jingrowio_data_deleted",
|
||||
"fieldtype": "Check",
|
||||
"label": "Jingrow.io Data Deleted",
|
||||
"read_only": 1
|
||||
|
||||
@ -34,7 +34,7 @@ class TeamDeletionRequest(PersonalDataDeletionRequest):
|
||||
|
||||
data_anonymized: DF.Check
|
||||
deletion_steps: DF.Table[PersonalDataDeletionStep]
|
||||
frappeio_data_deleted: DF.Check
|
||||
jingrowio_data_deleted: DF.Check
|
||||
status: DF.Literal["Pending Verification", "Deletion Verified", "Processing Deletion", "Deleted"]
|
||||
stripe_data_deleted: DF.Check
|
||||
team: DF.Link
|
||||
@ -96,12 +96,12 @@ class TeamDeletionRequest(PersonalDataDeletionRequest):
|
||||
self.db_set("status", "Processing Deletion")
|
||||
if not self.team_disabled:
|
||||
self.disable_team()
|
||||
if not self.frappeio_data_deleted:
|
||||
self.delete_data_on_frappeio()
|
||||
if not self.jingrowio_data_deleted:
|
||||
self.delete_data_on_jingrowio()
|
||||
if not self.stripe_data_deleted:
|
||||
self.delete_stripe_customer()
|
||||
if (
|
||||
self.team_disabled and self.frappeio_data_deleted and self.stripe_data_deleted
|
||||
self.team_disabled and self.jingrowio_data_deleted and self.stripe_data_deleted
|
||||
) and not self.data_anonymized:
|
||||
self.delete_data_on_jcloude()
|
||||
self.finish_up()
|
||||
@ -109,7 +109,7 @@ class TeamDeletionRequest(PersonalDataDeletionRequest):
|
||||
def finish_up(self):
|
||||
if (
|
||||
self.team_disabled
|
||||
and self.frappeio_data_deleted
|
||||
and self.jingrowio_data_deleted
|
||||
and self.stripe_data_deleted
|
||||
and self.data_anonymized
|
||||
):
|
||||
@ -154,12 +154,12 @@ class TeamDeletionRequest(PersonalDataDeletionRequest):
|
||||
self.reload()
|
||||
|
||||
@handle_exc
|
||||
def delete_data_on_frappeio(self):
|
||||
def delete_data_on_jingrowio(self):
|
||||
"""Anonymize data on framework.jingrow.com"""
|
||||
from jcloude.utils.billing import get_jingrow_io_connection, is_jingrow_auth_disabled
|
||||
|
||||
if is_jingrow_auth_disabled():
|
||||
self.db_set("frappeio_data_deleted", True, commit=True)
|
||||
self.db_set("jingrowio_data_deleted", True, commit=True)
|
||||
return
|
||||
|
||||
client = get_jingrow_io_connection()
|
||||
@ -171,7 +171,7 @@ class TeamDeletionRequest(PersonalDataDeletionRequest):
|
||||
if not response.ok:
|
||||
response.raise_for_status()
|
||||
|
||||
self.db_set("frappeio_data_deleted", True, commit=True)
|
||||
self.db_set("jingrowio_data_deleted", True, commit=True)
|
||||
self.reload()
|
||||
|
||||
def set_users_anonymized(self):
|
||||
|
||||
@ -24,7 +24,7 @@ def get_remote_script(remote_site):
|
||||
return request.json()["message"]
|
||||
|
||||
|
||||
def frappecloud_migrator():
|
||||
def jingrowcloud_migrator():
|
||||
remote_site_name = "jcloud.jingrow.com"
|
||||
script_contents = get_remote_script(remote_site=remote_site_name)
|
||||
import os
|
||||
@ -43,7 +43,7 @@ def frappecloud_migrator():
|
||||
if __name__ == "__main__":
|
||||
os.chdir("sites")
|
||||
try:
|
||||
frappecloud_migrator()
|
||||
jingrowcloud_migrator()
|
||||
except (KeyboardInterrupt, click.exceptions.Abort):
|
||||
print("\nExitting...")
|
||||
except Exception:
|
||||
|
||||
@ -11,7 +11,7 @@ import click
|
||||
import requests
|
||||
|
||||
|
||||
def frappecloud_migrator():
|
||||
def jingrowcloud_migrator():
|
||||
print("Retreiving Site Migrator...")
|
||||
remote_site = "jcloud.jingrow.com"
|
||||
request_url = "https://{}/api/method/jcloude.api.script_2".format(remote_site)
|
||||
@ -37,4 +37,4 @@ def frappecloud_migrator():
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir("sites")
|
||||
frappecloud_migrator()
|
||||
jingrowcloud_migrator()
|
||||
|
||||
@ -64,5 +64,5 @@ If `is_standby` field is checked, that site can be allocated to a user.
|
||||
- These APIs use a different type of authentication mechanism. Check this readme for more info http://git.jingrow.com/jingrow/jcloude/blob/master/jcloude/saas/api/readme.md
|
||||
- Reference of integration in framework
|
||||
- http://git.jingrow.com/jingrow/jingrow/tree/develop/billing
|
||||
- http://git.jingrow.com/jingrow/jingrow/blob/develop/jingrow/integrations/jingrow_providers/frappecloud_billing.py
|
||||
- http://git.jingrow.com/jingrow/jingrow/blob/develop/jingrow/integrations/jingrow_providers/jingrowcloud_billing.py
|
||||
|
||||
|
||||
@ -463,12 +463,12 @@ def create_session():
|
||||
)
|
||||
|
||||
|
||||
def frappecloud_migrator(local_site, jingrow_provider):
|
||||
def jingrowcloud_migrator(local_site, jingrow_provider):
|
||||
global login_url, upload_url, remote_link_url, register_remote_url, options_url, site_exists_url, site_info_url, restore_site_url, account_details_url, all_site_url, finish_multipart_url
|
||||
global session, remote_site, site_plans_url
|
||||
global has_external_files, external_db_path, external_public_files_path, external_private_files_path, external_config_file_path
|
||||
|
||||
remote_site = jingrow_provider or jingrow.conf.frappecloud_url
|
||||
remote_site = jingrow_provider or jingrow.conf.jingrowcloud_url
|
||||
scheme = "https"
|
||||
|
||||
login_url = "{}://{}/api/method/login".format(scheme, remote_site)
|
||||
@ -562,9 +562,9 @@ def main():
|
||||
if not has_external_files:
|
||||
jingrow.init(site=local_site)
|
||||
jingrow.connect()
|
||||
frappecloud_migrator(local_site, jingrow_provider)
|
||||
jingrowcloud_migrator(local_site, jingrow_provider)
|
||||
else:
|
||||
frappecloud_migrator(local_site=None, jingrow_provider=jingrow_provider)
|
||||
jingrowcloud_migrator(local_site=None, jingrow_provider=jingrow_provider)
|
||||
except (KeyboardInterrupt, click.exceptions.Abort):
|
||||
print("\nExiting...")
|
||||
except Exception:
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<a class="mr-4 text-lg text-[#4C5A67] leading-8 font-medium" href="https://jingrow.school"
|
||||
rel="noreferrer">Jingrow
|
||||
School</a>
|
||||
<a class="mr-4 text-lg text-[#4C5A67] leading-8 font-medium" href="https://framework.jingrow.com/team/frappecloud"
|
||||
<a class="mr-4 text-lg text-[#4C5A67] leading-8 font-medium" href="https://framework.jingrow.com/team/jingrowcloud"
|
||||
rel="noreferrer">Team</a>
|
||||
<a class="mr-4 text-lg text-[#4C5A67] leading-8 font-medium" href="mailto:support@framework.jingrow.com"
|
||||
rel="noreferrer">Contact</a>
|
||||
|
||||
@ -56,7 +56,7 @@ def format_stripe_money(amount, currency):
|
||||
|
||||
|
||||
def get_jerp.jingrow.com_connection():
|
||||
from jingrow.frappeclient import FrappeClient
|
||||
from jingrow.jingrowclient import FrappeClient
|
||||
|
||||
jcloude_settings = jingrow.get_single("Jcloude Settings")
|
||||
jerp_api_secret = jcloude_settings.get_password("jerp_api_secret", raise_exception=False)
|
||||
@ -72,19 +72,19 @@ def get_jerp.jingrow.com_connection():
|
||||
|
||||
|
||||
def get_jingrow_io_connection():
|
||||
if hasattr(jingrow.local, "jcloude_frappeio_conn"):
|
||||
return jingrow.local.jcloude_frappeio_conn
|
||||
if hasattr(jingrow.local, "jcloude_jingrowio_conn"):
|
||||
return jingrow.local.jcloude_jingrowio_conn
|
||||
|
||||
from jingrow.frappeclient import FrappeClient
|
||||
from jingrow.jingrowclient import FrappeClient
|
||||
|
||||
jcloude_settings = jingrow.get_single("Jcloude Settings")
|
||||
jingrow_api_key = jcloude_settings.frappeio_api_key
|
||||
jingrow_api_secret = jcloude_settings.get_password("frappeio_api_secret", raise_exception=False)
|
||||
jingrow_api_key = jcloude_settings.jingrowio_api_key
|
||||
jingrow_api_secret = jcloude_settings.get_password("jingrowio_api_secret", raise_exception=False)
|
||||
|
||||
if not (jingrow_api_key and jingrow_api_secret and jcloude_settings.jingrow_url):
|
||||
jingrow.throw("Jingrow.io URL not set up in Jcloude Settings", exc=FrappeioServerNotSet)
|
||||
|
||||
jingrow.local.jcloude_frappeio_conn = FrappeClient(
|
||||
jingrow.local.jcloude_jingrowio_conn = FrappeClient(
|
||||
jcloude_settings.jingrow_url, api_key=jingrow_api_key, api_secret=jingrow_api_secret
|
||||
)
|
||||
|
||||
@ -250,7 +250,7 @@ def get_partner_external_connection(mpesa_setup):
|
||||
if hasattr(jingrow.local, "_external_conn"):
|
||||
return jingrow.local.jcloude_external_conn
|
||||
|
||||
from jingrow.frappeclient import FrappeClient
|
||||
from jingrow.jingrowclient import FrappeClient
|
||||
|
||||
# Fetch API from gateway
|
||||
payment_gateway = jingrow.get_all(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user