From dcd632b77c5eb589c64f4497752a367234bf8778 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Thu, 18 Apr 2019 19:51:41 +0100 Subject: [PATCH 01/22] Trigger Heroku deploy after enabling collectstatic From e0c7fad4c3c1d4fcc31e495bdc745a58a76c990f Mon Sep 17 00:00:00 2001 From: RomanGalochkin Date: Fri, 19 Apr 2019 10:43:24 +0300 Subject: [PATCH 02/22] Hot fix migration --- server/migrations/20190318001102-addServiceAccount.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/migrations/20190318001102-addServiceAccount.js b/server/migrations/20190318001102-addServiceAccount.js index 75a14ebc3..7c99a57bd 100644 --- a/server/migrations/20190318001102-addServiceAccount.js +++ b/server/migrations/20190318001102-addServiceAccount.js @@ -7,15 +7,15 @@ module.exports = { ); if (users.length === 0) { const [agents] = await queryInterface.sequelize.query( - `INSERT INTO "Agents" ("id", "type") ` + - `VALUES (uuid_generate_v4(), 'USER')` + + `INSERT INTO "Agents" ("id", "type", "createdAt", "updatedAt") ` + + `VALUES (uuid_generate_v4(), 'USER', now(), now())` + `RETURNING "id"` ); const agentId = _.get(agents, [0, 'id']); await queryInterface.sequelize.query( - `INSERT INTO "Users" ("id", "name", "auth0Id", "agentId") ` + + `INSERT INTO "Users" ("id", "name", "auth0Id", "agentId", "createdAt", "updatedAt") ` + `VALUES ` + - `(uuid_generate_v4(), 'Service Account', uuid_generate_v4(), '${agentId}')` + `(uuid_generate_v4(), 'Service Account', uuid_generate_v4(), '${agentId}', now(), now())` ); } }, From 6cd92ec402f21699362b63493b82da0d158e0d77 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Apr 2019 19:22:40 +0100 Subject: [PATCH 03/22] Minor fix for archived button --- .../Foretold__Components__Measurable__Items.re | 17 +++++++++-------- client/src/contexts/Context__Primary.re | 3 +++ .../graphql/Foretold__GraphQL__ChannelJoin.re | 7 ++++++- .../graphql/Foretold__GraphQL__ChannelLeave.re | 7 ++++++- .../Foretold__GraphQL__GetMeasurables.re | 3 +++ 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/client/src/components/Foretold__Components__Measurable__Items.re b/client/src/components/Foretold__Components__Measurable__Items.re index 35d7784b8..93e3c67eb 100644 --- a/client/src/components/Foretold__Components__Measurable__Items.re +++ b/client/src/components/Foretold__Components__Measurable__Items.re @@ -173,16 +173,18 @@ let resolutionEndpoint = (~m: measurable) => }; let archiveButton = (~m: measurable) => - Foretold__GraphQL.Mutations.MeasurableUnarchive.Mutation.make((mutation, _) => + Foretold__GraphQL.Mutations.MeasurableArchive.Mutation.make((mutation, _) =>
- Foretold__GraphQL.Mutations.MeasurableUnarchive.mutate( + e => { + Foretold__GraphQL.Mutations.MeasurableArchive.mutate( mutation, m.id, - ) + ); + ReactEvent.Synthetic.preventDefault(e); + } }> {"Archive" |> ste}
@@ -191,13 +193,13 @@ let archiveButton = (~m: measurable) => |> E.React.el; let unArchiveButton = (~m: measurable) => - Foretold__GraphQL.Mutations.MeasurableArchive.Mutation.make((mutation, _) => + Foretold__GraphQL.Mutations.MeasurableUnarchive.Mutation.make((mutation, _) =>
- Foretold__GraphQL.Mutations.MeasurableArchive.mutate( + Foretold__GraphQL.Mutations.MeasurableUnarchive.mutate( mutation, m.id, ) @@ -209,5 +211,4 @@ let unArchiveButton = (~m: measurable) => |> E.React.el; let archiveOption = (~m: measurable) => - Measurable.toStatus(m) !== `ARCHIVED ? - archiveButton(~m) : unArchiveButton(~m); \ No newline at end of file + m.isArchived == Some(true) ? unArchiveButton(~m) : archiveButton(~m); \ No newline at end of file diff --git a/client/src/contexts/Context__Primary.re b/client/src/contexts/Context__Primary.re index 3cdeb3eb9..864babd1c 100644 --- a/client/src/contexts/Context__Primary.re +++ b/client/src/contexts/Context__Primary.re @@ -320,6 +320,7 @@ module Measurable = { name: string, valueType, channel: option(string), + isArchived: option(bool), resolutionEndpoint: option(string), resolutionEndpointResponse: option(float), measurementCount: option(int), @@ -383,6 +384,7 @@ module Measurable = { ~labelProperty=None, ~labelCustom=None, ~series=None, + ~isArchived=None, ~iAmOwner=None, (), ) => { @@ -406,6 +408,7 @@ module Measurable = { labelProperty, labelCustom, series, + isArchived, iAmOwner, }; }; \ No newline at end of file diff --git a/client/src/graphql/Foretold__GraphQL__ChannelJoin.re b/client/src/graphql/Foretold__GraphQL__ChannelJoin.re index f46624263..327e631fa 100644 --- a/client/src/graphql/Foretold__GraphQL__ChannelJoin.re +++ b/client/src/graphql/Foretold__GraphQL__ChannelJoin.re @@ -15,7 +15,12 @@ let mutate = (mutation: Mutation.apolloMutation, channelId) => { Query.make(~input={"channelId": Some(channelId), "role": `VIEWER}, ()); mutation( ~variables=m##variables, - ~refetchQueries=[|"getChannels", "user"|], + ~refetchQueries=[| + "getChannels", + "getChannel", + "getChannelMemberships", + "user", + |], (), ) |> ignore; diff --git a/client/src/graphql/Foretold__GraphQL__ChannelLeave.re b/client/src/graphql/Foretold__GraphQL__ChannelLeave.re index 42fe12fc7..84b1ba1ea 100644 --- a/client/src/graphql/Foretold__GraphQL__ChannelLeave.re +++ b/client/src/graphql/Foretold__GraphQL__ChannelLeave.re @@ -14,7 +14,12 @@ let mutate = (mutation: Mutation.apolloMutation, channelId) => { let m = Query.make(~input={"channelId": Some(channelId)}, ()); mutation( ~variables=m##variables, - ~refetchQueries=[|"getChannels", "user", "getChannelMemberships"|], + ~refetchQueries=[| + "getChannels", + "user", + "getChannel", + "getChannelMemberships", + |], (), ) |> ignore; diff --git a/client/src/graphql/Foretold__GraphQL__GetMeasurables.re b/client/src/graphql/Foretold__GraphQL__GetMeasurables.re index 55a382202..0b0525c3f 100644 --- a/client/src/graphql/Foretold__GraphQL__GetMeasurables.re +++ b/client/src/graphql/Foretold__GraphQL__GetMeasurables.re @@ -47,6 +47,7 @@ type measurable = { stateUpdatedAt: option(MomentRe.Moment.t), creator: option(creator), series: option(series), + isArchived: bool, labelOnDate: option(MomentRe.Moment.t), labelProperty: option(string), }; @@ -57,6 +58,7 @@ let toMeasurable = (m: measurable): Context.Primary.Measurable.t => ~id=m.id, ~name=m.name, ~channel=None, + ~isArchived=Some(m.isArchived), ~valueType=m.valueType, ~labelCustom=m.labelCustom, ~resolutionEndpoint=m.resolutionEndpoint, @@ -96,6 +98,7 @@ module Query = [%graphql labelSubject labelProperty iAmOwner + isArchived labelOnDate @bsDecoder(fn: "E.J.O.toMoment") state @bsDecoder(fn: "Context.Primary.MeasurableState.fromEnum") stateUpdatedAt @bsDecoder(fn: "E.J.O.toMoment") From 868faab60125f9c56025c4ecc39cc808021495e2 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Apr 2019 19:34:32 +0100 Subject: [PATCH 04/22] Updated terminology --- client/src/components/Foretold__Components__Channel.re | 2 +- .../Foretold__Components__Measurable__FullPresentation.re | 4 ++-- client/src/contexts/Context__Primary.re | 4 ++-- client/src/layout/Channel_Layout.re | 2 +- client/src/layout/Layout__Component__Sidebar.re | 4 ++-- client/src/lib/Style.re | 1 - client/src/lib/cdfInput/CdfInput.re | 4 ++-- client/src/pages/Measurable/MeasurableEdit/MeasurableEdit.re | 2 +- client/src/pages/Measurable/MeasurableNew/MeasurableNew.re | 2 +- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/client/src/components/Foretold__Components__Channel.re b/client/src/components/Foretold__Components__Channel.re index dfef8de99..04dcead5e 100644 --- a/client/src/components/Foretold__Components__Channel.re +++ b/client/src/components/Foretold__Components__Channel.re @@ -24,7 +24,7 @@ module SimpleHeader = {
; let newMeasurable = channelId => - buttonr("New Measurable", MeasurableNew(channelId)); + buttonr("New Question", MeasurableNew(channelId)); let editChannel = channelId => buttonr("Edit Channel", ChannelEdit(channelId)); diff --git a/client/src/components/Foretold__Components__Measurable__FullPresentation.re b/client/src/components/Foretold__Components__Measurable__FullPresentation.re index 8745fa25b..e98036863 100644 --- a/client/src/components/Foretold__Components__Measurable__FullPresentation.re +++ b/client/src/components/Foretold__Components__Measurable__FullPresentation.re @@ -61,14 +61,14 @@ let make = (~id: string, ~loggedInUser: Context.Primary.User.t, _children) => { let creatorId = m.creator |> E.O.fmap((r: Context.Primary.Agent.t) => r.id); <> - {"Add a Measurement" |> ste |> E.React.inH2} + {"Add a Prediction" |> ste |> E.React.inH2} ; } - {"Measurements" |> ste |> E.React.inH2} + {"Predictions" |> ste |> E.React.inH2} { m.measurements |> E.O.React.fmapOrNull( diff --git a/client/src/contexts/Context__Primary.re b/client/src/contexts/Context__Primary.re index 864babd1c..3395d1b00 100644 --- a/client/src/contexts/Context__Primary.re +++ b/client/src/contexts/Context__Primary.re @@ -114,8 +114,8 @@ module Bot = { let toString = (c: competitorType) => switch (c) { | `AGGREGATION => "Aggregation" - | `COMPETITIVE => "Competitive" - | `OBJECTIVE => "Judge" + | `COMPETITIVE => "Prediction" + | `OBJECTIVE => "Judgement" }; }; let make = diff --git a/client/src/layout/Channel_Layout.re b/client/src/layout/Channel_Layout.re index cb89f2426..60054648d 100644 --- a/client/src/layout/Channel_Layout.re +++ b/client/src/layout/Channel_Layout.re @@ -94,7 +94,7 @@ let tabs = (o: TopTab.t, channel: Context.Primary.Channel.t) => button( Measurables |> toS, Measurables |> toUrl, - "Measurables", + "Questions", channel.id, ) } diff --git a/client/src/layout/Layout__Component__Sidebar.re b/client/src/layout/Layout__Component__Sidebar.re index 4d2efc0f0..e1af63b0a 100644 --- a/client/src/layout/Layout__Component__Sidebar.re +++ b/client/src/layout/Layout__Component__Sidebar.re @@ -91,14 +91,14 @@ let make = (~channelId, ~loggedInUser: Context.Primary.User.t, _children) => {
Context.Routing.Url.push(AgentShow(r.id))} className=Styles.item> - {"My Measurements" |> ste} + {"My Predictions" |> ste}
) }
Context.Routing.Url.push(AgentMeasurables(idd))} className=Styles.item> - {"My Measurables" |> ste} + {"My Questions" |> ste}
Context.Routing.Url.push(EntityIndex)} diff --git a/client/src/lib/Style.re b/client/src/lib/Style.re index 4fa01ffd6..aee8ffbe5 100644 --- a/client/src/lib/Style.re +++ b/client/src/lib/Style.re @@ -4,7 +4,6 @@ module BorderedBox = { open Css; let item = style([ - maxWidth(px(1500)), display(`flex), flexDirection(`row), padding(px(12)), diff --git a/client/src/lib/cdfInput/CdfInput.re b/client/src/lib/cdfInput/CdfInput.re index 8e4aa49ba..6be42b447 100644 --- a/client/src/lib/cdfInput/CdfInput.re +++ b/client/src/lib/cdfInput/CdfInput.re @@ -35,8 +35,8 @@ let competitorType = (~state, ~send) => ; let dataType = (~state, ~send) => diff --git a/client/src/pages/Measurable/MeasurableEdit/MeasurableEdit.re b/client/src/pages/Measurable/MeasurableEdit/MeasurableEdit.re index a9641a285..05a4bcf22 100644 --- a/client/src/pages/Measurable/MeasurableEdit/MeasurableEdit.re +++ b/client/src/pages/Measurable/MeasurableEdit/MeasurableEdit.re @@ -109,7 +109,7 @@ let make = (~id: string, ~layout=SLayout.FullPage.makeWithEl, _children) => { ...component, render: _self => SLayout.LayoutConfig.make( - ~head=SLayout.Header.textDiv("My Measurable"), + ~head=SLayout.Header.textDiv("My Questions"), ~body=Queries.Measurable.component(~id, m => formCreation(id, m)), ) |> layout, diff --git a/client/src/pages/Measurable/MeasurableNew/MeasurableNew.re b/client/src/pages/Measurable/MeasurableNew/MeasurableNew.re index d278989a2..42ba15e9f 100644 --- a/client/src/pages/Measurable/MeasurableNew/MeasurableNew.re +++ b/client/src/pages/Measurable/MeasurableNew/MeasurableNew.re @@ -95,7 +95,7 @@ let make = (~channelId, ~layout=SLayout.FullPage.makeWithEl, _children) => { ); SLayout.LayoutConfig.make( - ~head=SLayout.Header.textDiv("New Measurable"), + ~head=SLayout.Header.textDiv("New Question"), ~body= CreateMeasurableMutation.Mutation.make( ~onCompleted= From dd45a90d708339fdca2eba2352f9cbc163e2ca5a Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 10:57:15 +0100 Subject: [PATCH 05/22] Improved question form --- client/src/pages/Measurable/MeasurableForm.re | 204 +++++++++--------- client/src/utils/Antd/AntdForm.re | 92 ++++++++ client/src/utils/Antd/DatePicker.re | 7 +- 3 files changed, 198 insertions(+), 105 deletions(-) create mode 100644 client/src/utils/Antd/AntdForm.re diff --git a/client/src/pages/Measurable/MeasurableForm.re b/client/src/pages/Measurable/MeasurableForm.re index 7bf177e0d..6b8271c8f 100644 --- a/client/src/pages/Measurable/MeasurableForm.re +++ b/client/src/pages/Measurable/MeasurableForm.re @@ -74,119 +74,117 @@ module SignUpParams = { module SignUpForm = ReForm.Create(SignUpParams); let showForm = (~form: SignUpForm.state, ~handleSubmit, ~handleChange) => -
- - - {"Relevant Entity (optional)" |> ste |> E.React.inH3} - - - - {"Property Type" |> ste |> E.React.inH3 |> E.React.inH3} - - {"Custom Name" |> ste} - {"Property Entity" |> ste} - - - { - form.values.showDescriptionProperty == "TRUE" ? - - {"Property Entity Name" |> ste |> E.React.inH3} + + + + {"Simple" |> ste} + + {"Subject-Property-Date" |> ste} + + + + { + E.React.showIf( + form.values.showDescriptionProperty == "TRUE", + <> + - : -
- } - { - form.values.showDescriptionProperty == "FALSE" ? - - {"Custom Name" |> ste} + + - : -
- } - - {"Include a Specific Date in Name" |> ste |> E.React.inH3} - handleChange(`showDescriptionDate, e ? "TRUE" : "FALSE") - } - /> - - { - form.values.showDescriptionDate == "TRUE" ? - - {"'On' Date" |> ste |> E.React.inH3} - MomentRe.moment} - onChange={e => handleChange(`labelOnDate, e |> formatDate)} + + + handleChange(`showDescriptionDate, e ? "TRUE" : "FALSE") + } /> - : -
- } - - {"Description" |> ste |> E.React.inH3} - + { + form.values.showDescriptionDate == "TRUE" ? + + MomentRe.moment} + onChange={ + e => { + handleChange(`labelOnDate, e |> formatDate); + handleChange(`expectedResolutionDate, e |> formatDate); + } + } + /> + : +
} - /> - - - {"Resolution Endpoint (Optional)" |> ste |> E.React.inH3} - { - "If you enter an url that returns a number, this will be called when the resolution date occurs, and entered as a judgement value." - |> ste - |> E.React.inP + , + ) + } + { + E.React.showIf( + form.values.showDescriptionProperty == "FALSE", + + + , + ) + } + + - - - {"Expected Resolution Date" |> ste |> E.React.inH3} - MomentRe.momentDefaultFormat - } - onChange={ - e => handleChange(`expectedResolutionDate, e |> formatDate) - } - /> - - - - - - ; \ No newline at end of file + /> + + + + + + MomentRe.momentDefaultFormat + } + onChange={e => handleChange(`expectedResolutionDate, e |> formatDate)} + disabled={form.values.showDescriptionDate == "TRUE"} + /> + + + + + ; \ No newline at end of file diff --git a/client/src/utils/Antd/AntdForm.re b/client/src/utils/Antd/AntdForm.re new file mode 100644 index 000000000..04e4a9b14 --- /dev/null +++ b/client/src/utils/Antd/AntdForm.re @@ -0,0 +1,92 @@ +[@bs.module "antd/lib/form"] external form: ReasonReact.reactClass = "default"; + +[%bs.raw {|require("antd/lib/form/style")|}]; + +let wrapperCol: Js.Json.t = + {|{"xs":{"span": 24}, "sm": {"span": 12}}|} |> Json.parseOrRaise; + +let labelCol: Js.Json.t = + {|{"xs":{"span": 24}, "sm": {"span": 5}}|} |> Json.parseOrRaise; + +[@bs.obj] +external makeProps: + ( + ~onSubmit: ReactEvent.Form.t => unit=?, + ~hideRequiredMark: bool=?, + ~id: string=?, + ~className: string=?, + ~style: ReactDOMRe.Style.t=?, + ~colon: bool=?, + ~wrapperCol: Js.Json.t=?, + ~labelCol: Js.Json.t=?, + ~validateStatus: string=?, + ~extra: string=?, + ~required: bool=?, + ~label: string=?, + ~help: string=?, + ~hasFeedback: bool=?, + unit + ) => + _ = + ""; + +let make = + ( + ~onSubmit=?, + ~hideRequiredMark=?, + ~id=?, + ~className=?, + ~style=?, + children, + ) => + ReasonReact.wrapJsForReason( + ~reactClass=form, + ~props= + makeProps( + ~onSubmit?, + ~hideRequiredMark?, + ~id?, + ~wrapperCol, + ~labelCol, + ~className?, + ~style?, + (), + ), + children, + ); +module Item = { + [@bs.module "antd/lib/form/FormItem"] + external item: ReasonReact.reactClass = "default"; + let make = + ( + ~colon=?, + ~validateStatus=?, + ~extra=?, + ~className=?, + ~required=?, + ~style=?, + ~label=?, + ~id=?, + ~help=?, + ~hasFeedback=?, + children, + ) => + ReasonReact.wrapJsForReason( + ~reactClass=item, + ~props= + makeProps( + ~colon?, + ~validateStatus?, + ~extra?, + ~className?, + ~required?, + ~style?, + ~label?, + ~id?, + ~help?, + ~hasFeedback?, + (), + ), + children, + ); +}; \ No newline at end of file diff --git a/client/src/utils/Antd/DatePicker.re b/client/src/utils/Antd/DatePicker.re index 2d47826f0..56c31a855 100644 --- a/client/src/utils/Antd/DatePicker.re +++ b/client/src/utils/Antd/DatePicker.re @@ -8,6 +8,7 @@ external makeProps: ( ~className: string=?, ~style: ReactDOMRe.Style.t=?, + ~disabled: bool, ~value: MomentRe.Moment.t=?, ~onChange: MomentRe.Moment.t => unit=?, unit @@ -15,9 +16,11 @@ external makeProps: _ = ""; -let make = (~className=?, ~style=?, ~onChange=?, ~value=?, children) => +let make = + (~className=?, ~style=?, ~onChange=?, ~value=?, ~disabled=false, children) => ReasonReact.wrapJsForReason( ~reactClass, - ~props=makeProps(~className?, ~style?, ~onChange?, ~value?, ()), + ~props= + makeProps(~className?, ~style?, ~onChange?, ~value?, ~disabled, ()), children, ); \ No newline at end of file From e04f532e1adad4ac1854a0a9ec40d9c4191bdbfa Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 11:30:03 +0100 Subject: [PATCH 06/22] Added select for subject & property --- client/src/EKen.re | 12 +++++ client/src/pages/Entity/EntityIndex.re | 9 ++-- client/src/pages/Measurable/MeasurableForm.re | 48 ++++++++++++------- client/src/utils/Antd/AntdSelect.re | 44 +++++++++++++++++ 4 files changed, 89 insertions(+), 24 deletions(-) create mode 100644 client/src/EKen.re create mode 100644 client/src/utils/Antd/AntdSelect.re diff --git a/client/src/EKen.re b/client/src/EKen.re new file mode 100644 index 000000000..0c177b222 --- /dev/null +++ b/client/src/EKen.re @@ -0,0 +1,12 @@ +module Thing = { + type t = Graph_T.T.thing; + let getName = (t: t) => + t |> Graph_T.Thing.id |> C.Ken.findName |> E.O.default(""); + let hasName = (t: t) => getName(t) != ""; +}; + +module Things = { + type t = array(Thing.t); + let getAll = C.Ken.things; + let withNames = E.A.filter(Thing.hasName); +}; \ No newline at end of file diff --git a/client/src/pages/Entity/EntityIndex.re b/client/src/pages/Entity/EntityIndex.re index 91abfde49..6ec6d271f 100644 --- a/client/src/pages/Entity/EntityIndex.re +++ b/client/src/pages/Entity/EntityIndex.re @@ -28,17 +28,14 @@ let columns = [| ), |]; -let getName = (t: Graph_T.T.thing) => - t |> Graph_T.Thing.id |> C.Ken.findName |> E.O.default(""); - let dataSource = - C.Ken.things - |> E.A.filter(r => getName(r) != "") + EKen.Things.getAll + |> EKen.Things.withNames |> E.A.fmap((r: Graph_T.T.thing) => { "key": r |> Graph_T.Thing.id, "id": r |> Graph_T.Thing.id, - "name": r |> getName, + "name": r |> EKen.Thing.getName, } ); diff --git a/client/src/pages/Measurable/MeasurableForm.re b/client/src/pages/Measurable/MeasurableForm.re index 6b8271c8f..ec649fa30 100644 --- a/client/src/pages/Measurable/MeasurableForm.re +++ b/client/src/pages/Measurable/MeasurableForm.re @@ -73,6 +73,22 @@ module SignUpParams = { module SignUpForm = ReForm.Create(SignUpParams); +let dataSource = + EKen.Things.getAll + |> EKen.Things.withNames + |> E.A.fmap((r: Graph_T.T.thing) => + {"key": r |> Graph_T.Thing.id, "id": r |> Graph_T.Thing.id} + ); + +let dataSourceSelectItems = + dataSource + |> E.A.fmap(r => + + {r##id |> ste} + + ) + |> ReasonReact.array; + let showForm = (~form: SignUpForm.state, ~handleSubmit, ~handleChange) => @@ -94,25 +110,19 @@ let showForm = (~form: SignUpForm.state, ~handleSubmit, ~handleChange) => E.React.showIf( form.values.showDescriptionProperty == "TRUE", <> - - + + onChange={e => handleChange(`labelSubject, e)}> + dataSourceSelectItems + - - + + onChange={e => handleChange(`labelProperty, e)}> + dataSourceSelectItems + { E.React.showIf( form.values.showDescriptionProperty == "FALSE", - + } /> - + MomentRe.momentDefaultFormat diff --git a/client/src/utils/Antd/AntdSelect.re b/client/src/utils/Antd/AntdSelect.re new file mode 100644 index 000000000..8a63c0127 --- /dev/null +++ b/client/src/utils/Antd/AntdSelect.re @@ -0,0 +1,44 @@ +[@bs.module "antd/lib/select"] +external select: ReasonReact.reactClass = "default"; + +[%bs.raw {|require("antd/lib/select/style")|}]; + +[@bs.obj] +external makeProps: + ( + ~value: string=?, + ~defaultValue: string=?, + ~showSearch: bool=?, + ~onChange: string => unit=?, + ~className: string=?, + unit + ) => + _ = + ""; +let make = (~value=?, ~defaultValue=?, ~onChange=?, ~className=?, children) => + ReasonReact.wrapJsForReason( + ~reactClass=select, + ~props= + makeProps( + ~value?, + ~defaultValue?, + ~onChange?, + ~className?, + ~showSearch=true, + (), + ), + children, + ); + +module Option = { + [@bs.scope "default"] [@bs.module "antd/lib/select"] + external reactClass: ReasonReact.reactClass = "Option"; + + [@bs.obj] external makeProps: (~value: string, ~title: string=?) => _ = ""; + + let make = (~value, ~title=?) => + ReasonReact.wrapJsForReason( + ~reactClass, + ~props=makeProps(~value, ~title?), + ); +}; \ No newline at end of file From f085b6503890e8d67fc6dd31b87027aa7b9d20ee Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 11:51:11 +0100 Subject: [PATCH 07/22] Added instance-of to ken entities --- client/src/EKen.re | 2 ++ .../components/Foretold__Components__Ken.re | 14 +++++++++++++ client/src/pages/Entity/EntityIndex.re | 21 +++++++++++++------ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/client/src/EKen.re b/client/src/EKen.re index 0c177b222..29e99cfb1 100644 --- a/client/src/EKen.re +++ b/client/src/EKen.re @@ -2,6 +2,8 @@ module Thing = { type t = Graph_T.T.thing; let getName = (t: t) => t |> Graph_T.Thing.id |> C.Ken.findName |> E.O.default(""); + let getInstanceOfName = (t: t) => + t |> Graph_T.Thing.id |> C.Ken.findInstanceOfName |> E.O.default(""); let hasName = (t: t) => getName(t) != ""; }; diff --git a/client/src/components/Foretold__Components__Ken.re b/client/src/components/Foretold__Components__Ken.re index 1a859301c..81b5b6f78 100644 --- a/client/src/components/Foretold__Components__Ken.re +++ b/client/src/components/Foretold__Components__Ken.re @@ -18,6 +18,20 @@ let findName = propertyId => } ); +let findInstanceOfName = propertyId => + graph + |> Graph_T.F.factList + |> Graph_Fact_Filters.withSubject(propertyId) + |> Graph_Fact_Filters.withProperty("@base/properties/p-instance-of") + |> E.L.head + |> E.O.bind(_, (k: Graph_T.T.fact) => + switch (k.value.valueType) { + | String(s) => Some(s) + | ThingId(s) => findName(s) + | _ => None + } + ); + let names = subjectId => graph |> Graph_T.F.factList diff --git a/client/src/pages/Entity/EntityIndex.re b/client/src/pages/Entity/EntityIndex.re index 6ec6d271f..ee05628b4 100644 --- a/client/src/pages/Entity/EntityIndex.re +++ b/client/src/pages/Entity/EntityIndex.re @@ -5,9 +5,9 @@ let component = ReasonReact.statelessComponent("EntityShow"); let columns = [| Antd.Table.TableProps.make_column( - ~title="Agent", - ~dataIndex="agent", - ~key="agent", + ~title="Name", + ~dataIndex="name", + ~key="name", ~width=2, ~render= (~text, ~record, ~index) => @@ -19,9 +19,17 @@ let columns = [| (), ), Antd.Table.TableProps.make_column( - ~title="Remove", - ~dataIndex="role", - ~key="actions2", + ~title="Instance Of", + ~dataIndex="instance", + ~key="instance", + ~width=2, + ~render=(~text, ~record, ~index) => record##instance |> ste, + (), + ), + Antd.Table.TableProps.make_column( + ~title="Id", + ~dataIndex="id", + ~key="id", ~width=2, ~render=(~text, ~record, ~index) => record##id |> ste, (), @@ -36,6 +44,7 @@ let dataSource = "key": r |> Graph_T.Thing.id, "id": r |> Graph_T.Thing.id, "name": r |> EKen.Thing.getName, + "instance": r |> EKen.Thing.getInstanceOfName, } ); From 1cb4200a5bfacdd08ab06872e0f64a7ed2185e76 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 18:15:07 +0100 Subject: [PATCH 08/22] Simple Antd Dropdown --- .../Foretold__Components__Channel.re | 1 - .../Foretold__Components__Shared.re | 2 +- client/src/components/SLayout.re | 30 ++- client/src/layout/Channel_Layout.re | 25 ++- .../Layout__Component__FillWithSidebar.re | 6 +- .../src/layout/Layout__Component__Header.re | 78 +++++++ client/src/utils/Antd/AntdDropdown.re | 209 ++++++++++++++++++ client/src/utils/Antd/AntdDropdown2.js | 28 +++ client/src/utils/Antd/AntdDropdown2.re | 12 + client/src/utils/Antd/AntdPopover.re | 117 ++++++++++ 10 files changed, 489 insertions(+), 19 deletions(-) create mode 100644 client/src/layout/Layout__Component__Header.re create mode 100644 client/src/utils/Antd/AntdDropdown.re create mode 100644 client/src/utils/Antd/AntdDropdown2.js create mode 100644 client/src/utils/Antd/AntdDropdown2.re create mode 100644 client/src/utils/Antd/AntdPopover.re diff --git a/client/src/components/Foretold__Components__Channel.re b/client/src/components/Foretold__Components__Channel.re index 04dcead5e..80d84197f 100644 --- a/client/src/components/Foretold__Components__Channel.re +++ b/client/src/components/Foretold__Components__Channel.re @@ -6,7 +6,6 @@ module SimpleHeader = { open Css; let header = style([ - borderBottom(`px(1), `solid, `hex("eee")), paddingLeft(`px(10)), paddingBottom(`em(0.8)), paddingRight(`em(0.4)), diff --git a/client/src/components/Foretold__Components__Shared.re b/client/src/components/Foretold__Components__Shared.re index 3217c7ad5..4c38419e0 100644 --- a/client/src/components/Foretold__Components__Shared.re +++ b/client/src/components/Foretold__Components__Shared.re @@ -9,7 +9,7 @@ module Item = { color(`hex("bbb")), selector( " a", - [color(`hex("777")), selector(":hover", [color(hex("333"))])], + [color(`hex("aaa")), selector(":hover", [color(hex("333"))])], ), ]); diff --git a/client/src/components/SLayout.re b/client/src/components/SLayout.re index 8be067210..271b6d8b8 100644 --- a/client/src/components/SLayout.re +++ b/client/src/components/SLayout.re @@ -7,10 +7,10 @@ module Styles = { let header = style([ borderBottom(`px(1), `solid, `hex("eee")), - paddingLeft(`px(10)), + paddingLeft(`em(1.)), paddingBottom(`em(0.8)), - paddingRight(`em(0.4)), - paddingTop(`px(10)), + paddingRight(`em(1.)), + paddingTop(`em(1.5)), float(`left), width(`percent(100.)), ]); @@ -52,6 +52,15 @@ module Styles = { fontWeight(`bold), float(`left), ]); + let largeCardOuter = style([padding(`em(0.3))]); + let largeCardInner = + style([ + background(`hex("fff")), + borderRadius(`px(5)), + padding(`em(1.)), + width(`percent(100.)), + float(`left), + ]); let mainSection = style([ float(`left), @@ -71,6 +80,16 @@ module Styles = { ]); }; +module LargeCard = { + let component = ReasonReact.statelessComponent("LargeCard"); + let make = children => { + ...component, + render: _ => +
+
...children
+
, + }; +}; module Header = { let component = ReasonReact.statelessComponent("Header"); let textDiv = text =>
{text |> ste}
; @@ -85,7 +104,10 @@ module MainSection = { let component = ReasonReact.statelessComponent("MainSection"); let make = children => { ...component, - render: _ =>
...children
, + render: _ => +
+ ...children +
, }; }; diff --git a/client/src/layout/Channel_Layout.re b/client/src/layout/Channel_Layout.re index 60054648d..e066d71b7 100644 --- a/client/src/layout/Channel_Layout.re +++ b/client/src/layout/Channel_Layout.re @@ -196,15 +196,10 @@ let make = E.HttpResponse.fmap((channel: Context.Primary.Channel.t) => switch (topOption) { | Members(r) => - -
- {memberTabs(loggedInUser.agent, r, channel)} -
-
- | Options(r) => - -
{editTabs(r, channel)}
-
+
+ {memberTabs(loggedInUser.agent, r, channel)} +
+ | Options(r) =>
{editTabs(r, channel)}
| _ => E.React.null } ) @@ -214,9 +209,15 @@ let make =
top
- bottomHeader - head - body + +
+
+ bottomHeader + head +
+
body
+
+
; }, }; diff --git a/client/src/layout/Layout__Component__FillWithSidebar.re b/client/src/layout/Layout__Component__FillWithSidebar.re index 61012e5a6..5700dc67b 100644 --- a/client/src/layout/Layout__Component__FillWithSidebar.re +++ b/client/src/layout/Layout__Component__FillWithSidebar.re @@ -9,6 +9,7 @@ module Styles = { display(`flex), flexDirection(`row), minHeight(`percent(100.0)), + backgroundColor(`hex("F0F2F5")), ]); let left = style([ @@ -33,7 +34,10 @@ let make =
-
..._children
+
+ +
..._children
+
, }; \ No newline at end of file diff --git a/client/src/layout/Layout__Component__Header.re b/client/src/layout/Layout__Component__Header.re new file mode 100644 index 000000000..2433b8069 --- /dev/null +++ b/client/src/layout/Layout__Component__Header.re @@ -0,0 +1,78 @@ +open Utils; +open Style.Grid; +open Foretold__GraphQL; + +module Styles = { + open Css; + let outer = + style([ + padding2(~v=`em(1.5), ~h=`em(2.)), + float(`left), + backgroundColor(`rgb((255, 255, 255))), + width(`percent(100.)), + borderBottom(`px(2), `solid, `rgb((234, 234, 234))), + ]); + let left = + style([ + flex(1), + backgroundColor(`hex("2c436e")), + minWidth(`px(200)), + ]); + let right = style([flex(7), width(`percent(100.0))]); +}; + +let foo: ReasonReact.reactElement = "sdf" |> ste; + +let component = ReasonReact.statelessComponent("Header"); + +let bar = agentId => + + +
Context.Routing.Url.push(Profile)}> + {"Profile" |> ste} +
+
+ +
Context.Routing.Url.push(AgentMeasurables(agentId))}> + {"My Questions" |> ste} +
+
+ +
Context.Routing.Url.push(AgentBots(agentId))}> + {"My Bots" |> ste} +
+
+ +
Context.Routing.Url.push(AgentShow(agentId))}> + {"My Predictions" |> ste} +
+
+ +
Context.Auth.Actions.logout()}> + {"Log Out" |> ste} +
+
+
; + +let header = (loggedInUser: Context.Primary.User.t) => { + let id = + loggedInUser.agent |> E.O.fmap((a: Context.Primary.Agent.t) => a.id); + switch (id) { + | Some(id) => + {"OzzieGooen" |> ste} + | None => ReasonReact.null + }; +}; +let make = (~loggedInUser: Context.Primary.User.t, _children) => { + ...component, + render: _self => +
+
+
Context.Routing.Url.push(EntityIndex)}> + {"Entity List" |> ste} +
+
+
{header(loggedInUser)}
+
, +}; \ No newline at end of file diff --git a/client/src/utils/Antd/AntdDropdown.re b/client/src/utils/Antd/AntdDropdown.re new file mode 100644 index 000000000..772a937d0 --- /dev/null +++ b/client/src/utils/Antd/AntdDropdown.re @@ -0,0 +1,209 @@ +module Menu = Antd_Menu; + +[@bs.module] external dropdown: ReasonReact.reactClass = "antd/lib/dropdown"; + +[%bs.raw {|require("antd/lib/dropdown/style")|}]; + +[@bs.deriving jsConverter] +type placement = [ + | [@bs.as "bottomLeft"] `bottomLeft + | [@bs.as "bottomCenter"] `bottomCenter + | [@bs.as "bottomRight"] `bottomRight + | [@bs.as "topLeft"] `topLeft + | [@bs.as "topCenter"] `topCenter + | [@bs.as "topRight"] `topRight +]; + +[@bs.deriving jsConverter] +type buttonSize = [ | `small | `default | `large]; + +[@bs.deriving jsConverter] +type buttonType = [ | `primary | `ghost | `dashed | `danger]; + +[@bs.deriving jsConverter] +type trigger = [ + | [@bs.as "click"] `click + | [@bs.as "hover"] `hover + | [@bs.as "contextMenu"] `contextMenu +]; + +/* + module Dropdown = { + [@bs.module] external dropdown : ReasonReact.reactClass = "antd/lib/dropdown"; + let make = + ( + ~align=?, + ~disabled=?, + ~type_=?, + ~className=?, + ~size=?, + ~style=?, + ~overlay=?, + ~onVisibleChange=?, + ~id=?, + ~visible=?, + ~placement=?, + ~trigger=?, + ~onClick=? + ) => + ReasonReact.wrapJsForReason( + ~reactClass=dropdown, + ~props= + Js.Undefined.( + { + "align": from_opt(align), + "disabled": unwrapBool(disabled), + "type": from_opt(type_), + "className": from_opt(className), + "size": from_opt(size), + "style": from_opt(style), + "overlay": from_opt(overlay), + "onVisibleChange": from_opt(onVisibleChange), + "id": from_opt(id), + "visible": unwrapBool(visible), + "placement": from_opt(placement), + "trigger": from_opt(trigger), + "onClick": from_opt(onClick) + } + ) + ); + }; + */ + +/* + disabled whether the dropdown menu is disabled boolean - + getPopupContainer to set the container of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition. example Function(triggerNode) () => document.body + overlay the dropdown menu Menu - + overlayClassName Class name of the dropdown root element string - + overlayStyle Style of the dropdown root element object - + placement placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight String bottomLeft + trigger the trigger mode which executes the drop-down action, hover doesn't work on mobile device Array ['hover'] + visible whether the dropdown menu is visible boolean - + onVisibleChange a callback function takes an argument: visible, is executed when the visible state is changed Function(visible) + */ + +[@bs.obj] +external makeProps: + ( + ~disabled: bool=?, + ~overlay: ReasonReact.reactElement=?, + ~overlayClassName: string=?, + ~placement: string=?, + ~trigger: array(string)=?, + ~visible: bool=?, + ~onVisibleChange: ReactEvent.Mouse.t => unit=?, + ~id: string=?, + ~className: string=?, + ~style: ReactDOMRe.Style.t=?, + unit + ) => + _ = + ""; + +let make = + ( + ~disabled=?, + ~overlay=?, + ~overlayClassName=?, + ~placement=?, + ~trigger=?, + ~visible=?, + ~onVisibleChange=?, + ~id=?, + ~className=?, + ~style=?, + children, + ) => + ReasonReact.wrapJsForReason( + ~reactClass=dropdown, + ~props= + makeProps( + ~disabled?, + ~overlay?, + ~overlayClassName?, + ~placement=?Js.Option.map((. b) => placementToJs(b), placement), + ~trigger=?Js.Option.map((. b) => Array.of_list(b), trigger), + ~visible?, + ~onVisibleChange?, + ~id?, + ~className?, + ~style?, + (), + ), + children, + ); + +/* + disabled whether the dropdown menu is disabled boolean - + overlay the dropdown menu Menu - + placement placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight String bottomLeft + size size of the button, the same as Button string default + trigger the trigger mode which executes the drop-down action Array ['hover'] + type type of the button, the same as Button string default + visible whether the dropdown menu is visible boolean - + onClick a callback function, the same as Button, which will be executed when you click the button on the left Function - + onVisibleChange a callback function takes an argument: visible, is executed when the visible state is changed Function + */ + +module Button = { + [@bs.module "antd/lib/dropdown"] + external dropdownButton: ReasonReact.reactClass = "Dropdown.Button"; + [@bs.obj] + external makeProps: + ( + ~disabled: bool=?, + ~overlay: ReasonReact.reactElement=?, + ~placement: string=?, + ~size: string=?, + ~trigger: array(string)=?, + ~_type: string=?, + ~visible: bool=?, + ~onClick: ReactEvent.Mouse.t => unit=?, + ~onVisibleChange: ReactEvent.Mouse.t => unit=?, + ~key: string=?, + ~id: string=?, + ~className: string=?, + ~style: ReactDOMRe.Style.t=?, + unit + ) => + _ = + ""; + let make = + ( + ~disabled=?, + ~overlay=?, + ~placement=?, + ~size=?, + ~trigger=?, + ~_type=?, + ~visible=?, + ~onClick=?, + ~onVisibleChange=?, + ~key_=?, + ~id=?, + ~className=?, + ~style=?, + children, + ) => + ReasonReact.wrapJsForReason( + ~reactClass=dropdownButton, + ~props= + makeProps( + ~disabled?, + ~overlay?, + ~placement=?Js.Option.map((. b) => placementToJs(b), placement), + ~size=?Js.Option.map((. b) => buttonSizeToJs(b), size), + ~trigger=?Js.Option.map((. b) => Array.of_list(b), trigger), + ~_type=?Js.Option.map((. b) => buttonTypeToJs(b), _type), + ~visible?, + ~onClick?, + ~onVisibleChange?, + ~key=?key_, + ~id?, + ~className?, + ~style?, + (), + ), + children, + ); +}; \ No newline at end of file diff --git a/client/src/utils/Antd/AntdDropdown2.js b/client/src/utils/Antd/AntdDropdown2.js new file mode 100644 index 000000000..ff0dc208c --- /dev/null +++ b/client/src/utils/Antd/AntdDropdown2.js @@ -0,0 +1,28 @@ +import React from "react"; +import { Menu, Dropdown as Drop, Icon } from 'antd'; + +const menu = ( + + + 1st menu item + + + 2nd menu item + + + 3rd menu item + + + ); + +export class Dropdown extends React.Component { + render() { + return( + {this.props.overlay}
}> + + {this.props.children} + + + ) + } +} \ No newline at end of file diff --git a/client/src/utils/Antd/AntdDropdown2.re b/client/src/utils/Antd/AntdDropdown2.re new file mode 100644 index 000000000..2405bfa77 --- /dev/null +++ b/client/src/utils/Antd/AntdDropdown2.re @@ -0,0 +1,12 @@ +[@bs.module "./AntdDropdown2.js"] +external dropdown: ReasonReact.reactClass = "Dropdown"; + +[@bs.obj] +external makeProps: (~overlay: ReasonReact.reactElement=?, unit) => _ = ""; + +let make = (~overlay=?, children) => + ReasonReact.wrapJsForReason( + ~reactClass=dropdown, + ~props=makeProps(~overlay?, ()), + children, + ); \ No newline at end of file diff --git a/client/src/utils/Antd/AntdPopover.re b/client/src/utils/Antd/AntdPopover.re new file mode 100644 index 000000000..b464a8110 --- /dev/null +++ b/client/src/utils/Antd/AntdPopover.re @@ -0,0 +1,117 @@ +[@bs.module] external reactClass: ReasonReact.reactClass = "antd/lib/popover"; + +[%bs.raw {|require("antd/lib/popover/style")|}]; + +[@bs.deriving jsConverter] +type placementType = [ + | `top + | `left + | `right + | `bottom + | `topLeft + | `topRight + | `bottomLeft + | `bottomRight + | `leftTop + | `leftBottom + | `rightTop + | `rightBottom +]; + +[@bs.deriving jsConverter] +type triggerType = [ | `hover | `focus | `click | `contextMenu]; + +/* + COMMON API + ----------------------- + arrowPointAtCenter Whether the arrow is pointed at the center of target, supported after antd@1.11+ boolean false + autoAdjustOverflow Whether to adjust popup placement automatically when popup is off screen boolean true + defaultVisible Whether the floating tooltip card is visible by default boolean false + getPopupContainer The DOM container of the tip, the default behavior is to create a div element in body Function(triggerNode) () => document.body + mouseEnterDelay Delay in seconds, before tooltip is shown on mouse enter number 0 + mouseLeaveDelay Delay in seconds, before tooltip is hidden on mouse leave number 0.1 + overlayClassName Class name of the tooltip card string - + overlayStyle Style of the tooltip card object - + placement The position of the tooltip relative to the target, which can be one of top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom string top + trigger Tooltip trigger mode hover | focus | click | contextMenu hover + visible Whether the floating tooltip card is visible or not boolean false + onVisibleChange Callback executed when visibility of the tooltip card is changed (visible) => void - + align this value will be merged into placement's config, please refer to the settings rc-tooltip Object - + */ + +/* + content Content of the card string|ReactNode - + title Title of the card string|ReactNode - + */ + +[@bs.obj] +external makeProps: + ( + ~arrowPointAtCenter: bool=?, + ~autoAdjustOverflow: bool=?, + ~defaultVisible: bool=?, + ~getPopupContainer: Dom.element => Dom.htmlElement=?, + ~mouseEnterDelay: float=?, + ~mouseLeaveDelay: float=?, + ~overlayClassName: string=?, + ~overlayStyle: ReactDOMRe.Style.t=?, + ~placement: string=?, + ~trigger: string=?, + ~visible: bool=?, + ~onVisibleChange: bool => unit=?, + ~content: ReasonReact.reactElement=?, + ~title: ReasonReact.reactElement=?, + ~id: string=?, + ~className: string=?, + ~style: ReactDOMRe.Style.t=?, + unit + ) => + _ = + ""; + +let make = + ( + ~arrowPointAtCenter=?, + ~autoAdjustOverflow=?, + ~defaultVisible=?, + ~getPopupContainer=?, + ~mouseEnterDelay=?, + ~mouseLeaveDelay=?, + ~overlayClassName=?, + ~overlayStyle=?, + ~placement=?, + ~trigger=?, + ~visible=?, + ~onVisibleChange=?, + ~content=?, + ~title=?, + ~id=?, + ~className=?, + ~style=?, + children, + ) => + ReasonReact.wrapJsForReason( + ~reactClass, + ~props= + makeProps( + ~arrowPointAtCenter?, + ~autoAdjustOverflow?, + ~defaultVisible?, + ~getPopupContainer?, + ~mouseEnterDelay?, + ~mouseLeaveDelay?, + ~overlayClassName?, + ~overlayStyle?, + ~placement=?Js.Option.map((. b) => placementTypeToJs(b), placement), + ~trigger=?Js.Option.map((. b) => triggerTypeToJs(b), trigger), + ~visible?, + ~onVisibleChange?, + ~content?, + ~title?, + ~id?, + ~className?, + ~style?, + (), + ), + children, + ); \ No newline at end of file From f008add602dc4ee913d78f95b0c1a25dd5ed3828 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 18:37:01 +0100 Subject: [PATCH 09/22] Added simple container --- client/src/components/SLayout.re | 6 ++- client/src/layout/Channel_Layout.re | 20 +++---- .../src/layout/Layout__Component__Sidebar.re | 52 +------------------ 3 files changed, 17 insertions(+), 61 deletions(-) diff --git a/client/src/components/SLayout.re b/client/src/components/SLayout.re index 271b6d8b8..464bdf165 100644 --- a/client/src/components/SLayout.re +++ b/client/src/components/SLayout.re @@ -28,6 +28,7 @@ module Styles = { float(`left), fontWeight(`medium), ]); + let container = style([maxWidth(`px(1170)), margin(`auto)]); let backHover = style([ color(`hex("8b949e")), @@ -124,7 +125,10 @@ module FullPage = { let make = ({head, body}: LayoutConfig.t) => { ...component, render: _ => - <>
head
body , +
+
head
+ body +
, }; let makeWithEl = (t: LayoutConfig.t) => t |> make |> E.React.el; }; diff --git a/client/src/layout/Channel_Layout.re b/client/src/layout/Channel_Layout.re index e066d71b7..53ac97776 100644 --- a/client/src/layout/Channel_Layout.re +++ b/client/src/layout/Channel_Layout.re @@ -208,16 +208,18 @@ let make = -
top
- -
-
- bottomHeader - head +
+
top
+ +
+
+ bottomHeader + head +
+
body
-
body
-
- + +
; }, }; diff --git a/client/src/layout/Layout__Component__Sidebar.re b/client/src/layout/Layout__Component__Sidebar.re index e1af63b0a..14eb9b60d 100644 --- a/client/src/layout/Layout__Component__Sidebar.re +++ b/client/src/layout/Layout__Component__Sidebar.re @@ -30,7 +30,7 @@ module Styles = { marginTop(`em(-0.2)), selector(":hover", [color(`rgba((255, 255, 255, 0.9)))]), ]); - let sectionPadding = style([height(`em(3.0)), width(`percent(100.0))]); + let sectionPadding = style([height(`em(1.0)), width(`percent(100.0))]); let item = style([ flex(1), @@ -62,56 +62,6 @@ let make = (~channelId, ~loggedInUser: Context.Primary.User.t, _children) => { ...component, render: _self =>
-
{"User" |> ste}
- { - open Rationale.Option.Infix; - let idd = - loggedInUser.agent - |> E.O.fmap((a: Context.Primary.Agent.t) => a.id) - |> E.O.default(""); - <> -
Context.Routing.Url.push(Profile)} - className=Styles.item> - {"Profile" |> ste} -
- { - loggedInUser.agent - |> E.O.React.fmapOrNull((r: Context.Primary.Agent.t) => -
Context.Routing.Url.push(AgentBots(r.id))} - className=Styles.item> - {"My Bots" |> ste} -
- ) - } - { - loggedInUser.agent - |> E.O.React.fmapOrNull((r: Context.Primary.Agent.t) => -
Context.Routing.Url.push(AgentShow(r.id))} - className=Styles.item> - {"My Predictions" |> ste} -
- ) - } -
Context.Routing.Url.push(AgentMeasurables(idd))} - className=Styles.item> - {"My Questions" |> ste} -
-
Context.Routing.Url.push(EntityIndex)} - className=Styles.item> - {"Entity List" |> ste} -
-
Context.Auth.Actions.logout()} - className=Styles.item> - {"Log Out" |> ste} -
- ; - }
From 9d26205d70eb5f7b3646f097cc6aec6399369efd Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 20:35:15 +0100 Subject: [PATCH 10/22] Chevrons for pagination --- client/src/E.re | 2 + client/src/components/SLayout.re | 28 +++---------- .../src/layout/Layout__Component__Header.re | 4 +- client/src/lib/Icon.js | 4 ++ .../lib/SelectWithPaginationReducerFunctor.re | 39 +++++++++++++++++-- 5 files changed, 50 insertions(+), 27 deletions(-) diff --git a/client/src/E.re b/client/src/E.re index 3aa20e422..98b1c1ce9 100644 --- a/client/src/E.re +++ b/client/src/E.re @@ -118,6 +118,7 @@ module L = { let toArray = Array.of_list; let fmapi = List.mapi; let concat = List.concat; + let append = List.append; let find = List.find; let filter = List.filter; let for_all = List.for_all; @@ -148,6 +149,7 @@ module A = { let to_list = Array.to_list; let of_list = Array.of_list; let length = Array.length; + let append = Array.append; let empty = [||]; let unsafe_get = Array.unsafe_get; let get = Belt.Array.get; diff --git a/client/src/components/SLayout.re b/client/src/components/SLayout.re index 464bdf165..e609adc1a 100644 --- a/client/src/components/SLayout.re +++ b/client/src/components/SLayout.re @@ -6,7 +6,6 @@ module Styles = { open Css; let header = style([ - borderBottom(`px(1), `solid, `hex("eee")), paddingLeft(`em(1.)), paddingBottom(`em(0.8)), paddingRight(`em(1.)), @@ -16,8 +15,8 @@ module Styles = { ]); let headerText = style([ - color(`hex("333")), - fontSize(`em(2.0)), + color(`hex("486474")), + fontSize(`em(1.8)), fontWeight(`bold), float(`left), ]); @@ -29,23 +28,7 @@ module Styles = { fontWeight(`medium), ]); let container = style([maxWidth(`px(1170)), margin(`auto)]); - let backHover = - style([ - color(`hex("8b949e")), - background(`hex("e2e8ea")), - fontSize(`em(1.3)), - float(`left), - padding(`px(6)), - lineHeight(`px(0)), - borderRadius(`percent(50.)), - marginRight(`em(0.7)), - marginTop(`em(0.3)), - cursor(`pointer), - selector( - ":hover", - [color(`hex("445b7d")), background(`hex("c2cbd4"))], - ), - ]); + let backHover = style([fontSize(`em(1.3))]); let foo = style([ color(`hex("333")), @@ -134,9 +117,10 @@ module FullPage = { }; let channelBack = (~onClick, ()) => -
+ -
; + {"Back" |> ste} + ; let channelink = (c: Context.Primary.Channel.t) =>
diff --git a/client/src/layout/Layout__Component__Header.re b/client/src/layout/Layout__Component__Header.re index 2433b8069..b8c798c01 100644 --- a/client/src/layout/Layout__Component__Header.re +++ b/client/src/layout/Layout__Component__Header.re @@ -60,7 +60,9 @@ let header = (loggedInUser: Context.Primary.User.t) => { loggedInUser.agent |> E.O.fmap((a: Context.Primary.Agent.t) => a.id); switch (id) { | Some(id) => - {"OzzieGooen" |> ste} + + {loggedInUser.name ++ "Hi" |> ste} + | None => ReasonReact.null }; }; diff --git a/client/src/lib/Icon.js b/client/src/lib/Icon.js index ccb0d45b5..796d9ea0e 100644 --- a/client/src/lib/Icon.js +++ b/client/src/lib/Icon.js @@ -16,6 +16,8 @@ import {gavel} from 'react-icons-kit/fa/gavel' import {plus as circlePlus} from 'react-icons-kit/metrize/plus' import {thinRight} from 'react-icons-kit/entypo/thinRight' import {lock} from 'react-icons-kit/icomoon/lock' +import {chevronLeft} from 'react-icons-kit/fa/chevronLeft' +import {chevronRight} from 'react-icons-kit/fa/chevronRight' let types = { @@ -31,6 +33,8 @@ let types = { "CIRCLE_PLUS": circlePlus, "ARROW_RIGHT": arrowRight2, "ARROW_LEFT": arrowLeft2, + "CHEVRON_LEFT": chevronLeft, + "CHEVRON_RIGHT": chevronRight, "THIN_RIGHT":thinRight } diff --git a/client/src/lib/SelectWithPaginationReducerFunctor.re b/client/src/lib/SelectWithPaginationReducerFunctor.re index 15c1b2cfb..c8ab1b2aa 100644 --- a/client/src/lib/SelectWithPaginationReducerFunctor.re +++ b/client/src/lib/SelectWithPaginationReducerFunctor.re @@ -216,11 +216,42 @@ module Make = (Config: Config) => { let deselectButton = send => SLayout.channelBack(~onClick=_ => send(Types.Deselect), ()); + module Styles = { + open Css; + let header = (~isDisabled) => { + let normalStyles = [ + fontSize(`em(1.3)), + float(`left), + padding(`px(6)), + lineHeight(`px(0)), + marginRight(`em(0.7)), + marginTop(`em(0.1)), + color(`hex("e6e5e5")), + borderRadius(`percent(50.)), + userSelect(`none), + ]; + let enabledOnlyStyles = [ + color(`hex("a3abb6")), + cursor(`pointer), + selector( + ":hover", + [color(`hex("445b7d")), background(`hex("e9eff7"))], + ), + ]; + let allStyles = + isDisabled ? + normalStyles : E.L.append(normalStyles, enabledOnlyStyles); + style(allStyles); + }; + }; + let pageButton' = (facesRight: bool, action, canMove, params) => - params.send(action)} disabled={!canMove(params)}> - - ; +
params.send(action)} + disabled={!canMove(params)}> + +
; type buttonType = | PageLast From a28fb5702c8d92a21476038a50f3df69f01ac3b7 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 21 Apr 2019 23:48:15 +0100 Subject: [PATCH 11/22] Improved styling on dropdown --- .../src/layout/Layout__Component__Header.re | 71 +++++++++---------- client/src/layout/Layout__Dropdown.re | 26 +++++++ client/src/lib/Icon.js | 2 + client/src/utils/Antd/AntdDropdown2.js | 21 ++---- client/src/utils/Antd/AntdDropdown2.re | 9 ++- 5 files changed, 75 insertions(+), 54 deletions(-) create mode 100644 client/src/layout/Layout__Dropdown.re diff --git a/client/src/layout/Layout__Component__Header.re b/client/src/layout/Layout__Component__Header.re index b8c798c01..8a18c74f7 100644 --- a/client/src/layout/Layout__Component__Header.re +++ b/client/src/layout/Layout__Component__Header.re @@ -2,6 +2,9 @@ open Utils; open Style.Grid; open Foretold__GraphQL; +/* border: 1px solid #dcdcdc; + box-shadow: 1px 1px 5px #ede6e6; + } */ module Styles = { open Css; let outer = @@ -25,47 +28,43 @@ let foo: ReasonReact.reactElement = "sdf" |> ste; let component = ReasonReact.statelessComponent("Header"); +let action = Layout__Dropdown.Styles.action; let bar = agentId => - - -
Context.Routing.Url.push(Profile)}> - {"Profile" |> ste} -
-
- -
Context.Routing.Url.push(AgentMeasurables(agentId))}> - {"My Questions" |> ste} -
-
- -
Context.Routing.Url.push(AgentBots(agentId))}> - {"My Bots" |> ste} -
-
- -
Context.Routing.Url.push(AgentShow(agentId))}> - {"My Predictions" |> ste} -
-
- -
Context.Auth.Actions.logout()}> - {"Log Out" |> ste} -
-
-
; + <> +
Context.Routing.Url.push(Profile)} className=action> + {"Profile" |> ste} +
+
Context.Routing.Url.push(AgentMeasurables(agentId))} + className=action> + {"My Questions" |> ste} +
+
Context.Routing.Url.push(AgentBots(agentId))} + className=action> + {"My Bots" |> ste} +
+
Context.Routing.Url.push(AgentShow(agentId))} + className=action> + {"My Predictions" |> ste} +
+
Context.Auth.Actions.logout()} className=action> + {"Log Out" |> ste} +
+ ; -let header = (loggedInUser: Context.Primary.User.t) => { - let id = - loggedInUser.agent |> E.O.fmap((a: Context.Primary.Agent.t) => a.id); - switch (id) { - | Some(id) => - - {loggedInUser.name ++ "Hi" |> ste} +let header = (loggedInUser: Context.Primary.User.t) => + switch (loggedInUser.agent) { + | Some((agent: Context.Primary.Types.agent)) => + + {agent.name |> E.O.default("") |> ste} + | None => ReasonReact.null }; -}; let make = (~loggedInUser: Context.Primary.User.t, _children) => { ...component, render: _self => diff --git a/client/src/layout/Layout__Dropdown.re b/client/src/layout/Layout__Dropdown.re new file mode 100644 index 000000000..8ab22b85f --- /dev/null +++ b/client/src/layout/Layout__Dropdown.re @@ -0,0 +1,26 @@ +module Styles = { + open Css; + let dropdown = + style([ + border(`px(1), `solid, `hex("d5d2d2")), + padding2(~v=`em(0.5), ~h=`em(0.)), + borderRadius(`px(5)), + background(`hex("fff")), + boxShadow( + ~x=`px(1), + ~y=`px(1), + ~blur=`px(5), + ~spread=`px(1), + ~inset=false, + `hex("dfd7d7"), + ), + ]); + let action = + style([ + cursor(`pointer), + padding2(~v=`em(0.3), ~h=`em(1.4)), + minWidth(`px(200)), + fontSize(`em(1.2)), + selector(":hover", [backgroundColor(`hex("eef0f3"))]), + ]); +}; \ No newline at end of file diff --git a/client/src/lib/Icon.js b/client/src/lib/Icon.js index 796d9ea0e..a7d13d5cc 100644 --- a/client/src/lib/Icon.js +++ b/client/src/lib/Icon.js @@ -18,6 +18,7 @@ import {thinRight} from 'react-icons-kit/entypo/thinRight' import {lock} from 'react-icons-kit/icomoon/lock' import {chevronLeft} from 'react-icons-kit/fa/chevronLeft' import {chevronRight} from 'react-icons-kit/fa/chevronRight' +import {chevronDown} from 'react-icons-kit/fa/chevronDown' let types = { @@ -35,6 +36,7 @@ let types = { "ARROW_LEFT": arrowLeft2, "CHEVRON_LEFT": chevronLeft, "CHEVRON_RIGHT": chevronRight, + "CHEVRON_DOWN": chevronDown, "THIN_RIGHT":thinRight } diff --git a/client/src/utils/Antd/AntdDropdown2.js b/client/src/utils/Antd/AntdDropdown2.js index ff0dc208c..f3441d628 100644 --- a/client/src/utils/Antd/AntdDropdown2.js +++ b/client/src/utils/Antd/AntdDropdown2.js @@ -1,24 +1,15 @@ import React from "react"; import { Menu, Dropdown as Drop, Icon } from 'antd'; -const menu = ( - - - 1st menu item - - - 2nd menu item - - - 3rd menu item - - - ); - export class Dropdown extends React.Component { render() { return( - {this.props.overlay}
}> + {this.props.overlay}
} + placement="bottomRight" + > {this.props.children} diff --git a/client/src/utils/Antd/AntdDropdown2.re b/client/src/utils/Antd/AntdDropdown2.re index 2405bfa77..0243c7395 100644 --- a/client/src/utils/Antd/AntdDropdown2.re +++ b/client/src/utils/Antd/AntdDropdown2.re @@ -2,11 +2,14 @@ external dropdown: ReasonReact.reactClass = "Dropdown"; [@bs.obj] -external makeProps: (~overlay: ReasonReact.reactElement=?, unit) => _ = ""; +external makeProps: + (~overlay: ReasonReact.reactElement=?, ~overlayClassName: string=?, unit) => + _ = + ""; -let make = (~overlay=?, children) => +let make = (~overlay=?, ~overlayClassName=?, children) => ReasonReact.wrapJsForReason( ~reactClass=dropdown, - ~props=makeProps(~overlay?, ()), + ~props=makeProps(~overlay?, ~overlayClassName?, ()), children, ); \ No newline at end of file From 95f85bfb6acef2879346554ab333eeef0ad12c62 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 00:18:28 +0100 Subject: [PATCH 12/22] Minor cleanup --- .../src/layout/Layout__Component__Header.re | 30 ++- .../src/layout/Layout__Component__Sidebar.re | 5 - .../{AntdDropdown2.js => AntdDropdown.js} | 0 client/src/utils/Antd/AntdDropdown.re | 206 +----------------- client/src/utils/Antd/AntdDropdown2.re | 15 -- 5 files changed, 32 insertions(+), 224 deletions(-) rename client/src/utils/Antd/{AntdDropdown2.js => AntdDropdown.js} (100%) delete mode 100644 client/src/utils/Antd/AntdDropdown2.re diff --git a/client/src/layout/Layout__Component__Header.re b/client/src/layout/Layout__Component__Header.re index 8a18c74f7..6fda23682 100644 --- a/client/src/layout/Layout__Component__Header.re +++ b/client/src/layout/Layout__Component__Header.re @@ -22,6 +22,15 @@ module Styles = { minWidth(`px(200)), ]); let right = style([flex(7), width(`percent(100.0))]); + let headerLink = + style([ + cursor(`pointer), + marginRight(`em(2.)), + fontSize(`em(1.1)), + color(`hex("61738d")), + fontWeight(`num(400)), + selector(":hover", [color(`hex("000"))]), + ]); }; let foo: ReasonReact.reactElement = "sdf" |> ste; @@ -49,6 +58,10 @@ let bar = agentId => className=action> {"My Predictions" |> ste}
+
Context.Routing.Url.push(ChannelNew)} className=action> + {"Make a New Channel" |> ste} +
Context.Auth.Actions.logout()} className=action> {"Log Out" |> ste}
@@ -57,12 +70,12 @@ let bar = agentId => let header = (loggedInUser: Context.Primary.User.t) => switch (loggedInUser.agent) { | Some((agent: Context.Primary.Types.agent)) => - {agent.name |> E.O.default("") |> ste} - + | None => ReasonReact.null }; let make = (~loggedInUser: Context.Primary.User.t, _children) => { @@ -70,8 +83,17 @@ let make = (~loggedInUser: Context.Primary.User.t, _children) => { render: _self =>
-
Context.Routing.Url.push(EntityIndex)}> - {"Entity List" |> ste} +
Context.Routing.Url.push(ChannelIndex)} + className=Styles.headerLink> + {"Public Channels" |> ste} +
+
+
+
Context.Routing.Url.push(EntityIndex)} + className=Styles.headerLink> + {"Entity Explorer" |> ste}
{header(loggedInUser)}
diff --git a/client/src/layout/Layout__Component__Sidebar.re b/client/src/layout/Layout__Component__Sidebar.re index 14eb9b60d..c7ea8ca92 100644 --- a/client/src/layout/Layout__Component__Sidebar.re +++ b/client/src/layout/Layout__Component__Sidebar.re @@ -70,11 +70,6 @@ let make = (~channelId, ~loggedInUser: Context.Primary.User.t, _children) => { onClick={_e => Context.Routing.Url.push(ChannelIndex)}> {"Channels" |> ste}
-
Context.Routing.Url.push(ChannelNew)}> - -
{ diff --git a/client/src/utils/Antd/AntdDropdown2.js b/client/src/utils/Antd/AntdDropdown.js similarity index 100% rename from client/src/utils/Antd/AntdDropdown2.js rename to client/src/utils/Antd/AntdDropdown.js diff --git a/client/src/utils/Antd/AntdDropdown.re b/client/src/utils/Antd/AntdDropdown.re index 772a937d0..42d0e4b9a 100644 --- a/client/src/utils/Antd/AntdDropdown.re +++ b/client/src/utils/Antd/AntdDropdown.re @@ -1,209 +1,15 @@ -module Menu = Antd_Menu; - -[@bs.module] external dropdown: ReasonReact.reactClass = "antd/lib/dropdown"; - -[%bs.raw {|require("antd/lib/dropdown/style")|}]; - -[@bs.deriving jsConverter] -type placement = [ - | [@bs.as "bottomLeft"] `bottomLeft - | [@bs.as "bottomCenter"] `bottomCenter - | [@bs.as "bottomRight"] `bottomRight - | [@bs.as "topLeft"] `topLeft - | [@bs.as "topCenter"] `topCenter - | [@bs.as "topRight"] `topRight -]; - -[@bs.deriving jsConverter] -type buttonSize = [ | `small | `default | `large]; - -[@bs.deriving jsConverter] -type buttonType = [ | `primary | `ghost | `dashed | `danger]; - -[@bs.deriving jsConverter] -type trigger = [ - | [@bs.as "click"] `click - | [@bs.as "hover"] `hover - | [@bs.as "contextMenu"] `contextMenu -]; - -/* - module Dropdown = { - [@bs.module] external dropdown : ReasonReact.reactClass = "antd/lib/dropdown"; - let make = - ( - ~align=?, - ~disabled=?, - ~type_=?, - ~className=?, - ~size=?, - ~style=?, - ~overlay=?, - ~onVisibleChange=?, - ~id=?, - ~visible=?, - ~placement=?, - ~trigger=?, - ~onClick=? - ) => - ReasonReact.wrapJsForReason( - ~reactClass=dropdown, - ~props= - Js.Undefined.( - { - "align": from_opt(align), - "disabled": unwrapBool(disabled), - "type": from_opt(type_), - "className": from_opt(className), - "size": from_opt(size), - "style": from_opt(style), - "overlay": from_opt(overlay), - "onVisibleChange": from_opt(onVisibleChange), - "id": from_opt(id), - "visible": unwrapBool(visible), - "placement": from_opt(placement), - "trigger": from_opt(trigger), - "onClick": from_opt(onClick) - } - ) - ); - }; - */ - -/* - disabled whether the dropdown menu is disabled boolean - - getPopupContainer to set the container of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition. example Function(triggerNode) () => document.body - overlay the dropdown menu Menu - - overlayClassName Class name of the dropdown root element string - - overlayStyle Style of the dropdown root element object - - placement placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight String bottomLeft - trigger the trigger mode which executes the drop-down action, hover doesn't work on mobile device Array ['hover'] - visible whether the dropdown menu is visible boolean - - onVisibleChange a callback function takes an argument: visible, is executed when the visible state is changed Function(visible) - */ +[@bs.module "./AntdDropdown.js"] +external dropdown: ReasonReact.reactClass = "Dropdown"; [@bs.obj] external makeProps: - ( - ~disabled: bool=?, - ~overlay: ReasonReact.reactElement=?, - ~overlayClassName: string=?, - ~placement: string=?, - ~trigger: array(string)=?, - ~visible: bool=?, - ~onVisibleChange: ReactEvent.Mouse.t => unit=?, - ~id: string=?, - ~className: string=?, - ~style: ReactDOMRe.Style.t=?, - unit - ) => + (~overlay: ReasonReact.reactElement=?, ~overlayClassName: string=?, unit) => _ = ""; -let make = - ( - ~disabled=?, - ~overlay=?, - ~overlayClassName=?, - ~placement=?, - ~trigger=?, - ~visible=?, - ~onVisibleChange=?, - ~id=?, - ~className=?, - ~style=?, - children, - ) => +let make = (~overlay=?, ~overlayClassName=?, children) => ReasonReact.wrapJsForReason( ~reactClass=dropdown, - ~props= - makeProps( - ~disabled?, - ~overlay?, - ~overlayClassName?, - ~placement=?Js.Option.map((. b) => placementToJs(b), placement), - ~trigger=?Js.Option.map((. b) => Array.of_list(b), trigger), - ~visible?, - ~onVisibleChange?, - ~id?, - ~className?, - ~style?, - (), - ), + ~props=makeProps(~overlay?, ~overlayClassName?, ()), children, - ); - -/* - disabled whether the dropdown menu is disabled boolean - - overlay the dropdown menu Menu - - placement placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight String bottomLeft - size size of the button, the same as Button string default - trigger the trigger mode which executes the drop-down action Array ['hover'] - type type of the button, the same as Button string default - visible whether the dropdown menu is visible boolean - - onClick a callback function, the same as Button, which will be executed when you click the button on the left Function - - onVisibleChange a callback function takes an argument: visible, is executed when the visible state is changed Function - */ - -module Button = { - [@bs.module "antd/lib/dropdown"] - external dropdownButton: ReasonReact.reactClass = "Dropdown.Button"; - [@bs.obj] - external makeProps: - ( - ~disabled: bool=?, - ~overlay: ReasonReact.reactElement=?, - ~placement: string=?, - ~size: string=?, - ~trigger: array(string)=?, - ~_type: string=?, - ~visible: bool=?, - ~onClick: ReactEvent.Mouse.t => unit=?, - ~onVisibleChange: ReactEvent.Mouse.t => unit=?, - ~key: string=?, - ~id: string=?, - ~className: string=?, - ~style: ReactDOMRe.Style.t=?, - unit - ) => - _ = - ""; - let make = - ( - ~disabled=?, - ~overlay=?, - ~placement=?, - ~size=?, - ~trigger=?, - ~_type=?, - ~visible=?, - ~onClick=?, - ~onVisibleChange=?, - ~key_=?, - ~id=?, - ~className=?, - ~style=?, - children, - ) => - ReasonReact.wrapJsForReason( - ~reactClass=dropdownButton, - ~props= - makeProps( - ~disabled?, - ~overlay?, - ~placement=?Js.Option.map((. b) => placementToJs(b), placement), - ~size=?Js.Option.map((. b) => buttonSizeToJs(b), size), - ~trigger=?Js.Option.map((. b) => Array.of_list(b), trigger), - ~_type=?Js.Option.map((. b) => buttonTypeToJs(b), _type), - ~visible?, - ~onClick?, - ~onVisibleChange?, - ~key=?key_, - ~id?, - ~className?, - ~style?, - (), - ), - children, - ); -}; \ No newline at end of file + ); \ No newline at end of file diff --git a/client/src/utils/Antd/AntdDropdown2.re b/client/src/utils/Antd/AntdDropdown2.re deleted file mode 100644 index 0243c7395..000000000 --- a/client/src/utils/Antd/AntdDropdown2.re +++ /dev/null @@ -1,15 +0,0 @@ -[@bs.module "./AntdDropdown2.js"] -external dropdown: ReasonReact.reactClass = "Dropdown"; - -[@bs.obj] -external makeProps: - (~overlay: ReasonReact.reactElement=?, ~overlayClassName: string=?, unit) => - _ = - ""; - -let make = (~overlay=?, ~overlayClassName=?, children) => - ReasonReact.wrapJsForReason( - ~reactClass=dropdown, - ~props=makeProps(~overlay?, ~overlayClassName?, ()), - children, - ); \ No newline at end of file From 733cf6f720bb9c72223d11d5977dc7111943f388 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 00:53:07 +0100 Subject: [PATCH 13/22] Build client without sourcemaps, which broke heroku --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index f3eef636a..4aae679f0 100644 --- a/client/package.json +++ b/client/package.json @@ -8,7 +8,7 @@ "parcel": "API_URL=${API_URL:-http://localhost:4000/graphql} AUTH0_DOMAIN=${AUTH0_DOMAIN:-guesstimate.auth0.com} AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID:-gn1bwgJfK5Y6jfL6x7t6fB43ZAN3eSnT} parcel ./src/index.html --public-url /", "parcel-staging": "parcel ./src/index.html --public-url /", "parcel-production": "parcel ./src/index.html --public-url /", - "build": "parcel build ./src/index.html", + "build": "parcel build ./src/index.html --no-source-maps", "serve": "static-server ./dist -p ${PORT} -d", "build-t": "npm run clean && npm run build-bsb && npm run build", "test": "jest --ci --bail --no-cache", From 1e97efed3e27f8865e0ac26acd6b14cfd2c1f664 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 11:52:09 +0100 Subject: [PATCH 14/22] Added source maps back --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index 4aae679f0..f3eef636a 100644 --- a/client/package.json +++ b/client/package.json @@ -8,7 +8,7 @@ "parcel": "API_URL=${API_URL:-http://localhost:4000/graphql} AUTH0_DOMAIN=${AUTH0_DOMAIN:-guesstimate.auth0.com} AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID:-gn1bwgJfK5Y6jfL6x7t6fB43ZAN3eSnT} parcel ./src/index.html --public-url /", "parcel-staging": "parcel ./src/index.html --public-url /", "parcel-production": "parcel ./src/index.html --public-url /", - "build": "parcel build ./src/index.html --no-source-maps", + "build": "parcel build ./src/index.html", "serve": "static-server ./dist -p ${PORT} -d", "build-t": "npm run clean && npm run build-bsb && npm run build", "test": "jest --ci --bail --no-cache", From 3fe56dce387284fc2b018a5443d1557bac7d2c6f Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 12:07:58 +0100 Subject: [PATCH 15/22] Upgraded reason-react and bucklescript --- client/package.json | 4 +-- client/src/utils/Antd/AntdSwitch.re | 4 +-- client/yarn.lock | 52 ++++++++++++++++++++++------- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/client/package.json b/client/package.json index f3eef636a..5e281fe4a 100644 --- a/client/package.json +++ b/client/package.json @@ -57,7 +57,7 @@ "react-dom": "^16.2.0", "react-icons-kit": "^1.2.1", "reason-apollo": "^0.13.0", - "reason-react": ">=0.4.0", + "reason-react": "^0.7.0", "static-server": "^2.2.1", "subscriptions-transport-ws": "^0.9.14", "victory": "^32.2.0", @@ -72,7 +72,7 @@ "babel-preset-es2015": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "babel-runtime": "^6.26.0", - "bs-platform": "^4.0.7", + "bs-platform": "^5.0.0", "bsb-js": "^1.1.7", "css-loader": "^2.1.1", "file-loader": "^2.0.0", diff --git a/client/src/utils/Antd/AntdSwitch.re b/client/src/utils/Antd/AntdSwitch.re index 9b266b071..d0da314dc 100644 --- a/client/src/utils/Antd/AntdSwitch.re +++ b/client/src/utils/Antd/AntdSwitch.re @@ -8,7 +8,7 @@ let optBoolToOptJsBoolean = let unwrapBool = v => Js.Undefined.from_opt @@ optBoolToOptJsBoolean(v); [@bs.module "../../../node_modules/antd/lib/switch"] -external switch_: ReasonReact.reactClass = "default"; +external switch': ReasonReact.reactClass = "default"; %bs.raw "require('../../../node_modules/antd/lib/switch/style/index.css')"; @@ -26,7 +26,7 @@ let make = ~onChange=?, ) => ReasonReact.wrapJsForReason( - ~reactClass=switch__, + ~reactClass=switch', ~props= Js.Undefined.{ "defaultChecked": unwrapBool(defaultChecked), diff --git a/client/yarn.lock b/client/yarn.lock index c5e22bce0..f0e39825b 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -3457,10 +3457,10 @@ bs-moment@^0.4.4: resolved "https://registry.yarnpkg.com/bs-moment/-/bs-moment-0.4.4.tgz#3d59767e8cd0107393c4f371e15b95bf862ceaac" integrity sha512-fAcofbF1bTj6fuwk4cCZ0Teod75dhXPulnNhRwx7+PTtccNMdn35SCb98JxwrprQgCvoZircIgmu8nGLsOaqaA== -bs-platform@^4.0.7: - version "4.0.18" - resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-4.0.18.tgz#d17b8693ba1f714d9b27e0ddb365f2069ba4b8a0" - integrity sha512-BwzW0iYHvREqUZIgQxJmdJrxexppLvJxYQ4LLexbhCp7uZU5DIZ5ub4ZHpkCkc8fn8bsXWc+Rrejb3csi+BoAQ== +bs-platform@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-5.0.3.tgz#2b167603ef52574cb9534fabab702f6013715e6c" + integrity sha512-GAeypBebeDGTay5kJ3v5Z3Whp1Q4zQ0hAttflVtPG3zps88xDZnVAlS3JGIIBDmJFEMyNtv5947a/IWKvWXcPw== bs-reform@^6.0.0-gadt.5: version "6.0.0-gadt.5" @@ -10773,6 +10773,16 @@ react-docgen@^3.0.0-beta11: prop-types "^15.6.2" scheduler "^0.13.4" +react-dom@>=16.8.1: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f" + integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.13.6" + react-error-overlay@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.1.tgz#417addb0814a90f3a7082eacba7cee588d00da89" @@ -10921,6 +10931,16 @@ react@>=15, "react@>=15.0.0 || >=16.0.0", react@^16.6.3: prop-types "^15.6.2" scheduler "^0.13.4" +react@>=16.8.1: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" + integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.13.6" + read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" @@ -10998,14 +11018,6 @@ reason-apollo@^0.13.0: resolved "https://registry.yarnpkg.com/reason-apollo/-/reason-apollo-0.13.0.tgz#5727831dc6d49271a318dfb36724186b81d9890c" integrity sha512-PeJltFH53Z0mhyoKdADeLg/7CBALOlXg1L+n6SbvNmUgKYzIm5nXfPxd9YD0SuH3nxEPszFAmA/kEWStguCj4Q== -reason-react@>=0.4.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.6.0.tgz#e9a7d6a10958161c3a12ef7fec1b6662edaae94a" - integrity sha512-FKzBDXE96KPyUbeRo2ToqUe9rl4IKgwegtjCXvyx0bzJXCKLqwiiN3OiOTH/siJS+/IZRZhBAHnd/R3VkRMsMQ== - dependencies: - react ">=15.0.0 || >=16.0.0" - react-dom ">=15.0.0 || >=16.0.0" - reason-react@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.4.2.tgz#690d34e3e91a2585cdc5f58384b6c8ff653c32c1" @@ -11014,6 +11026,14 @@ reason-react@^0.4.2: react ">=15.0.0 || >=16.0.0" react-dom ">=15.0.0 || >=16.0.0" +reason-react@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.7.0.tgz#46a975c321e81cd51310d7b1a02418ca7667b0d6" + integrity sha512-czR/f0lY5iyLCki9gwftOFF5Zs40l7ZSFmpGK/Z6hx2jBVeFDmIiXB8bAQW/cO6IvtuEt97OmsYueiuOYG9XjQ== + dependencies: + react ">=16.8.1" + react-dom ">=16.8.1" + recast@^0.16.0: version "0.16.2" resolved "https://registry.yarnpkg.com/recast/-/recast-0.16.2.tgz#3796ebad5fe49ed85473b479cd6df554ad725dc2" @@ -11497,6 +11517,14 @@ scheduler@^0.13.4: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.13.6: + version "0.13.6" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" + integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf" From 4997791ca983b0a88227c27ee144109b0dda340c Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 12:14:42 +0100 Subject: [PATCH 16/22] Upgraded reason-apollo --- client/package.json | 12 +- client/src/pages/Channel/ChannelInvite.re | 3 +- client/src/utils/Antd/AntdSwitch.re | 16 +- client/src/utils/Antd/Form.re | 56 ++--- client/yarn.lock | 294 +++++++++++++++++++--- 5 files changed, 300 insertions(+), 81 deletions(-) diff --git a/client/package.json b/client/package.json index 5e281fe4a..29441671a 100644 --- a/client/package.json +++ b/client/package.json @@ -29,11 +29,11 @@ "@ncthbrt/re-secure-random-string": "^2.0.0", "apollo-cache-inmemory": "^1.2.9", "apollo-client": "^2.4.1", - "apollo-link": "^1.2.2", - "apollo-link-context": "^1.0.8", - "apollo-link-error": "^1.1.0", - "apollo-link-http": "^1.5.4", - "apollo-link-ws": "^1.0.8", + "apollo-link": "^1.2.11", + "apollo-link-context": "^1.0.17", + "apollo-link-error": "^1.1.10", + "apollo-link-http": "^1.5.14", + "apollo-link-ws": "^1.0.17", "apollo-utilities": "^1.0.20", "auth0-js": "^9.7.3", "bs-ant-design": "git+https://git@github.com/Thinkei/bs-ant-design.git", @@ -56,7 +56,7 @@ "react-apollo": "^2.1.11", "react-dom": "^16.2.0", "react-icons-kit": "^1.2.1", - "reason-apollo": "^0.13.0", + "reason-apollo": "^0.15.0", "reason-react": "^0.7.0", "static-server": "^2.2.1", "subscriptions-transport-ws": "^0.9.14", diff --git a/client/src/pages/Channel/ChannelInvite.re b/client/src/pages/Channel/ChannelInvite.re index d57dc6c3c..b2a5629da 100644 --- a/client/src/pages/Channel/ChannelInvite.re +++ b/client/src/pages/Channel/ChannelInvite.re @@ -18,7 +18,8 @@ let make = ...component, render: _ => { let addToChannel = (agentId, channelId) => - Foretold__GraphQL.Mutations.ChannelJoin.Mutation.make((mutation, _) => + Foretold__GraphQL.Mutations.ChannelMembershipCreate.Mutation.make( + (mutation, _) => None | Some(v) => Some(v); -let unwrapBool = v => Js.Undefined.from_opt @@ optBoolToOptJsBoolean(v); +let unwrapBool = v => Js.Undefined.fromOption @@ optBoolToOptJsBoolean(v); [@bs.module "../../../node_modules/antd/lib/switch"] external switch': ReasonReact.reactClass = "default"; @@ -31,13 +31,13 @@ let make = Js.Undefined.{ "defaultChecked": unwrapBool(defaultChecked), "disabled": unwrapBool(disabled), - "checkedChildren": from_opt(checkedChildren), - "className": from_opt(className), - "size": from_opt(size), - "style": from_opt(style), + "checkedChildren": fromOption(checkedChildren), + "className": fromOption(className), + "size": fromOption(size), + "style": fromOption(style), "checked": unwrapBool(checked), - "id": from_opt(id), - "unCheckedChildren": from_opt(unCheckedChildren), - "onChange": from_opt(onChange), + "id": fromOption(id), + "unCheckedChildren": fromOption(unCheckedChildren), + "onChange": fromOption(onChange), }, ); \ No newline at end of file diff --git a/client/src/utils/Antd/Form.re b/client/src/utils/Antd/Form.re index aca518749..b7eeee31d 100644 --- a/client/src/utils/Antd/Form.re +++ b/client/src/utils/Antd/Form.re @@ -3,9 +3,9 @@ let optBoolToOptJsBoolean = | None => None | Some(v) => Some(v); -let unwrapBool = v => Js.Undefined.from_opt @@ optBoolToOptJsBoolean(v); +let unwrapBool = v => Js.Undefined.fromOption @@ optBoolToOptJsBoolean(v); -[@bs.module] external form : ReasonReact.reactClass = "antd/lib/form"; +[@bs.module] external form: ReasonReact.reactClass = "antd/lib/form"; let make = ( ~layout=?, @@ -18,19 +18,17 @@ let make = ReasonReact.wrapJsForReason( ~reactClass=form, ~props= - Js.Undefined.( - { - "layout": from_opt(layout), - "onSubmit": from_opt(onSubmit), - "hideRequiredMark": unwrapBool(hideRequiredMark), - "id": from_opt(id), - "className": from_opt(className), - "style": from_opt(style), - } - ), + Js.Undefined.{ + "layout": fromOption(layout), + "onSubmit": fromOption(onSubmit), + "hideRequiredMark": unwrapBool(hideRequiredMark), + "id": fromOption(id), + "className": fromOption(className), + "style": fromOption(style), + }, ); type wrapper = (. ReasonReact.reactClass) => ReasonReact.reactClass; -[@bs.module "antd/lib/form"] external create : unit => wrapper = "create"; +[@bs.module "antd/lib/form"] external create: unit => wrapper = "create"; let wrapper = (~component, ~make', ~props, ~children) => { let wrapper = create(); let reactClass' = ReasonReact.wrapReasonForJs(~component, _ => make'([||])); @@ -38,7 +36,7 @@ let wrapper = (~component, ~make', ~props, ~children) => { ReasonReact.wrapJsForReason(~reactClass, ~props, children); }; module Item = { - [@bs.module "antd/lib/form"] external item : ReasonReact.reactClass = "Item"; + [@bs.module "antd/lib/form"] external item: ReasonReact.reactClass = "Item"; let make = ( ~colon=?, @@ -57,21 +55,19 @@ module Item = { ReasonReact.wrapJsForReason( ~reactClass=item, ~props= - Js.Undefined.( - { - "colon": unwrapBool(colon), - "validateStatus": from_opt(validateStatus), - "extra": from_opt(extra), - "className": from_opt(className), - "required": unwrapBool(required), - "style": from_opt(style), - "label": from_opt(label), - "id": from_opt(id), - "wrapperCol": from_opt(wrapperCol), - "help": from_opt(help), - "hasFeedback": unwrapBool(hasFeedback), - "labelCol": from_opt(labelCol), - } - ), + Js.Undefined.{ + "colon": unwrapBool(colon), + "validateStatus": fromOption(validateStatus), + "extra": fromOption(extra), + "className": fromOption(className), + "required": unwrapBool(required), + "style": fromOption(style), + "label": fromOption(label), + "id": fromOption(id), + "wrapperCol": fromOption(wrapperCol), + "help": fromOption(help), + "hasFeedback": unwrapBool(hasFeedback), + "labelCol": fromOption(labelCol), + }, ); }; \ No newline at end of file diff --git a/client/yarn.lock b/client/yarn.lock index f0e39825b..7e04bed8f 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1171,6 +1171,11 @@ react-split-pane "^0.1.77" react-treebeard "^2.1.0" +"@types/async@2.0.50": + version "2.0.50" + resolved "https://registry.yarnpkg.com/@types/async/-/async-2.0.50.tgz#117540e026d64e1846093abbd5adc7e27fda7bcb" + integrity sha512-VMhZMMQgV1zsR+lX/0IBfAk+8Eb7dPVMWiQGFAt3qjo5x7Ml6b77jUo0e1C3ToD+XRDXqtrfw+6AB0uUsPEr3Q== + "@types/babel__core@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" @@ -1685,6 +1690,15 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" +apollo-cache-inmemory@1.3.11: + version "1.3.11" + resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.3.11.tgz#6cb8f24ec812715169f9acbb0b67833f9a19ec90" + integrity sha512-fSoyjBV5RV57J3i/VHDDB74ZgXc0PFiogheNFHEhC0mL6rg5e/DjTx0Vg+csIBk23gvlzTvV+eypx7Q2NJ+dYg== + dependencies: + apollo-cache "^1.1.21" + apollo-utilities "^1.0.26" + optimism "^0.6.6" + apollo-cache-inmemory@^1.2.9: version "1.5.1" resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.5.1.tgz#265d1ee67b0bf0aca9c37629d410bfae44e62953" @@ -1696,7 +1710,14 @@ apollo-cache-inmemory@^1.2.9: ts-invariant "^0.2.1" tslib "^1.9.3" -apollo-cache@1.2.1, apollo-cache@^1.2.1: +apollo-cache@1.1.21: + version "1.1.21" + resolved "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.1.21.tgz#950025e2272741ba8e5064419906e3ac4072925d" + integrity sha512-5ErNb78KHtrJNimkDBTEigcvHkIqUmS7QJIk4lpZZ+XLVVgvk2fD+GhD1PLP+s8vHfAKVbO6vdbRxCCjGGrh5w== + dependencies: + apollo-utilities "^1.0.26" + +apollo-cache@1.2.1, apollo-cache@^1.1.21, apollo-cache@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.2.1.tgz#aae71eb4a11f1f7322adc343f84b1a39b0693644" integrity sha512-nzFmep/oKlbzUuDyz6fS6aYhRmfpcHWqNkkA9Bbxwk18RD6LXC4eZkuE0gXRX0IibVBHNjYVK+Szi0Yied4SpQ== @@ -1704,6 +1725,21 @@ apollo-cache@1.2.1, apollo-cache@^1.2.1: apollo-utilities "^1.2.1" tslib "^1.9.3" +apollo-client@2.4.7: + version "2.4.7" + resolved "https://registry.yarnpkg.com/apollo-client/-/apollo-client-2.4.7.tgz#b6712fd4c9ba346e3c44cfec7e6868e532b6a957" + integrity sha512-6aAm+16AFBYZhJF8eKxrup6AbYni01InDiwTfZhMMTP2xaXQWjsQnfaHbI2oE+hd3+AZFy1drkse8RZKghR/WQ== + dependencies: + "@types/zen-observable" "^0.8.0" + apollo-cache "1.1.21" + apollo-link "^1.0.0" + apollo-link-dedup "^1.0.0" + apollo-utilities "1.0.26" + symbol-observable "^1.0.2" + zen-observable "^0.8.0" + optionalDependencies: + "@types/async" "2.0.50" + apollo-client@^2.4.1: version "2.5.1" resolved "https://registry.yarnpkg.com/apollo-client/-/apollo-client-2.5.1.tgz#36126ed1d32edd79c3713c6684546a3bea80e6d1" @@ -1719,12 +1755,19 @@ apollo-client@^2.4.1: tslib "^1.9.3" zen-observable "^0.8.0" -apollo-link-context@^1.0.8: - version "1.0.15" - resolved "https://registry.yarnpkg.com/apollo-link-context/-/apollo-link-context-1.0.15.tgz#9e5dc3eb874b3ed975f0bb0062a65aa946fd30a2" - integrity sha512-CkUB0CaaNGCsiNxG6GImPSsXHL8f+lQZukl2TLdpDKao3EyCuPC9gSWvclUagwZ1TDnY8O+wJnNBDGymQiZTsA== +apollo-link-context@1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/apollo-link-context/-/apollo-link-context-1.0.10.tgz#c20b0b32c6e4e08c0d3967174f9c2a897c8431fe" + integrity sha512-HX3BEmkANs2A8AcYCy92SFJrW+0SbGrhDTSHV6ZwKIJ9ZrsOtly8cMrRLzEw1emjHIz5SP7XJEn3ko7BwhBBSw== dependencies: - apollo-link "^1.2.9" + apollo-link "^1.2.4" + +apollo-link-context@^1.0.17: + version "1.0.17" + resolved "https://registry.yarnpkg.com/apollo-link-context/-/apollo-link-context-1.0.17.tgz#439272cfb43ec1891506dd175ed907845b7de36c" + integrity sha512-W5UUfHcrrlP5uqJs5X1zbf84AMXhPZGAqX/7AQDgR6wY/7//sMGfJvm36KDkpIeSOElztGtM9z6zdPN1NbT41Q== + dependencies: + apollo-link "^1.2.11" tslib "^1.9.3" apollo-link-dedup@^1.0.0: @@ -1735,41 +1778,71 @@ apollo-link-dedup@^1.0.0: apollo-link "^1.2.9" tslib "^1.9.3" -apollo-link-error@^1.1.0: - version "1.1.8" - resolved "https://registry.yarnpkg.com/apollo-link-error/-/apollo-link-error-1.1.8.tgz#3a957b22b843cf6c307d516709cdc42371c9aafe" - integrity sha512-5hbMIBaINWOsZapWgTF8H2X0q3NjrQD/y4HlqDnUeLmT12OqejLasNh+EFE6q37/l28UHQu1/AuyRn15J7gvCA== +apollo-link-error@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/apollo-link-error/-/apollo-link-error-1.1.2.tgz#d068fdf99892e6fc65cfe0390db8528d182f9481" + integrity sha512-zlEZiqQ42E49+BeX3mIKPkMTSlOPrYNEwzSi1MubUiP/Bi6QRP7tzdJXNBnUpkW6MjZJQpfSNZNxK/xwvPiJIw== dependencies: - apollo-link "^1.2.9" - apollo-link-http-common "^0.2.11" + apollo-link "^1.2.4" + +apollo-link-error@^1.1.10: + version "1.1.10" + resolved "https://registry.yarnpkg.com/apollo-link-error/-/apollo-link-error-1.1.10.tgz#ce57f0793f0923b598655de5bf5e028d4cf4fba6" + integrity sha512-itG5UV7mQqaalmRkuRsF0cUS4zW2ja8XCbxkMZnIEeN24X3yoJi5hpJeAaEkXf0KgYNsR0+rmtCQNruWyxDnZQ== + dependencies: + apollo-link "^1.2.11" + apollo-link-http-common "^0.2.13" tslib "^1.9.3" -apollo-link-http-common@^0.2.11: - version "0.2.11" - resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.11.tgz#d4e494ed1e45ea0e0c0ed60f3df64541d0de682d" - integrity sha512-FjtzEDiG6blH/2MR4fpVNoxdZUFmddP0sez34qnoLaYz6ABFbTDlmRE/dVN79nPExM4Spfs/DtW7KRqyjJ3tOg== +apollo-link-http-common@^0.2.13, apollo-link-http-common@^0.2.5, apollo-link-http-common@^0.2.6: + version "0.2.13" + resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.13.tgz#c688f6baaffdc7b269b2db7ae89dae7c58b5b350" + integrity sha512-Uyg1ECQpTTA691Fwx5e6Rc/6CPSu4TB4pQRTGIpwZ4l5JDOQ+812Wvi/e3IInmzOZpwx5YrrOfXrtN8BrsDXoA== dependencies: - apollo-link "^1.2.9" + apollo-link "^1.2.11" ts-invariant "^0.3.2" tslib "^1.9.3" -apollo-link-http@^1.5.4: - version "1.5.12" - resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.12.tgz#878d48bf9d8ae091752710529a222c4a5548118e" - integrity sha512-2tS36RIU6OdxzoWYTPrjvDTF2sCrnlaJ6SL7j0ILPn1Lmw4y6YLwKDsv/SWLwtodtVe9v1dLCGKIGMRMM/SdyA== +apollo-link-http@1.5.7: + version "1.5.7" + resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.7.tgz#098615c427a910ec8c5817476bbabe68c586b339" + integrity sha512-EZ9nynHjwYCpGYP5IsRrZGTWidUVpshk7MuSG4joqGtJMwpFCgMQz+y3BHdUhowHtfAd9z60XmeOTG9FJolb8A== dependencies: - apollo-link "^1.2.9" - apollo-link-http-common "^0.2.11" + apollo-link "^1.2.4" + apollo-link-http-common "^0.2.6" + +apollo-link-http@^1.5.14: + version "1.5.14" + resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.14.tgz#ed6292248d1819ccd16523e346d35203a1b31109" + integrity sha512-XEoPXmGpxFG3wioovgAlPXIarWaW4oWzt8YzjTYZ87R4R7d1A3wKR/KcvkdMV1m5G7YSAHcNkDLe/8hF2nH6cg== + dependencies: + apollo-link "^1.2.11" + apollo-link-http-common "^0.2.13" tslib "^1.9.3" -apollo-link-ws@^1.0.8: - version "1.0.15" - resolved "https://registry.yarnpkg.com/apollo-link-ws/-/apollo-link-ws-1.0.15.tgz#1a0132ee3c700640d64c5b00ad8cff5cb974ff62" - integrity sha512-zXYfvKBpgf7QXIIEO11qgKLYyodo1mDkJr2IojcvOqbGGtqi7+DtOxX21/mrM2pzcwczYGCSDrtFhas4A7RnNA== +apollo-link-ws@1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/apollo-link-ws/-/apollo-link-ws-1.0.8.tgz#ac1de8f29e92418728479a9a523af9f75b9ccc8b" + integrity sha512-ucuGvr8CBBwCHl/Rbtyuv9Fn0FN5Qoyvy84KHtuMl2Uux2Sq+jt3bUum+pZ+hZntEd9k8M1OjrrXqRJ4PtEpyA== dependencies: - apollo-link "^1.2.9" + apollo-link "^1.2.2" + +apollo-link-ws@^1.0.17: + version "1.0.17" + resolved "https://registry.yarnpkg.com/apollo-link-ws/-/apollo-link-ws-1.0.17.tgz#a7ec3f90d2651b77d6be9bb6e63deff2efac56d4" + integrity sha512-0PKgahM2BOcUiI3QSJMYXOoUylWKzar5NTZLgMLEW4K/CczOTzC4CTXvKMjh/cx57Jto/U2xzKRy9BEoNfnK5Q== + dependencies: + apollo-link "^1.2.11" tslib "^1.9.3" +apollo-link@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.4.tgz#ab4d21d2e428db848e88b5e8f4adc717b19c954b" + integrity sha512-B1z+9H2nTyWEhMXRFSnoZ1vSuAYP+V/EdUJvRx9uZ8yuIBZMm6reyVtr1n0BWlKeSFyPieKJy2RLzmITAAQAMQ== + dependencies: + apollo-utilities "^1.0.0" + zen-observable-ts "^0.8.11" + apollo-link@^1.0.0, apollo-link@^1.2.2, apollo-link@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.9.tgz#40a8f0b90716ce3fd6beb27b7eae1108b92e0054" @@ -1780,7 +1853,33 @@ apollo-link@^1.0.0, apollo-link@^1.2.2, apollo-link@^1.2.9: tslib "^1.9.3" zen-observable-ts "^0.8.16" -apollo-utilities@1.2.1, apollo-utilities@^1.0.20, apollo-utilities@^1.2.1: +apollo-link@^1.2.11, apollo-link@^1.2.3, apollo-link@^1.2.4: + version "1.2.11" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.11.tgz#493293b747ad3237114ccd22e9f559e5e24a194d" + integrity sha512-PQvRCg13VduLy3X/0L79M6uOpTh5iHdxnxYuo8yL7sJlWybKRJwsv4IcRBJpMFbChOOaHY7Og9wgPo6DLKDKDA== + dependencies: + apollo-utilities "^1.2.1" + ts-invariant "^0.3.2" + tslib "^1.9.3" + zen-observable-ts "^0.8.18" + +apollo-upload-client@9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/apollo-upload-client/-/apollo-upload-client-9.1.0.tgz#13191714ae07388088f2c773ebbfd53ba2f64c53" + integrity sha512-ZN5gsbBjImEZTWWTUHpCEGDasnoBGbaODpznQ5EawyNHceuFYSNJbbft+ZZ841vZAcj9XZdKUKoaLBlMZ/r7nw== + dependencies: + apollo-link "^1.2.3" + apollo-link-http-common "^0.2.5" + extract-files "^4.0.0" + +apollo-utilities@1.0.26: + version "1.0.26" + resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.0.26.tgz#589c66bf4d16223531351cf667a230c787def1da" + integrity sha512-URw7o3phymliqYCYatcird2YRPUU2eWCNvip64U9gQrX56mEfK4m99yBIDCMTpmcvOFsKLii1sIEZsHIs/bvnw== + dependencies: + fast-json-stable-stringify "^2.0.0" + +apollo-utilities@1.2.1, apollo-utilities@^1.0.0, apollo-utilities@^1.0.20, apollo-utilities@^1.0.26, apollo-utilities@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.2.1.tgz#1c3a1ebf5607d7c8efe7636daaf58e7463b41b3c" integrity sha512-Zv8Udp9XTSFiN8oyXOjf6PMHepD4yxxReLsl6dPUy5Ths7jti3nmlBzZUOxuTWRwZn0MoclqL7RQ5UEJN8MAxg== @@ -4150,7 +4249,7 @@ core-js@^1.0.0: resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= -core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.3: +core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0, core-js@^2.5.3: version "2.6.5" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== @@ -5423,6 +5522,11 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" +eventemitter3@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.3.tgz#b5e1079b59fb5e1ba2771c0a993be060a58c99ba" + integrity sha1-teEHm1n7XhuidxwKmTvgYKWMmbo= + eventemitter3@^3.0.0, eventemitter3@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" @@ -5617,6 +5721,11 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" +extract-files@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-4.1.0.tgz#2d5b64af688dfd030274ca542c43fabba325019a" + integrity sha512-2gjdb3dVzr1ie9+K8pupPTnsNkK4qmzbTFOIxghiWoh6nCTajGCGC72ZNYX0nBWy5IOq1FXfRVgvkkLqqE4sdw== + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -5700,6 +5809,11 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" +fbjs-css-vars@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8" + integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ== + fbjs@^0.8.0, fbjs@^0.8.12, fbjs@^0.8.15, fbjs@^0.8.16, fbjs@^0.8.9: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" @@ -5713,6 +5827,20 @@ fbjs@^0.8.0, fbjs@^0.8.12, fbjs@^0.8.15, fbjs@^0.8.16, fbjs@^0.8.9: setimmediate "^1.0.5" ua-parser-js "^0.7.18" +fbjs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-1.0.0.tgz#52c215e0883a3c86af2a7a776ed51525ae8e0a5a" + integrity sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA== + dependencies: + core-js "^2.4.1" + fbjs-css-vars "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" @@ -6136,11 +6264,23 @@ grapheme-breaker@^0.3.2: brfs "^1.2.0" unicode-trie "^0.3.1" +graphql-tag@2.10.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.0.tgz#87da024be863e357551b2b8700e496ee2d4353ae" + integrity sha512-9FD6cw976TLLf9WYIUPCaaTpniawIjHWZSwIRZSjrfufJamcXbVVYfN2TWvJYbw0Xf2JjYbl1/f2+wDnBVw3/w== + graphql-tag@^2.9.2: version "2.10.1" resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.1.tgz#10aa41f1cd8fae5373eaf11f1f67260a3cad5e02" integrity sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg== +graphql@14.0.2: + version "14.0.2" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.0.2.tgz#7dded337a4c3fd2d075692323384034b357f5650" + integrity sha512-gUC4YYsaiSJT1h40krG3J+USGlwhzNTXSb4IOZljn9ag5Tj+RkoXrWp+Kh7WyE3t1NCfab5kzCuxBIvOMERMXw== + dependencies: + iterall "^1.2.2" + graphql@^14.1.1: version "14.1.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.1.1.tgz#d5d77df4b19ef41538d7215d1e7a28834619fac0" @@ -7211,7 +7351,7 @@ istanbul-reports@^2.1.1: dependencies: handlebars "^4.1.0" -iterall@^1.2.1, iterall@^1.2.2: +iterall@^1.1.1, iterall@^1.2.1, iterall@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA== @@ -7942,6 +8082,11 @@ lodash._getnative@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= +lodash.assign@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -7962,6 +8107,11 @@ lodash.flattendeep@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= +lodash.flowright@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/lodash.flowright/-/lodash.flowright-3.5.0.tgz#2b5fff399716d7e7dc5724fe9349f67065184d67" + integrity sha1-K1//OZcW1+fcVyT+k0n2cGUYTWc= + lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" @@ -7982,11 +8132,21 @@ lodash.isequal@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= +lodash.isobject@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-3.0.2.tgz#3c8fb8d5b5bf4bf90ae06e14f2a530a4ed935e1d" + integrity sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0= + lodash.isplainobject@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= + lodash.keys@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" @@ -8899,7 +9059,7 @@ opn@^5.2.0: dependencies: is-wsl "^1.1.0" -optimism@^0.6.9: +optimism@^0.6.6, optimism@^0.6.9: version "0.6.9" resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.6.9.tgz#19258ff8b3be0cea29ac35f06bff818e026e30bb" integrity sha512-xoQm2lvXbCA9Kd7SCx6y713Y7sZ6fUc5R6VYpoL5M6svKJbTuvtNopexK8sO8K4s0EOUYHuPN2+yAEsNyRggkQ== @@ -10714,6 +10874,18 @@ re-classnames@^3.0.0: resolved "https://registry.yarnpkg.com/re-classnames/-/re-classnames-3.0.0.tgz#34ae947bfbd57eadd29f855256336d628a242d1e" integrity sha512-gErGogzPy9LuJBYx9pNtWXjvFPrSnjk3R8d+TNa1PHpMoPcJKBITaCvVi9wLFtYTBiFW5KaHEvZhKx61DSW40A== +react-apollo@2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/react-apollo/-/react-apollo-2.3.2.tgz#b8e287d2813722b9e0a886cabf8149ab3b84a3b7" + integrity sha512-3lU9iqmj4KMIZvlWWSuLihxMGLEAL6oNmnSTWrb3/mRP36Zy0zJD4rdaonDx4WzqFYQAnUPaOiFnHGp0UQUTwA== + dependencies: + fbjs "^1.0.0" + hoist-non-react-statics "^3.0.0" + invariant "^2.2.2" + lodash.flowright "^3.5.0" + lodash.isequal "^4.5.0" + prop-types "^15.6.0" + react-apollo@^2.1.11: version "2.5.2" resolved "https://registry.yarnpkg.com/react-apollo/-/react-apollo-2.5.2.tgz#6732c6af55e6adc9ebf97bf189e867a893c449d3" @@ -11013,10 +11185,24 @@ realpath-native@^1.1.0: dependencies: util.promisify "^1.0.0" -reason-apollo@^0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/reason-apollo/-/reason-apollo-0.13.0.tgz#5727831dc6d49271a318dfb36724186b81d9890c" - integrity sha512-PeJltFH53Z0mhyoKdADeLg/7CBALOlXg1L+n6SbvNmUgKYzIm5nXfPxd9YD0SuH3nxEPszFAmA/kEWStguCj4Q== +reason-apollo@^0.15.0: + version "0.15.2" + resolved "https://registry.yarnpkg.com/reason-apollo/-/reason-apollo-0.15.2.tgz#0452196fc07915907cc0d629679aa56a8c16933c" + integrity sha512-L0S6u2yHrBOgnZGz4WY2svjCXgbqM9+h8uirPEAj9mWLMuUGszmiR0aO/77ZNpfTrQL9JZ3Dxu6zyVUWdM5xuQ== + dependencies: + apollo-cache-inmemory "1.3.11" + apollo-client "2.4.7" + apollo-link "1.2.4" + apollo-link-context "1.0.10" + apollo-link-error "1.1.2" + apollo-link-http "1.5.7" + apollo-link-ws "1.0.8" + apollo-upload-client "9.1.0" + apollo-utilities "1.0.26" + graphql "14.0.2" + graphql-tag "2.10.0" + react-apollo "2.3.2" + subscriptions-transport-ws "0.9.0" reason-react@^0.4.2: version "0.4.2" @@ -12256,6 +12442,20 @@ stylis@^3.5.0: resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe" integrity sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q== +subscriptions-transport-ws@0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.0.tgz#3dedd96a8fd01e63bdaf855c2ca0dcc68a87102e" + integrity sha512-4TP6IcZ1/z8AgT4B3Tji8SiLUHD8xzC1yCdzkJWshMYt0UbtYybJtasy/X6GYq9KavmAA60vZRRjfqjqD1tauw== + dependencies: + backo2 "^1.0.2" + eventemitter3 "^2.0.3" + iterall "^1.1.1" + lodash.assign "^4.2.0" + lodash.isobject "^3.0.2" + lodash.isstring "^4.0.1" + symbol-observable "^1.0.4" + ws "^3.0.0" + subscriptions-transport-ws@^0.9.14: version "0.9.16" resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.16.tgz#90a422f0771d9c32069294c08608af2d47f596ec" @@ -12726,6 +12926,11 @@ uglifyjs-webpack-plugin@^1.2.4: webpack-sources "^1.1.0" worker-farm "^1.5.2" +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== + uncss@^0.16.2: version "0.16.2" resolved "https://registry.yarnpkg.com/uncss/-/uncss-0.16.2.tgz#3b2269c59012da7c66cbe98fbedddeef94f0649c" @@ -13607,6 +13812,15 @@ write-file-atomic@2.4.1: imurmurhash "^0.1.4" signal-exit "^3.0.2" +ws@^3.0.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + ws@^5.1.1, ws@^5.2.0: version "5.2.2" resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" @@ -13761,6 +13975,14 @@ yargs@~3.10.0: decamelize "^1.0.0" window-size "0.1.0" +zen-observable-ts@^0.8.11, zen-observable-ts@^0.8.18: + version "0.8.18" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.18.tgz#ade44b1060cc4a800627856ec10b9c67f5f639c8" + integrity sha512-q7d05s75Rn1j39U5Oapg3HI2wzriVwERVo4N7uFGpIYuHB9ff02P/E92P9B8T7QVC93jCMHpbXH7X0eVR5LA7A== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + zen-observable-ts@^0.8.16: version "0.8.16" resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.16.tgz#969367299074fe17422fe2f46ee417e9a30cf3fa" From 4cae49ab4f1b4d9278833132fa6ff7de80cde2fa Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 13:45:36 +0100 Subject: [PATCH 17/22] Minor client channel membership fixes --- .../src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re | 2 +- client/src/pages/Channel/ChannelMembers.re | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re b/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re index a59055302..645383bff 100644 --- a/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re +++ b/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re @@ -1,6 +1,6 @@ module Query = [%graphql {| - mutation channelMembershipDelete($input: ChannelMembershipRoleInput!) { + mutation channelMembershipDelete($input: ChannelMembershipDeleteInput!) { channelMembershipDelete(input: $input) { agentId } diff --git a/client/src/pages/Channel/ChannelMembers.re b/client/src/pages/Channel/ChannelMembers.re index bccf476fe..24655500b 100644 --- a/client/src/pages/Channel/ChannelMembers.re +++ b/client/src/pages/Channel/ChannelMembers.re @@ -116,7 +116,7 @@ let make = ) | "Admin" => E.React.showIf( - canX(`CHANNEL_MEMBERSHIP_DELETE, record), + canX(`CHANNEL_MEMBERSHIP_ROLE_UPDATE, record), changeRoleAction( record##agentId, channelId, @@ -136,7 +136,7 @@ let make = ~render= (~text, ~record, ~index) => E.React.showIf( - canX(`CHANNEL_MEMBERSHIP_ROLE_UPDATE, record), + canX(`CHANNEL_MEMBERSHIP_DELETE, record), removeFromChannel(record##agentId, channelId), ), (), From 8de7416a07908fa1242ea137ed8fb88de477e220 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 13:53:16 +0100 Subject: [PATCH 18/22] Make sure that removing channel member refreshes list in client --- .../graphql/Foretold__GraphQL__ChannelMembershipDelete.re | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re b/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re index 645383bff..ca1458071 100644 --- a/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re +++ b/client/src/graphql/Foretold__GraphQL__ChannelMembershipDelete.re @@ -22,7 +22,12 @@ let mutate = (mutation: Mutation.apolloMutation, agentId, channelId) => { ); mutation( ~variables=m##variables, - ~refetchQueries=[|"getChannels", "user"|], + ~refetchQueries=[| + "getChannels", + "user", + "getChannel", + "getChannelMemberships", + |], (), ) |> ignore; From f00d281ec6bc1d1bafad4127745fa32f1f1a2eac Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 22:22:48 +0100 Subject: [PATCH 19/22] Replaced fancy auto-complete Select ith simple form, because Select broke prod --- client/src/pages/Measurable/MeasurableForm.re | 47 ++++++++++++------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/client/src/pages/Measurable/MeasurableForm.re b/client/src/pages/Measurable/MeasurableForm.re index ec649fa30..00dae4b49 100644 --- a/client/src/pages/Measurable/MeasurableForm.re +++ b/client/src/pages/Measurable/MeasurableForm.re @@ -80,14 +80,19 @@ let dataSource = {"key": r |> Graph_T.Thing.id, "id": r |> Graph_T.Thing.id} ); -let dataSourceSelectItems = - dataSource - |> E.A.fmap(r => - - {r##id |> ste} - - ) - |> ReasonReact.array; +/* let dataSourceSelectItems = + dataSource + |> E.A.fmap(r => + + {r##id |> ste} + + ) + |> ReasonReact.array; */ +/* handleChange(`labelSubject, e)}> + dataSourceSelectItems + */ let showForm = (~form: SignUpForm.state, ~handleSubmit, ~handleChange) => @@ -111,18 +116,28 @@ let showForm = (~form: SignUpForm.state, ~handleSubmit, ~handleChange) => form.values.showDescriptionProperty == "TRUE", <> - handleChange(`labelSubject, e)}> - dataSourceSelectItems - + onChange={ + e => + handleChange( + `labelSubject, + ReactEvent.Form.target(e)##value, + ) + } + /> - handleChange(`labelProperty, e)}> - dataSourceSelectItems - + onChange={ + e => + handleChange( + `labelProperty, + ReactEvent.Form.target(e)##value, + ) + } + /> Date: Mon, 22 Apr 2019 23:04:22 +0100 Subject: [PATCH 20/22] Test for heroku --- client/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/package.json b/client/package.json index 29441671a..8544a0103 100644 --- a/client/package.json +++ b/client/package.json @@ -8,7 +8,7 @@ "parcel": "API_URL=${API_URL:-http://localhost:4000/graphql} AUTH0_DOMAIN=${AUTH0_DOMAIN:-guesstimate.auth0.com} AUTH0_CLIENT_ID=${AUTH0_CLIENT_ID:-gn1bwgJfK5Y6jfL6x7t6fB43ZAN3eSnT} parcel ./src/index.html --public-url /", "parcel-staging": "parcel ./src/index.html --public-url /", "parcel-production": "parcel ./src/index.html --public-url /", - "build": "parcel build ./src/index.html", + "build": "parcel build ./src/index.html --no-source-maps", "serve": "static-server ./dist -p ${PORT} -d", "build-t": "npm run clean && npm run build-bsb && npm run build", "test": "jest --ci --bail --no-cache", From 136f7737e30f806a3824d3ad7d81796730a190cd Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 23:07:50 +0100 Subject: [PATCH 21/22] Use yarn on heroku --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a2dd4d626..7e19e00dc 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "npm": ">=6.4.0" }, "scripts": { - "client/install": "cd client && npm install && cd ..", + "client/install": "cd client && yarn install && cd ..", "client/build": "cd client && npm run build-t && cd ..", "client/serve": "cd client && npm run serve && cd ..", "server/install": "cd server && npm install && cd ..", @@ -24,4 +24,4 @@ }, "author": "", "license": "MIT" -} +} \ No newline at end of file From 98eb397c4ab2befd74ca6c2f5f428ea50a5f9db4 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 22 Apr 2019 23:10:23 +0100 Subject: [PATCH 22/22] Changed yarn back to npm for heroku --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7e19e00dc..4f1ac8bf0 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "npm": ">=6.4.0" }, "scripts": { - "client/install": "cd client && yarn install && cd ..", + "client/install": "cd client && npm install && cd ..", "client/build": "cd client && npm run build-t && cd ..", "client/serve": "cd client && npm run serve && cd ..", "server/install": "cd server && npm install && cd ..",