Skip to content

Commit

Permalink
Merge branch 'tim-survey-builder' into v2
Browse files Browse the repository at this point in the history
* tim-survey-builder: (26 commits)
  add readme
  Question types render own Inspector properties. Update parts atom to include type config.
  Enable importing absolute paths. Restructure folders.
  Recoil devtools. Mobile navbar views. Move items with animation.  Dnd lock axis.
  Improve mobile responsive for frame + single type. Refactor DND to avoid unneeded part rerenders.
  Short answer integration
  Start adding mobile responsiveness. Fix recoil not working in ios. Fix storybook startup issue due to new Framework imports.
  Fix ios bug where any component using react-tabulator eg. admin/forms/list won't show list items. see ngduc/react-tabulator#215
  Add ios build
  Add dragndrop for canvas
  Reinstalling storybook
  Load editor's json into builder. Builder can update editor source on clicking save. Update DND. Update placeholder type.
  Enable builder in editor without blowing up. Fix circular imports.
  Refactor recoil state. Load json and save source. Fix error in engine.js when using strict mode.
  Add toolbar to generate source. Refactor to make it easier to add new question types.
  Update single item styles
  Reduce storybook startup time. Update dnd for single items.
  Fix recoil + rbd bug github/facebookexperimental/Recoil#496 Fix styled-components bug github/styled-components/styled-components#3564
  Merge in Minh's short question code. Add dnd to single items.
  EditProperty can auto render with complex paths Modify single items in canvas and inspector
  ...
  • Loading branch information
timiscoding committed Nov 9, 2021
2 parents d7a413e + b0bcd3e commit 89fa67b
Show file tree
Hide file tree
Showing 54 changed files with 5,298 additions and 35,158 deletions.
18 changes: 9 additions & 9 deletions b2b-app/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@

meteor-base@1.5.1 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.12.0 # The database Meteor supports right now
mongo@1.13.0 # The database Meteor supports right now
reactive-var@1.0.11 # Reactive variable for tracker

standard-minifier-css@1.7.3 # CSS minifier run for production mode
standard-minifier-js@2.6.1 # JS minifier run for production mode
standard-minifier-css@1.7.4 # CSS minifier run for production mode
standard-minifier-js@2.7.1 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.15.3 # Enable ECMAScript2015+ syntax in app code
typescript@4.3.5 # Enable TypeScript syntax in .ts and .tsx modules
ecmascript@0.16.0 # Enable ECMAScript2015+ syntax in app code
typescript@4.4.0 # Enable TypeScript syntax in .ts and .tsx modules
shell-server@0.5.0 # Server-side component of the `meteor shell` command

