Skip to content

Commit 93e51b8

Browse files
committed
Fix
1 parent 8e41765 commit 93e51b8

File tree

1 file changed

+19
-78
lines changed

1 file changed

+19
-78
lines changed

website/src/pages/playground.js

Lines changed: 19 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,13 +1107,7 @@ class SOQLToSOQLLibTranslator {
11071107
}
11081108

11091109
export default function Playground() {
1110-
const [soqlInput, setSoqlInput] = useState(`SELECT Id, Name, Industry, BillingCity
1111-
FROM Account
1112-
WHERE Industry = 'Technology'
1113-
AND BillingCity = 'San Francisco'
1114-
ORDER BY Name ASC
1115-
LIMIT 10
1116-
WITH USER_MODE`);
1110+
const [soqlInput, setSoqlInput] = useState('SELECT Id, Name, Industry, BillingCity\nFROM Account\nWHERE Industry = \'Technology\' \n AND BillingCity = \'San Francisco\'\nORDER BY Name ASC\nLIMIT 10\nWITH USER_MODE');
11171111

11181112
const [soqlLibOutput, setSoqlLibOutput] = useState('');
11191113
const [isLoading, setIsLoading] = useState(false);
@@ -1144,118 +1138,65 @@ WITH USER_MODE`);
11441138
};
11451139

11461140
const examples = [
1147-
{
1148-
name: "Simple Query",
1149-
query: `SELECT Id, Name
1150-
FROM Account
1151-
WHERE Name LIKE '%Test%'
1152-
WITH USER_MODE`
1153-
},
1141+
{
1142+
name: "Simple Query",
1143+
query: "SELECT Id, Name\nFROM Account\nWHERE Name LIKE '%Test%'\nWITH USER_MODE"
1144+
},
11541145
{
11551146
name: "Multiple Conditions",
1156-
query: `SELECT Id, Name, Owner.Name
1157-
FROM Account
1158-
WHERE Industry = 'Technology'
1159-
AND BillingCity = 'San Francisco'
1160-
WITH USER_MODE`
1147+
query: "SELECT Id, Name, Owner.Name\nFROM Account\nWHERE Industry = 'Technology'\n AND BillingCity = 'San Francisco'\nWITH USER_MODE"
11611148
},
11621149
{
11631150
name: "OR Conditions",
1164-
query: `SELECT Id, Name
1165-
FROM Account
1166-
WHERE Industry = 'Technology'
1167-
OR Industry = 'Healthcare'
1168-
WITH USER_MODE`
1151+
query: "SELECT Id, Name\nFROM Account\nWHERE Industry = 'Technology'\n OR Industry = 'Healthcare'\nWITH USER_MODE"
11691152
},
11701153
{
11711154
name: "Parent Fields",
1172-
query: `SELECT Id, Name, CreatedBy.Id, CreatedBy.Name, Parent.Id, Parent.Name
1173-
FROM Account
1174-
WITH USER_MODE`
1155+
query: "SELECT Id, Name, CreatedBy.Id, CreatedBy.Name, Parent.Id, Parent.Name\nFROM Account\nWITH USER_MODE"
11751156
},
11761157
{
11771158
name: "COUNT & SUM",
1178-
query: `SELECT CampaignId, COUNT(Id) totalRecords, SUM(Amount) totalAmount
1179-
FROM Opportunity
1180-
GROUP BY CampaignId
1181-
WITH USER_MODE`
1159+
query: "SELECT CampaignId, COUNT(Id) totalRecords, SUM(Amount) totalAmount\nFROM Opportunity\nGROUP BY CampaignId\nWITH USER_MODE"
11821160
},
11831161
{
11841162
name: "AVG & MIN",
1185-
query: `SELECT Industry, AVG(AnnualRevenue) avgRevenue, MIN(NumberOfEmployees) minEmployees
1186-
FROM Account
1187-
GROUP BY Industry
1188-
WITH USER_MODE`
1163+
query: "SELECT Industry, AVG(AnnualRevenue) avgRevenue, MIN(NumberOfEmployees) minEmployees\nFROM Account\nGROUP BY Industry\nWITH USER_MODE"
11891164
},
11901165
{
11911166
name: "SubQuery",
1192-
query: `SELECT Id, Name, (SELECT Id, Name FROM Contacts)
1193-
FROM Account
1194-
WITH USER_MODE`
1167+
query: "SELECT Id, Name, (SELECT Id, Name FROM Contacts)\nFROM Account\nWITH USER_MODE"
11951168
},
11961169
{
11971170
name: "Complex WHERE",
1198-
query: `SELECT Id
1199-
FROM Account
1200-
WHERE Industry = 'IT'
1201-
AND ((Name = 'My Account' AND NumberOfEmployees >= 10)
1202-
OR (Name = 'My Account 2' AND NumberOfEmployees <= 20))
1203-
WITH USER_MODE`
1171+
query: "SELECT Id\nFROM Account\nWHERE Industry = 'IT'\n AND ((Name = 'My Account' AND NumberOfEmployees >= 10)\n OR (Name = 'My Account 2' AND NumberOfEmployees <= 20))\nWITH USER_MODE"
12041172
},
12051173
{
12061174
name: "LIKE Patterns",
1207-
query: `SELECT Id, Name
1208-
FROM Account
1209-
WHERE Name LIKE 'Test%'
1210-
AND BillingCity LIKE '%Francisco%'
1211-
WITH USER_MODE`
1175+
query: "SELECT Id, Name\nFROM Account\nWHERE Name LIKE 'Test%'\n AND BillingCity LIKE '%Francisco%'\nWITH USER_MODE"
12121176
},
12131177
{
12141178
name: "IN Operator",
1215-
query: `SELECT Id, Name
1216-
FROM Account
1217-
WHERE Industry IN ('Technology', 'Healthcare', 'Finance')
1218-
WITH USER_MODE`
1179+
query: "SELECT Id, Name\nFROM Account\nWHERE Industry IN ('Technology', 'Healthcare', 'Finance')\nWITH USER_MODE"
12191180
},
12201181
{
12211182
name: "ORDER BY Multiple",
1222-
query: `SELECT Id, Name, Industry
1223-
FROM Account
1224-
ORDER BY Name DESC, Industry ASC
1225-
LIMIT 50
1226-
WITH USER_MODE`
1183+
query: "SELECT Id, Name, Industry\nFROM Account\nORDER BY Name DESC, Industry ASC\nLIMIT 50\nWITH USER_MODE"
12271184
},
12281185
{
12291186
name: "Complex Query",
1230-
query: `SELECT Id, Name
1231-
FROM Account
1232-
WHERE (Industry = 'Technology' OR Industry = 'Healthcare')
1233-
AND NumberOfEmployees > 100
1234-
ORDER BY Name
1235-
LIMIT 20
1236-
WITH USER_MODE`
1187+
query: "SELECT Id, Name\nFROM Account\nWHERE (Industry = 'Technology' OR Industry = 'Healthcare')\n AND NumberOfEmployees > 100\nORDER BY Name\nLIMIT 20\nWITH USER_MODE"
12371188
},
12381189
{
12391190
name: "Boolean Fields",
1240-
query: `SELECT Id, Name
1241-
FROM Account
1242-
WHERE IsDeleted = false
1243-
AND IsPersonAccount = true
1244-
WITH USER_MODE`
1191+
query: "SELECT Id, Name\nFROM Account\nWHERE IsDeleted = false\n AND IsPersonAccount = true\nWITH USER_MODE"
12451192
},
12461193
{
12471194
name: "NULL Checks",
1248-
query: `SELECT Id, Name
1249-
FROM Account
1250-
WHERE ParentId != null
1251-
AND BillingCity = null
1252-
WITH USER_MODE`
1195+
query: "SELECT Id, Name\nFROM Account\nWHERE ParentId != null\n AND BillingCity = null\nWITH USER_MODE"
12531196
},
12541197
{
12551198
name: "System Mode",
1256-
query: `SELECT Id, Name, CreatedBy.Id, CreatedBy.Name, Parent.Id, Parent.Name
1257-
FROM Account
1258-
WITH SYSTEM_MODE`
1199+
query: "SELECT Id, Name, CreatedBy.Id, CreatedBy.Name, Parent.Id, Parent.Name\nFROM Account\nWITH SYSTEM_MODE"
12591200
}
12601201
];
12611202

0 commit comments

Comments
 (0)