static-html # Define static page content in .html files
static-html@1.3.2 # Define static page content in .html files
react-meteor-data # React higher-order component for reactively tracking Meteor data
aldeed:collection2
fixtures
accounts-base@2.0.1
accounts-base@2.2.0
mikkelking:slingshot
mikkelking:method-hooks
dburles:factory
dburles:mongo-collection-instances
accounts-password@2.0.0
accounts-password@2.2.0
meteortesting:mocha
xolvio:cleaner
alanning:roles@3.3.0
service-configuration@1.1.0
service-configuration@1.3.0
accounts-facebook@1.3.3
accounts-google@1.4.0
accounts-twitter@1.5.0
Expand Down
2 changes: 1 addition & 1 deletion b2b-app/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@2.3.5
METEOR@2.5
60 changes: 30 additions & 30 deletions b2b-app/.meteor/versions
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
accounts-base@2.0.1
accounts-base@2.2.0
accounts-facebook@1.3.3
accounts-google@1.4.0
accounts-oauth@1.3.0
accounts-password@2.0.0
accounts-oauth@1.4.0
accounts-password@2.2.0
accounts-twitter@1.5.0
alanning:roles@3.4.0
aldeed:collection2@3.4.1
aldeed:collection2@3.5.0
allow-deny@1.1.0
autoupdate@1.7.0
autoupdate@1.8.0
babel-compiler@7.7.0
babel-runtime@1.5.0
base64@1.0.12
Expand All @@ -17,25 +17,25 @@ boilerplate-generator@1.7.1
bozhao:link-accounts@2.4.0
caching-compiler@1.2.2
caching-html-compiler@1.2.1
callback-hook@1.3.1
callback-hook@1.4.0
check@1.3.1
dburles:factory@1.1.0
dburles:mongo-collection-instances@0.3.1
ddp@1.4.0
ddp-client@2.5.0
ddp-common@1.4.0
ddp-rate-limiter@1.1.0
ddp-server@2.4.1
ddp-server@2.5.0
diff-sequence@1.1.1
dynamic-import@0.7.1
ecmascript@0.15.3
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.11.1
ecmascript-runtime-server@0.10.1
dynamic-import@0.7.2
ecmascript@0.16.0
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.1
email@2.1.1
email@2.2.0
es5-shim@4.8.0
facebook-oauth@1.9.1
facebook-oauth@1.10.0
fetch@0.1.1
fixtures@1.5.0
geojson-utils@1.0.10
Expand All @@ -50,58 +50,58 @@ inter-process-messaging@0.1.1
johanbrook:publication-collector@1.1.0
launch-screen@1.3.0
localstorage@1.2.0
logging@1.2.0
meteor@1.9.3
logging@1.3.1
meteor@1.10.0
meteor-base@1.5.1
meteortesting:browser-tests@1.3.4
meteortesting:mocha@2.0.2
meteortesting:mocha@2.0.3
meteortesting:mocha-core@8.1.2
mikkelking:method-hooks@3.0.2
mikkelking:slingshot@1.0.0
minifier-css@1.5.4
minifier-js@2.6.1
minifier-css@1.6.0
minifier-js@2.7.1
minimongo@1.7.0
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.5
modules@0.16.0
modern-browsers@0.1.7
modules@0.17.0
modules-runtime@0.12.0
mongo@1.12.0
mongo@1.13.0
mongo-decimal@0.1.2
mongo-dev-server@1.1.0
mongo-id@1.0.8
npm-mongo@3.9.1
oauth@2.0.0
oauth1@1.4.1
oauth@2.1.0
oauth1@1.5.0
oauth2@1.3.1
ordered-dict@1.1.0
promise@0.12.0
raix:eventemitter@1.0.0
random@1.2.0
rate-limit@1.0.9
react-fast-refresh@0.1.1
react-fast-refresh@0.2.0
react-meteor-data@2.3.3
reactive-dict@1.3.0
reactive-var@1.0.11
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
service-configuration@1.1.0
service-configuration@1.3.0
session@1.2.0
sha@1.0.9
shell-server@0.5.0
socket-stream-client@0.4.0
spacebars-compiler@1.3.0
standard-minifier-css@1.7.3
standard-minifier-js@2.6.1
standard-minifier-css@1.7.4
standard-minifier-js@2.7.1
static-html@1.3.2
templating-tools@1.2.1
tmeasday:check-npm-versions@1.0.2
tracker@1.2.0
twitter-oauth@1.3.0
typescript@4.3.5
typescript@4.4.0
underscore@1.0.10
url@1.3.2
webapp@1.11.1
webapp@1.13.0
webapp-hashing@1.1.0
xolvio:cleaner@0.4.0
2 changes: 1 addition & 1 deletion b2b-app/imports/api/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ CONSTANTS.JOB_STATUS_READABLE = {
CONSTANTS.JOB_STATUS_MAPPING = {
new: [{ next: 'in-progress', label: 'Start' }],
'in-progress': [
{ next: 'new', label: 'New' },
{ next: 'quality-check', label: 'Quality Check' },
{ next: 'cancelled', label: 'Cancel' },
],
'quality-check': [
{ next: 'in-progress', label: 'In Progress' },
Expand Down
16 changes: 16 additions & 0 deletions b2b-app/imports/api/courses/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,20 @@ Meteor.methods({
}
}
},
'update.page.courses': ({ id, model }) => {
try {
Courses.update(id, {
$set: {
pageContent: model,
},
})
return { status: 'success', message: 'Added page to course' }
} catch (e) {
console.log(e.message)
return {
status: 'failed',
message: `Error when adding page to course: ${e.message}`,
}
}
},
})
1 change: 1 addition & 0 deletions b2b-app/imports/api/courses/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const CoursesSchema = new SimpleSchema({
allowedValues: ['beginner', 'intermediate', 'advanced'],
defaultValue: 'beginner',
},
pageContent: OptionalBlackbox,
active: {
type: Boolean,
defaultValue: true,
Expand Down
40 changes: 20 additions & 20 deletions b2b-app/imports/api/jobs/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Meteor.methods({
Jobs.update(
{ _id: id },
{
$set: { expectedPickupDate: date },
$set: { pickupDate: date },
$push: {
history: {
userId: me._id,
Expand Down Expand Up @@ -439,19 +439,19 @@ Meteor.methods({
phone: cleanData.memberData?.mobile || undefined,
email: cleanData.memberData?.email || undefined,
address: cleanData.memberData?.address || undefined,
make: cleanData.bikeDetails.make,
model: cleanData.bikeDetails.model,
color: cleanData.bikeDetails.color,
bikeType: cleanData.bikeDetails.type,
// make: cleanData.bikeDetails.make,
// model: cleanData.bikeDetails.model,
// color: cleanData.bikeDetails.color,
// bikeType: cleanData.bikeDetails.type,
bikeName: cleanData.bikeDetails.bikeName,
budget: cleanData.bikeDetails.budget,
bikeValue: cleanData.bikeDetails.approxValue,
serviceItems: cleanData.serviceItems,
note: cleanData.note,
totalCost: cleanData.serviceItems.reduce((a, b) => a + b.price, 0),
dropoffDate: moment(cleanData.pickup.dropOffDate).toDate(),
pickupDate: moment(cleanData.pickup.pickupDate).toDate(),
urgent: cleanData.pickup.urgent,
replacementBike: cleanData.pickup.replacementBike,
dropoffDate: moment(cleanData.bikeDetails.dropoffDate).toDate(),
pickupDate: moment(cleanData.bikeDetails.pickupDate).toDate(),
isRefurbish: data.refurbish === true,
}

if (cleanData.selectedMember?._id) {
Expand Down Expand Up @@ -533,7 +533,7 @@ Meteor.methods({
try {
JobCreateParamsSchema.validate(cleanData)
} catch (e) {
debug(e.message)
debug('validate JobCreateParamsSchema', e.message)
return { status: 'failed', message: e.message }
}

Expand All @@ -553,20 +553,20 @@ Meteor.methods({
phone: cleanData.memberData?.mobile || undefined,
email: cleanData.memberData?.email || undefined,
address: cleanData.memberData?.address || undefined,
make: cleanData.bikeDetails.make,
model: cleanData.bikeDetails.model,
color: cleanData.bikeDetails.color,
bikeType: cleanData.bikeDetails.type,
// make: cleanData.bikeDetails.make,
// model: cleanData.bikeDetails.model,
// color: cleanData.bikeDetails.color,
// bikeType: cleanData.bikeDetails.type,
bikeName: cleanData.bikeDetails.bikeName,
budget: cleanData.bikeDetails.budget,
bikeValue: cleanData.bikeDetails.approxValue,
serviceItems: cleanData.serviceItems,
assessor: cleanData.assessor,
note: cleanData.note,
assessor: cleanData.bikeDetails.assessor,
note: cleanData.bikeDetails.note,
totalCost: cleanData.serviceItems.reduce((a, b) => a + b.price, 0),
dropoffDate: moment(cleanData.pickup.dropOffDate).toDate(),
pickupDate: moment(cleanData.pickup.pickupDate).toDate(),
urgent: cleanData.pickup.urgent,
replacementBike: cleanData.pickup.replacementBike,
dropoffDate: moment(cleanData.bikeDetails.dropoffDate).toDate(),
pickupDate: moment(cleanData.bikeDetails.pickupDate).toDate(),
isRefurbish: data.refurbish === true,
}

if (cleanData.selectedMember?._id) {
Expand Down
48 changes: 23 additions & 25 deletions b2b-app/imports/api/jobs/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,18 @@ export const JobCreateParamsSchema = new SimpleSchema({
'category',
'used'
),
assessor: OptionalString,
note: OptionalString,
bikeDetails: new SimpleSchema({
make: String,
model: String,
color: String,
type: String,
budget: Number,
approxValue: {
assessor: OptionalString,
bikeName: String,
dropoffDate: String,
pickupDate: String,
budget: {
type: Number,
optional: true,
},
note: OptionalString,
}),
hasMember: {
refurbish: {
type: Boolean,
defaultValue: true,
},
Expand All @@ -89,12 +87,12 @@ export const JobCreateParamsSchema = new SimpleSchema({
}),
optional: true,
},
pickup: new SimpleSchema({
urgent: Boolean,
dropOffDate: String,
pickupDate: String,
replacementBike: { type: String, optional: true },
}),
// pickup: new SimpleSchema({
// urgent: Boolean,
// dropOffDate: String,
// pickupDate: String,
// replacementBike: { type: String, optional: true },
// }),
})

export const JobUpdateParamsSchema = new SimpleSchema({
Expand All @@ -116,11 +114,12 @@ export const JobsSchema = new SimpleSchema({
email: { type: String, optional: true, label: 'Customer email' },
address: { type: String, optional: true, label: 'Customer address' },
isRefurbish: { type: Boolean, label: 'Is a refurbishment', defaultValue: false },
make: { type: String, label: 'Bike make' },
model: { type: String, optional: true, label: 'Bike model' },
color: { type: String, label: 'Bike color' },
bikeType: { type: String, optional: true, label: 'Bike Type' },
budget: { type: SimpleSchema.Integer },
bikeName: String,
// make: { type: String, label: 'Bike make' },
// model: { type: String, optional: true, label: 'Bike model' },
// color: { type: String, label: 'Bike color' },
// bikeType: { type: String, optional: true, label: 'Bike Type' },
budget: { type: SimpleSchema.Integer, optional: true },
bikeValue: {
type: SimpleSchema.Integer,
label: 'Estimated bike value in cents',
Expand Down Expand Up @@ -163,11 +162,10 @@ export const JobsSchema = new SimpleSchema({
note: OptionalString,
dropoffDate: { type: Date, label: 'Bike drop-off date' },
pickupDate: { type: Date, label: 'Bike pick-up date' },
expectedPickupDate: { type: Date, optional: true, label: 'Expected pickup date' },
urgent: {
type: Boolean,
label: 'Field to indicate if bike repair is urgent',
},
// urgent: {
// type: Boolean,
// label: 'Field to indicate if bike repair is urgent',
// },
assessor: { type: String, optional: true, label: 'Assessor name' },
mechanic: { type: RegExId, optional: true, label: 'Mechanic user id' },
comment: {
Expand Down
4 changes: 2 additions & 2 deletions b2b-app/imports/api/sessions/server/publications.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ Meteor.publish('sessions.myByIdComposite', function (id) {
})

// debug(this)

return [sessions]
const courses = Courses.find({})
return [sessions, courses]
})

Meteor.publish('sessions.myById', function (id) {
Expand Down
2 changes: 1 addition & 1 deletion b2b-app/imports/api/surveys/survey-schema-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ const getSchemas = (survey, currentData) => {
delete step.schema[q.id]
q.type = 'paragraph'
q.prompt = `Unknown question type for "${q.prompt}"`
console.error(`Unsupported question type: ${q.type}`)
console.log(`Unsupported question type: [${q.type}]`)
}
})
}
Expand Down

0 comments on commit 89fa67b

Please sign in to comment.