Component Guide – REMS
Colors
Brand colors
[color-boxes]
Alerts
[alerts]
Text and background colors
[text-and-background]
Buttons
Button
[buttons]
Navigation
rems.navbar/nav-link (src/cljs/rems/navbar.cljs:27:1)
A link to path that is shown as active when the current browser location matches the path. By default checks if path is a prefix of location, but if match-mode is :exact, checks that path is exactly location.
Here are examples of what the inactive and active nav-links look like.The examples use nav-link-impl because we can't fake the :path subscription.
Spinner
rems.spinner/small (src/cljs/rems/spinner.cljs:17:1)
Small spinner for indicating loading or in-progress state.
small spinner
[small]
rems.spinner/big (src/cljs/rems/spinner.cljs:6:1)
Big spinner for indicating loading or in-progress state.
big spinner
[big]
Language switcher widget
rems.language-switcher/language-switcher (src/cljs/rems/language_switcher.cljs:13:1)
Language switcher widget
language-switcher
[language-switcher]
Login
rems.auth.oidc/login-component (src/cljs/rems/auth/oidc.cljs:6:1)
No documentation available.
Cart components
rems.cart/item-view (src/cljs/rems/cart.cljs:61:1)
No documentation available.
item-view, single
[:table.rems-table.cart [:tbody [item-view {:localizations {:en {:title "Item title"}}} true]]]
Item title
item-view, one of many has no apply button
[:table.rems-table.cart [:tbody [item-view {:localizations {:en {:title "Item title"}}} false]]]
Item title
rems.cart/bundle-view (src/cljs/rems/cart.cljs:69:1)
No documentation available.
bundle-view
[:table.rems-table.cart [bundle-view [{:localizations {:en {:title "Item title 1"}}} {:localizations {:en {:title "Item title 2"}}} {:localizations {:en {:title "Item title 3"}}}]]]
Item title 1 Item title 2 Item title 3 Hae 3 aineistoa yhdessä Hae
rems.cart/cart-list (src/cljs/rems/cart.cljs:81:1)
List of shopping cart items
cart-list empty
[cart-list [] nil]
Hae käyttöoikeuksia lisäämällä resursseja koriin. Samaa hakemusta käyttävät resurssit yhdistyvät korissa yhdeksi hakemukseksi.
cart-list with two items of different workflow
[cart-list [{:localizations {:en {:title "Item title"}}, :wfid 1} {:localizations {:en {:title "Another title"}}, :wfid 2}]]
cart-list with three items of same workflow and two of different
[cart-list [{:localizations {:en {:title "First title"}}, :wfid 2} {:localizations {:en {:title "Second title"}}, :wfid 1} {:localizations {:en {:title "Third title"}}, :wfid 1} {:localizations {:en {:title "Fourth title"}}, :wfid 1} {:localizations {:en {:title "Fifth title"}}, :wfid 3}]]
cart-list with five items of same workflow but of two different forms
[cart-list [{:localizations {:en {:title "First form"}}, :wfid 1, :formid 1} {:localizations {:en {:title "Second form"}}, :wfid 1, :formid 2} {:localizations {:en {:title "First form"}}, :wfid 1, :formid 1} {:localizations {:en {:title "Second form"}}, :wfid 1, :formid 2} {:localizations {:en {:title "First form"}}, :wfid 1, :formid 1}]]
Hae käyttöoikeuksia lisäämällä resursseja koriin. Samaa hakemusta käyttävät resurssit yhdistyvät korissa yhdeksi hakemukseksi.
First form | |
First form | |
First form | |
Second form | |
Second form | |
Hae 5 aineistoa yhdessä Hae |
Application list
rems.application-list/list (src/cljs/rems/application_list.cljs:135:1)
No documentation available.
empty list
[list {:id :rems.application-list/example1, :applications :rems.application-list/no-applications}]
Tunniste | Tunniste | Tunniste | Otsikko | Resurssi | Hakija | Käsittelijät | Tila | Toimia tarvitaan | Luotu | Lähetetty | Muokattu | Toiminnot |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Ei rivejä |
applications, default order, limited columns
[list {:id :rems.application-list/example2, :applications :rems.application-list/example-applications, :visible-columns #{:description :last-activity :created :state :id :resource :applicant :view}}]
Tunniste | Otsikko | Resurssi | Hakija | Tila | Luotu | Muokattu | Toiminnot |
---|---|---|---|---|---|---|---|
1 | Item 5 | Alice Applicant | Luonnos | 1980-01-02 13:45 | 2017-01-01 01:01 | ||
2 | Item 3 | Bob Tester | Haettu | 1971-02-03 23:59 | 2017-01-01 01:01 | ||
3 | Item 1 | Bob Tester | Haettu | 1971-02-03 23:59 | 2017-01-01 01:01 | ||
4 | Item 2, Item 5 | Charlie Tester | Hyväksytty | 1980-01-01 01:01 | 2017-01-01 01:01 | ||
5 | Item 2 | David Newuser | Hylätty | 1972-12-12 12:12 | 2017-01-01 01:01 | ||
6 | Item 2 | Ernie Tester | Suljettu | 1972-12-12 12:12 | 2017-01-01 01:01 |
applications, sort descending date, all columns
[list {:id :rems.application-list/example3, :applications :rems.application-list/example-applications, :default-sort-column :created, :default-sort-order :desc}]
Tunniste | Tunniste | Tunniste | Otsikko | Resurssi | Hakija | Käsittelijät | Tila | Toimia tarvitaan | Luotu | Lähetetty | Muokattu | Toiminnot |
---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Item 5 | Alice Applicant | Luonnos | 1980-01-02 13:45 | 2017-01-01 01:01 | |||||||
4 | Item 2, Item 5 | Charlie Tester | Hyväksytty | 1980-01-01 01:01 | 2017-01-01 01:01 | |||||||
5 | Item 2 | David Newuser | Hylätty | 1972-12-12 12:12 | 2017-01-01 01:01 | |||||||
6 | Item 2 | Ernie Tester | Suljettu | 1972-12-12 12:12 | 2017-01-01 01:01 | |||||||
2 | Item 3 | Bob Tester | Haettu | 1971-02-03 23:59 | 1971-03-04 00:00 | 2017-01-01 01:01 | ||||||
3 | Item 1 | Bob Tester | Haettu | 1971-02-03 23:59 | 1971-03-04 00:00 | 2017-01-01 01:01 |
Collapsible component
rems.collapsible/component (src/cljs/rems/collapsible.cljs:120:1)
Collapsible content block that can show hidden content on click. Contains distinct border, and location of toggle controls are customizable. Pass a map of options with the following keys: - `:always` component displayed always before collapsible area - `:bottom-less-button?` should bottom show less button be shown? - `:collapse` component that is toggled displayed or not - `:collapse-hidden` component that is displayed when content is collapsed - `:footer` component displayed always after collapsible area - `:id` unique string - `:on-close` triggers the function callback given as an argument when show less is clicked - `:on-open` triggers the function callback given as an argument when collapse is toggled open - `:class` string/keyword/vector, for wrapping element - `:group` string, only one collapsible in group can be open at a time - `:open?` should the collapsible be initially open? - `:title` component or text displayed in title area - `:top-less-button?` should top show less button be shown?
default use
[component {:id "standard-collapsible-1", :title "Standard", :always [:p "I am content that is always visible"], :collapse [:p "I am content that you can hide"]}]
Standard
I am content that is always visible
no hide controls
[component {:id "standard-collapsible-2", :title "Focus on show", :always [:p "Collapsed input receives focus when opened"], :collapse [:input]}]
Focus on show
Collapsed input receives focus when opened
no collapse content
[component {:id "standard-collapsible-3", :title "No collapse", :always [:p "I am content that is always visible"], :footer [:div.solid-group "I am the footer that is always visible"]}]
No collapse
I am content that is always visible
all options
[component {:on-close #(js/console.log "bye"), :top-less-button? true, :footer [:div.solid-group "I am the footer that is always visible"], :title "Highly customized", :id "standard-collapsible-4", :bottom-less-button? true, :open? true, :collapse-hidden [:p "I am content that is only visible when collapsed"], :collapse (into [:div] (repeat 3 [:p "I am long content that you can hide"])), :on-open #(js/console.log "hello"), :always [:div.solid-group [:b "Custom controls:"] [rems.collapsible/toggle-control {:collapsible-id "standard-collapsible-4"}]]}]
Highly customized
I am long content that you can hide
I am long content that you can hide
I am long content that you can hide
rems.collapsible/minimal (src/cljs/rems/collapsible.cljs:163:1)
Collapsible variation that does not have border or title, and controls must be provided externally with e.g. `rems.collapsible/toggle-control`. Pass a map of options with the following keys: - `:always` component displayed always before collapsible area - `:collapse` component that is toggled displayed or not - `:collapse-hidden` component that is displayed when content is collapsed - `:class` optional class for wrapping element - `:footer` component displayed always after collapsible area - `:id` (required) unique id - `:group` string, only one collapsible in group can be open at a time - `:open?` should the collapsible be initially open? - `:title` component or text displayed in title area
default use
[minimal {:id "minimal-collapsible-1", :always [rems.collapsible/toggle-control {:collapsible-id "minimal-collapsible-1"}], :collapse [:p "I am content that you can hide"]}]
footer controls
[minimal {:id "minimal-collapsible-2", :footer [rems.collapsible/toggle-control {:collapsible-id "minimal-collapsible-2"}], :collapse [:p "I am content that you can hide"]}]
all options
[minimal {:id "minimal-collapsible-3", :open? true, :always [rems.collapsible/toggle-control {:collapsible-id "minimal-collapsible-3"}], :collapse (into [:div] (repeat 3 [:p "I am long content that you can hide"])), :collapse-hidden [:p "I am content that is only visible when collapsed"], :footer [rems.collapsible/toggle-control {:collapsible-id "minimal-collapsible-3"}]}]
I am long content that you can hide
I am long content that you can hide
I am long content that you can hide
rems.collapsible/expander (src/cljs/rems/collapsible.cljs:191:1)
Collapsible variation where simple title is the toggle control. Pass a map of options with the following keys: - `:collapse` component that is toggled displayed or not - `:id` (required) unique id - `:class` string/keyword/vector, for wrapping element - `:group` string, only one collapsible in group can be open at a time - `:open?` should the collapsible be initially open? - `:title` component or text displayed in title area
defaults
[expander {:id "expander-collapsible-1", :title "The whole header is clickable", :collapse (into [:div] (repeat 3 [:p "I am content that you can hide"]))}]
all options
[expander {:id "expander-collapsible-2", :title [:h3.m-0 "Initially open"], :collapse (into [:div] (repeat 3 [:p "I am content that you can hide"])), :open? true}]
Applications
rems.application/member-info (src/cljs/rems/application.cljs:886:1)
Renders a applicant, member or invited member of an application `:id` - id, used for generating unique ids `:attributes` - user attributes to display `:application` - application `:group?` - specifies if a group border is rendered `:simple?` - specifies if we want to simplify by leaving out expansion and heading, defaults to false
member-info: applicant with notification email, accepted licenses, researcher status
[member-info {:id "info1", :attributes {:userid "developer@uu.id", :email "developer@uu.id", :name "Deve Loper", :notification-email "notification@example.com", :organizations [#:organization{:id "Testers"} #:organization{:id "Users"}], :address "Testikatu 1, 00100 Helsinki", :researcher-status-by "so"}, :application #:application{:id 42, :applicant {:userid "developer@uu.id"}, :licenses [#:license{:id 1}], :accepted-licenses {"developer@uu.id" #{1}}}}]
Hakija
member-info with name missing
[member-info {:id "info2", :attributes {:userid "developer", :email "developer@uu.id", :address "Testikatu 1, 00100 Helsinki"}}]
Jäsen
member-info with buttons, licenses not accepted
[member-info {:id "info3", :attributes {:userid "alice"}, :application #:application{:id 42, :applicant {:userid "developer"}, :licenses [#:license{:id 1}], :permissions #{:application.command/change-applicant :application.command/remove-member}}, :group? true}]
Jäsen
member-info: invited member
[member-info {:id "info4", :attributes {:name "John Smith", :email "john.smith@invited.com"}, :application #:application{:id 42, :applicant {:userid "developer"}}, :group? true}]
Kutsuttu jäsen
member-info: invited member, with remove button
[member-info {:id "info5", :attributes {:name "John Smith", :email "john.smith@invited.com"}, :application #:application{:id 42, :applicant {:userid "developer"}, :permissions #{:application.command/uninvite-member}}, :group? true}]
Kutsuttu jäsen
member-info: not grouped
[member-info {:id "info6", :group? false, :attributes {:userid "developer@uu.id", :email "developer@uu.id", :name "Deve Loper"}}]
Jäsen
member-info: simple
[member-info {:id "info7", :simple? true, :attributes {:userid "developer@uu.id", :email "developer@uu.id", :name "Deve Loper"}}]
rems.application/applicants-info (src/cljs/rems/application.cljs:967:1)
Renders the applicants, i.e. applicant and members.
applicants-info: multiple applicants
[applicants-info #:application{:id 42, :applicant {:userid "developer", :email "developer@uu.id", :name "Deve Loper"}, :members #{{:userid "bob"} {:userid "alice"}}, :invited-members #{{:name "John Smith", :email "john.smith@invited.com"}}, :licenses [#:license{:id 1}], :accepted-licenses {"developer" #{1}}, :permissions #{:application.command/invite-member :application.command/add-member}}]
Hakijat
applicants-info: only one applicant without permissions should show a simple singular block
[applicants-info #:application{:id 42, :applicant {:userid "developer", :email "developer@uu.id", :name "Deve Loper"}, :members #{}, :invited-members #{}, :licenses [#:license{:id 1}], :accepted-licenses {"developer" #{1}}, :permissions #{}}]
Hakija
rems.application/disabled-items-warning (src/cljs/rems/application.cljs:1271:1)
No documentation available.
should be hidden for an applicant
[disabled-items-warning #:application{:state :application.state/submitted, :resources [#:catalogue-item{:enabled false, :archived false, :title {:en "Disabled catalogue item"}}]}]
- Disabled catalogue item
no disabled items
[disabled-items-warning #:application{:permissions #{:see-everything}}]
two disabled items
[disabled-items-warning #:application{:permissions #{:see-everything}, :state :application.state/submitted, :resources [#:catalogue-item{:enabled true, :archived true, :title {:en "Catalogue item 1"}} #:catalogue-item{:enabled false, :archived false, :title {:en "Catalogue item 2"}} #:catalogue-item{:enabled true, :archived false, :title {:en "Catalogue item 3"}}]}]
- Catalogue item 1
- Catalogue item 2
rems.application/blacklist-warning (src/cljs/rems/application.cljs:64:1)
No documentation available.
no blacklist
[blacklist-warning {}]
three entries
[blacklist-warning #:application{:resources [{:resource/ext-id "urn:11", :catalogue-item/title {:fi "11", :sv "11", :en "11"}} {:resource/ext-id "urn:12", :catalogue-item/title {:fi "12", :sv "12", :en "12"}}], :blacklist [#:blacklist{:user {:userid "user1", :name "First User", :email "first@example.com"}, :resource #:resource{:ext-id "urn:11"}} #:blacklist{:user {:userid "user1", :name "First User", :email "first@example.com"}, :resource #:resource{:ext-id "urn:12"}} #:blacklist{:user {:userid "user2", :name "Second User", :email "second@example.com"}, :resource #:resource{:ext-id "urn:11"}}]}]
- First User: 11
- First User: 12
- Second User: 11
rems.application/license-field (src/cljs/rems/application.cljs:503:1)
No documentation available.
link license
[license-field #:application{:id 123} #:license{:id 1, :type :link, :title {:en "Link to license"}, :link {:en "https://creativecommons.org/licenses/by/4.0/deed.en"}} false]
link license, not accepted
[license-field #:application{:id 123} {:license/id 1, :license/type :link, :license/title {:en "Link to license"}, :license/link {:en "https://creativecommons.org/licenses/by/4.0/deed.en"}, :accepted false} true]
link license, accepted
[license-field #:application{:id 123} {:license/id 1, :license/type :link, :license/title {:en "Link to license"}, :license/link {:en "https://creativecommons.org/licenses/by/4.0/deed.en"}, :accepted true} true]
text license
[license-field #:application{:id 123} #:license{:id 1, :type :text, :title {:en "A Text License"}, :text {:en lipsum-paragraphs}} false]
attachment license
[license-field #:application{:id 123} #:license{:id 1, :type :attachment, :title {:en "A Text License"}, :text {:en lipsum-paragraphs}} false]
rems.application/actions-form (src/cljs/rems/application.cljs:1069:1)
No documentation available.
no actions available
[actions-form #:application{:id 123, :permissions #{}} {}]
Toiminnot
some actions available
[actions-form #:application{:id 123, :permissions #{:application.command/save-draft}} {:show-pdf-action true}]
Toiminnot
all actions available
[actions-form #:application{:id 123, :permissions #{:application.command/copy-as-new :application.command/submit :application.command/request-review :application.command/review :application.command/reject :application.command/revoke :application.command/request-decision :application.command/decide :application.command/remark :application.command/save-draft :application.command/approve :application.command/return :application.command/assign-external-id :application.command/close}, :attachments [#:attachment{:filename "foo.txt"} #:attachment{:filename "bar.txt"}]}]
rems.application/render-application (src/cljs/rems/application.cljs:1283:1)
No documentation available.
application, partially filled, as applicant, one unsupported field
[render-application {:application #:application{:id 17, :applicant {:userid "applicant"}, :roles #{:applicant}, :permissions #{:application.command/accept-licenses}, :state :application.state/draft, :resources [#:catalogue-item{:title {:en "An applied item"}}], :forms [#:form{:id 1, :fields [#:field{:id "fld1", :type :text, :title {:en "Field 1"}, :placeholder {:en "placeholder 1"}} {:field/id "fld2", :field/type :label, :title "Please input your wishes below."} #:field{:id "fld3", :type :texta, :optional true, :title {:en "Field 2"}, :placeholder {:en "placeholder 2"}} #:field{:id "fld4", :type :unsupported, :title {:en "Field 3"}, :placeholder {:en "placeholder 3"}} #:field{:id "fld5", :type :date, :title {:en "Field 4"}}]}], :licenses [#:license{:id 4, :type :text, :title {:en "A Text License"}, :text {:en lipsum}} #:license{:id 5, :type :link, :title {:en "Link to license"}, :link {:en "https://creativecommons.org/licenses/by/4.0/deed.en"}}]}, :edit-application {:field-values {1 {"fld1" "abc"}}, :show-diff {}, :validation {:errors nil, :warnings nil}, :accepted-licenses {"applicant" #{5}}}, :userid "applicant"}]
Täytä hakemus ja lähetä se käsiteltäväksi. Hakemukseen voi kutsua jäseniksi useampia hakijoita, joista jokaisen on hyväksyttävä käyttöehdot viimeistään kun hakemus on hyväksytty.
Tila
Hakija
Resurssit
An applied item
Käyttöehdot
Jokaisen hakijan on hyväksyttävä käyttöehdot käyttääkseen resursseja.
Tiedot
Unsupported field {:field/title {:en "Field 3"}, :app-id 17, :readonly true, :form/id 1, :on-toggle-diff #object[Function], :field/type :unsupported, :field/value nil, :field/id "fld4", :validation nil, :on-change #object[l], :field/placeholder {:en "placeholder 3"}, :diff nil}
Toiminnot
application, applied
[render-application {:application #:application{:id 17, :state :application.state/submitted, :resources [#:catalogue-item{:title {:en "An applied item"}}], :forms [#:form{:id 1, :fields [#:field{:id "fld1", :type :text, :title {:en "Field 1"}, :placeholder {:en "placeholder 1"}}]}], :licenses [#:license{:id 4, :type :text, :title {:en "A Text License"}, :text {:en lipsum}}]}}]
Täytä hakemus ja lähetä se käsiteltäväksi. Hakemukseen voi kutsua jäseniksi useampia hakijoita, joista jokaisen on hyväksyttävä käyttöehdot viimeistään kun hakemus on hyväksytty.
Tila
Hakija
Resurssit
An applied item
Käyttöehdot
Jokaisen hakijan on hyväksyttävä käyttöehdot käyttääkseen resursseja.
Tiedot
Toiminnot
application, approved
[render-application {:application #:application{:id 17, :state :application.state/approved, :applicant {:userid "userid", :email "email@example.com", :additional "additional field"}, :resources [#:catalogue-item{:title {:en "An applied item"}}], :forms [#:form{:id 1, :fields [#:field{:id "fld1", :type :text, :title {:en "Field 1"}, :placeholder {:en "placeholder 1"}}]}], :licenses [#:license{:id 4, :type :text, :title {:en "A Text License"}, :text {:en lipsum}}]}}]
Täytä hakemus ja lähetä se käsiteltäväksi. Hakemukseen voi kutsua jäseniksi useampia hakijoita, joista jokaisen on hyväksyttävä käyttöehdot viimeistään kun hakemus on hyväksytty.
Tila
Hakija
Resurssit
An applied item
Käyttöehdot
Jokaisen hakijan on hyväksyttävä käyttöehdot käyttääkseen resursseja.
Tiedot
Toiminnot
rems.application/event-view (src/cljs/rems/application.cljs:709:1)
No documentation available.
simple event
[event-view nil #:event{:time #inst "2020-01-01T08:35:00.000000000-00:00", :type :application.event/submitted, :actor-attributes {:userid "alice", :name "Alice Applicant"}}]
event with comment & decision
[event-view nil {:event/time #inst "2020-01-01T08:35:00.000000000-00:00", :event/type :application.event/decided, :event/actor-attributes {:name "Hannah Handler"}, :application/decision :rejected, :application/comment "This application is bad."}]
event with comment & attachment
(let [opts {:attachments [#:attachment{:filename "verylongfilename_loremipsum_dolorsitamet.pdf"}]}] [event-view opts {:event/time #inst "2020-01-01T08:35:00.000000000-00:00", :event/type :application.event/remarked, :event/actor-attributes {:name "Hannah Handler"}, :application/comment (str lipsum "\n\nA final line.")}])
event with anonymized user
[event-view nil {:event/time #inst "2020-01-01T08:35:00.000000000-00:00", :event/type :application.event/remarked, :event/actor-attributes {:userid "rems-handler"}, :application/comment "I could be reviewer 1 or reviewer 2, but you will never know."}]
event that redacts and replaces attachments
(let [opts {:attachments [#:attachment{:filename "new_image.jpeg"} #:attachment{:filename "new_document.pdf"}], :redacted-attachments [#:attachment{:filename "image_alice.jpeg", :redacted true} #:attachment{:filename "document_alice.pdf", :redacted true}]}] [event-view opts {:event/time #inst "2023-10-04T06:50:00.000000000-00:00", :event/type :application.event/attachments-redacted, :event/actor-attributes {:name "Hannah Handler"}, :application/comment (str lipsum "\n\nA final line.")}])
event where redacted attachments filenames are hidden
(let [opts {:attachments (list #:attachment{:filename :filename/redacted} #:attachment{:filename "document.pdf"} #:attachment{:filename :filename/redacted})}] [event-view opts #:event{:time #inst "2023-10-04T06:50:00.000000000-00:00", :type :application.event/remarked, :actor-attributes {:name "Hannah Handler"}}])
event with many attachments
(let [opts {:attachments (list #:attachment{:filename "document.txt"} #:attachment{:filename "agreement.doc", :redacted true} #:attachment{:filename "binding.834c530d-1a72-46c3-9593-f84269a915bf.pdf", :redacted true} #:attachment{:filename "document.txt"} #:attachment{:filename "document.7097ae1c-ba94-47b0-a551-9f127da5e277.jpeg"} #:attachment{:filename "document.6b10763b-f1b7-435d-aaf0-b327805f58fc.pdf", :redacted true} #:attachment{:filename "binding.important.txt"})}] [event-view opts #:event{:time #inst "2023-10-04T06:50:00.000000000-00:00", :type :application.event/approved, :actor-attributes {:name "Hannah Handler"}}])
rems.application/application-copy-notice (src/cljs/rems/application.cljs:777:1)
No documentation available.
no copies
[application-copy-notice {}]
copied from
[application-copy-notice #:application{:copied-from #:application{:id 1, :external-id "2018/10"}}]
copied to one
[application-copy-notice #:application{:copied-to [#:application{:id 2, :external-id "2019/20"}]}]
copied to many
[application-copy-notice #:application{:copied-to [#:application{:id 2, :external-id "2019/20"} #:application{:id 3, :external-id "2020/30"}]}]
Form fields
rems.fields/multi-attachment-view (src/cljs/rems/fields.cljs:329:1)
No documentation available.
no attachments
[multi-attachment-view {:id "action-guide-example-1", :attachment nil, :on-attach (fn [_] nil)}]
multiple attachments
[multi-attachment-view {:id "action-guide-example-1", :attachments [#:attachment{:filename "attachment.xlsx"} #:attachment{:filename "data.pdf"}], :on-attach (fn [_] nil)}]
multiple attachments, long filenames
[multi-attachment-view {:id "action-guide-example-1", :label "Long filenames", :attachments [#:attachment{:filename "this_is_the_very_very_very_long_filename_of_a_test_file_the_file_itself_is_quite_short_though_abcdefghijklmnopqrstuvwxyz0123456789_overflow_overflow_overflow.txt"} #:attachment{:filename "this_is_another_very_very_very_long_filename_of_another_test_file_the_file_itself_is_quite_short_though_abcdefghijklmnopqrstuvwxyz0123456789_overflow_overflow_overflow.txt"}], :on-attach (fn [_] nil)}]
rems.fields/field (src/cljs/rems/fields.cljs:463:1)
No documentation available.
field of type "text"
[field {:form/id 1, :field/id "1", :field/type :text, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}}]
field of type "text" with info field
[field {:form/id 1, :field/id "info-1", :field/type :text, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :field/info-text {:en "Extra information about the field, \n\n maybe it even contains a link, such as https://en.wikipedia.org/wiki/Igor_Stravinsky\n \n\n or https://en.wikipedia.org/wiki/Dmitri_Shostakovich"}}]
field of type "text" with maximum length
[field {:form/id 2, :field/id "1", :field/type :text, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :field/max-length 10}]
field of type "text" with validation error and link in title
[field {:form/id 3, :field/id "1", :field/type :text, :field/title {:en "Title http://google.com"}, :field/placeholder {:en "placeholder"}, :validation {:type :t.form.validation/required}}]
non-editable field of type "text" without text
[field {:form/id 4, :field/id "1", :field/type :text, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :readonly true}]
non-editable field of type "text" with text
[field {:form/id 5, :field/id "1", :field/type :text, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :readonly true, :field/value lipsum-short}]
field of type "texta"
[field {:form/id 6, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}}]
field of type "texta" with maximum length
[field {:form/id 7, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :field/max-length 10}]
field of type "texta" with validation error
[field {:form/id 8, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :validation {:type :t.form.validation/required}}]
non-editable field of type "texta"
[field {:form/id 9, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :readonly true, :field/value lipsum-paragraphs}]
editable field of type "texta" with previous value, diff hidden
[field {:form/id 10, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :field/value lipsum-paragraphs, :field/previous-value previous-lipsum-paragraphs}]
editable field of type "texta" with previous value, diff shown
[field {:form/id 11, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :field/value lipsum-paragraphs, :field/previous-value previous-lipsum-paragraphs, :diff true}]
non-editable field of type "texta" with previous value, diff hidden
[field {:form/id 12, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :readonly true, :field/value lipsum-paragraphs, :field/previous-value previous-lipsum-paragraphs}]
non-editable field of type "texta" with previous value, diff shown
[field {:field/title {:en "Title"}, :readonly true, :form/id 13, :field/type :texta, :field/value lipsum-paragraphs, :field/previous-value previous-lipsum-paragraphs, :field/id "1", :field/placeholder {:en "placeholder"}, :diff true}]
non-editable field of type "texta" with previous value equal to current value
[field {:form/id 14, :field/id "1", :field/type :texta, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}, :readonly true, :field/value lipsum-paragraphs, :field/previous-value lipsum-paragraphs}]
field of type "attachment"
[field {:app-id 5, :form/id 15, :field/id "6", :field/type :attachment, :field/title {:en "Title"}}]
field of type "attachment", two files uploaded
[field {:app-id 5, :form/id 16, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "test.txt"} #:attachment{:id 456, :filename "second.pdf"}]}]
field of type "attachment", file uploaded, long filename
[field {:app-id 5, :form/id 16, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "this_is_the_very_very_very_long_filename_of_a_test_file_the_file_itself_is_quite_short_though_abcdefghijklmnopqrstuvwxyz0123456789_overflow_overflow_overflow.txt"}]}]
field of type "attachment", file uploaded, success indicator
[field {:app-id 5, :form/id 17, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "test.txt"}], :field/attachment-status :success}]
field of type "attachment", file uploaded, failure indicator
[field {:app-id 5, :form/id 17, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "test.txt"}], :field/attachment-status :error}]
field of type "attachment", file uploaded, spinner
[field {:app-id 5, :form/id 17, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "test.txt"}], :field/attachment-status :pending}]
field of type "attachment", previous and new file uploaded, diff shown
[field {:field/title {:en "Title"}, :app-id 5, :field/previous-attachments [#:attachment{:id 789, :filename "old.txt"}], :form/id 18, :field/type :attachment, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "new.txt"} #:attachment{:id 456, :filename "new2.txt"}], :field/previous-value "456", :field/id "6", :diff true}]
field of type "attachment", previous and new file uploaded, diff hidden
[field {:field/title {:en "Title"}, :app-id 5, :field/previous-attachment [#:attachment{:id 456, :filename "old.txt"}], :form/id 19, :field/type :attachment, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "new.txt"} #:attachment{:id 456, :filename "new2.txt"}], :field/previous-value "456", :field/id "6"}]
field of type "attachment", lots of files, diff shown
[field {:field/title {:en "Title"}, :app-id 5, :field/previous-attachments (repeat 20 #:attachment{:id 789, :filename "old.txt"}), :form/id 18, :field/type :attachment, :field/value "123", :field/attachments (repeat 20 #:attachment{:id 123, :filename "new.txt"}), :field/previous-value "456", :field/id "6", :diff true}]
field of type "attachment", previous file uploaded, new deleted, diff shown
[field {:app-id 5, :form/id 20, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/previous-value "456", :field/previous-attachments [#:attachment{:id 456, :filename "old.txt"}], :diff true}]
field of type "attachment", previous file uploaded, new deleted, diff hidden
[field {:app-id 5, :form/id 21, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :field/previous-value "456", :field/previous-attachments [#:attachment{:id 456, :filename "old.txt"}]}]
non-editable field of type "attachment"
[field {:app-id 5, :form/id 22, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :readonly true}]
non-editable field of type "attachment", files uploaded
[field {:app-id 5, :form/id 23, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :readonly true, :field/value "123", :field/attachments [#:attachment{:id 123, :filename "test.txt"} #:attachment{:id 456, :filename "second.pdf"}]}]
non-editable field of type "attachment", many many files
[field {:app-id 5, :form/id 23, :field/id "6", :field/type :attachment, :field/title {:en "Title"}, :readonly true, :field/value "123", :field/attachments (repeat 100 #:attachment{:id 123, :filename "test.txt"})}]
field of type "date"
[field {:form/id 24, :field/id "1", :field/type :date, :field/title {:en "Title"}}]
field of type "date" with value
[field {:form/id 25, :field/id "1", :field/type :date, :field/title {:en "Title"}, :field/value "2000-12-31"}]
non-editable field of type "date"
[field {:form/id 26, :field/id "1", :field/type :date, :field/title {:en "Title"}, :readonly true, :field/value ""}]
non-editable field of type "date" with value
[field {:form/id 27, :field/id "1", :field/type :date, :field/title {:en "Title"}, :readonly true, :field/value "2000-12-31"}]
field of type "option"
[field {:form/id 28, :field/id "1", :field/type :option, :field/title {:en "Title"}, :field/value "y", :field/options [{:key "y", :label {:en "Yes", :fi "Kyllä"}} {:key "n", :label {:en "No", :fi "Ei"}}]}]
non-editable field of type "option"
[field {:form/id 29, :field/id "1", :field/type :option, :field/title {:en "Title"}, :field/value "y", :readonly true, :field/options [{:key "y", :label {:en "Yes", :fi "Kyllä"}} {:key "n", :label {:en "No", :fi "Ei"}}]}]
field of type "multiselect"
[field {:form/id 30, :field/id "1", :field/type :multiselect, :field/title {:en "Title"}, :field/value "egg bacon", :field/options [{:key "egg", :label {:en "Egg", :fi "Munaa"}} {:key "bacon", :label {:en "Bacon", :fi "Pekonia"}} {:key "spam", :label {:en "Spam", :fi "Lihasäilykettä"}}]}]
non-editable field of type "multiselect"
[field {:form/id 31, :field/id "1", :field/type :multiselect, :field/title {:en "Title"}, :field/value "egg bacon", :readonly true, :field/options [{:key "egg", :label {:en "Egg", :fi "Munaa"}} {:key "bacon", :label {:en "Bacon", :fi "Pekonia"}} {:key "spam", :label {:en "Spam", :fi "Lihasäilykettä"}}]}]
optional field
[field {:form/id 32, :field/id "1", :field/type :texta, :field/optional true, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}}]
field of type "label"
[field {:form/id 33, :field/id "1", :field/type :label, :field/title {:en "Lorem ipsum dolor sit amet"}}]
field of type "description"
[field {:form/id 34, :field/id "1", :field/type :description, :field/title {:en "Title"}, :field/placeholder {:en "placeholder"}}]
field of type "table"
[field {:form/id 35, :field/id "1", :field/type :table, :field/title {:en "Lorem ipsum dolor sit amet"}, :field/columns [{:key "col1", :label {:en "First column"}} {:key "col2", :label {:en "Second column"}} {:key "col3", :label {:en "Third column"}}], :field/value [[{:column "col1", :value "aaaaa"} {:column "col2", :value "bbbbbb"} {:column "col3", :value "ccccccc"}] [{:column "col1", :value "ddddd"} {:column "col2", :value "eeeeee"} {:column "col3", :value "fffffff"}]]}]
non-editable field of type "table"
[field {:readonly true, :form/id 36, :field/id "1", :field/type :table, :field/title {:en "Lorem ipsum dolor sit amet"}, :field/columns [{:key "col1", :label {:en "First column"}} {:key "col2", :label {:en "Second column"}} {:key "col3", :label {:en "Third column"}}], :field/value [[{:column "col1", :value "aaaaa"} {:column "col2", :value "bbbbbb"} {:column "col3", :value "ccccccc"}] [{:column "col1", :value "ddddd"} {:column "col2", :value "eeeeee"} {:column "col3", :value "fffffff"}]]}]
First column | Second column | Third column |
---|---|---|
aaaaa | bbbbbb | ccccccc |
ddddd | eeeeee | fffffff |
empty non-editable field of type "table"
[field {:readonly true, :form/id 36, :field/id "1", :field/type :table, :field/title {:en "Lorem ipsum dolor sit amet"}, :field/columns [{:key "col1", :label {:en "First column"}} {:key "col2", :label {:en "Second column"}} {:key "col3", :label {:en "Third column"}}], :field/value []}]
First column | Second column | Third column |
---|---|---|
Ei rivejä |
diff for field of type "table"
[field {:diff true, :form/id 36, :field/id "1", :field/type :table, :field/title {:en "Lorem ipsum dolor sit amet"}, :field/columns [{:key "col1", :label {:en "First column"}} {:key "col2", :label {:en "Second column"}} {:key "col3", :label {:en "Third column"}}], :field/previous-value [[{:column "col1", :value "aaaaa"} {:column "col2", :value "bbbbbb"} {:column "col3", :value "ccccccc"}] [{:column "col1", :value "ddddd"} {:column "col2", :value "eeeeee"} {:column "col3", :value "fffffff"}]], :field/value [[{:column "col1", :value "aaaaa"} {:column "col2", :value "bbxxxxbb"} {:column "col3", :value "ccccccc"}] [{:column "col1", :value "yyyyy"} {:column "col2", :value "eeeeee"} {:column "col3", :value "fffffff"}] [{:column "col1", :value "1"} {:column "col2", :value "2"} {:column "col3", :value "3"}]]}]
First column | Second column | Third column |
---|---|---|
aaaaa | bb | ccccccc |
eeeeee | fffffff | |
1 | 2 | 3 |
Application actions
Profile
rems.profile/missing-email-warning-dialog (src/cljs/rems/profile.cljs:58:1)
No documentation available.
warning message
[missing-email-warning-dialog]
Administration
rems.administration.administration/navigator (src/cljs/rems/administration/administration.cljs:22:1)
No documentation available.
navigator
[navigator]
Misc components
rems.paging/paging-field (src/cljs/rems/paging.cljs:24:1)
Component for showing page numbers. Intended to be used together with a `rems.table/table` through `rems.table/paging`. `:id` - identity of the component (derived from table) `:on-change` - callback `:paging` - paging state (with table) `:current-page` - the current page (0-indexed) `:show-all-page-numbers` - state of whether to show all page numbers or `...` `:pages` - how many pages exist
no pages
[paging-field {:id "paging1", :pages 0}]
1 page
[paging-field {:id "paging2", :pages 1}]
9 pages, current page 2
[paging-field {:id "paging4", :paging {:current-page 1}, :pages 9}]
100 pages, current page 2, not opened
[paging-field {:id "paging5", :paging {:current-page 1}, :pages 100}]
100 pages, current page 2, opened all page numbers
[paging-field {:id "paging5", :paging {:current-page 1, :show-all-page-numbers true}, :pages 100}]
rems.table (src/cljs/rems/table.cljs:1:5)
No documentation available.
rems.table/table (src/cljs/rems/table.cljs:466:1)
A filterable and sortable table component. Meant to be used together with the `rems.table/search` component. See `rems.table/Table` for the `table` parameter schema.
empty table
(rf/reg-sub :rems.table/empty-table-rows (fn [_ _] []))
[table {:id :rems.table/example0, :columns [{:key :first-name, :title "First name", :sortable? false, :filterable? false} {:key :last-name, :title "Last name", :sortable? false, :filterable? false}], :rows [:rems.table/empty-table-rows], :default-sort-column :first-name}]
First name | Last name |
---|---|
Ei rivejä |
static table with three rows
(defn- example-commands [text] {:td [:td.commands [:button.btn.btn-primary {:on-click #(do (js/alert (str "View " text)) (.stopPropagation %))} "View"]]})
(def example-data [{:key 1, :first-name {:value "Cody"}, :last-name {:value "Turner"}, :commands (example-commands "Cody")} {:key 2, :first-name {:value "Melanie"}, :last-name {:value "Palmer"}, :commands (example-commands "Melanie")} {:key 3, :first-name {:value "Henry"}, :last-name {:value "Herring"}, :commands (example-commands "Henry")}])
(rf/reg-sub :rems.table/example-table-rows (fn [_ _] example-data))
(let [example1 {:id :rems.table/example1, :columns [{:key :first-name, :title "First name", :sortable? false, :filterable? false} {:key :last-name, :title "Last name", :sortable? false, :filterable? false}], :rows [:rems.table/example-table-rows], :default-sort-column :first-name}] [table example1])
First name | Last name |
---|---|
Cody | Turner |
Henry | Herring |
Melanie | Palmer |
table with selectable rows
The table components supports selection of rows. You can provide a callback for when the set of selected rows changes.
You have 0 rows selected.
[table {:id :rems.table/example-selectable, :columns [{:key :first-name, :title "First name", :sortable? false, :filterable? false} {:key :last-name, :title "Last name", :sortable? false, :filterable? false} {:key :commands, :sortable? false, :filterable? false, :aria-label (text :t.actions/commands)}], :rows [:rems.table/example-table-rows], :default-sort-column :first-name, :selectable? true, :on-select #(reset! example-selected-rows %)}]
First name | Last name | Toiminnot | |
---|---|---|---|
Cody | Turner | ||
Henry | Herring | ||
Melanie | Palmer |
sortable and filterable table
Filtering and search can be added by using the rems.table/search
component
(let [example2 {:id :rems.table/example2, :columns [{:key :first-name, :title "First name"} {:key :last-name, :title "Last name"} {:key :commands, :sortable? false, :filterable? false}], :rows [:rems.table/example-table-rows], :default-sort-column :first-name}] [:div [search example2] [table example2]])
First name | Last name | |
---|---|---|
Cody | Turner | |
Henry | Herring | |
Melanie | Palmer |
richer example data
Hawks have a special sort-value so they are always listed first (or last if order is flipped).Also, filtering ignores the word "Team".Also, the score has special styling.Eagles have special styling. :value is used for sorting & filtering but :td for rendering.
(def example-data-rich [{:key 1, :team {:display-value "Team Hawks", :filter-value "hawks", :sort-value "0000hawks"}, :points {:value 3, :display-value "-> 3 <-"}} {:key 2, :team {:value "Eagles", :td [:td.eagles-are-best [:em "Eagles"]]}, :points {:value 4}} {:key 3, :team {:value "Ravens"}, :points {:value 0}}])
(rf/reg-sub :rems.table/example-rich-table-rows (fn [_ _] example-data-rich))
Now the data can be used like so
(let [example3 {:id :rems.table/example3, :columns [{:key :team, :title "Team"} {:key :not-shown, :title "Not shown", :when-rows (constantly false)} {:key :points, :title "Points"}], :rows [:rems.table/example-rich-table-rows]}] [:div [search example3] [table example3]])
Team | Points |
---|---|
Team Hawks | -> 3 <- |
Eagles | 4 |
Ravens | 0 |
rems.tree (src/cljs/rems/tree.cljs:1:5)
No documentation available.
rems.tree/tree (src/cljs/rems/tree.cljs:519:1)
No documentation available.
empty tree
(rf/reg-sub :rems.tree/empty-tree-rows (fn [_ _] []))
[tree {:id "rems-tree-example0", :columns [{:key :first-name, :title "First name", :sortable? false, :filterable? false} {:key :last-name, :title "Last name", :sortable? false, :filterable? false}], :rows [:rems.tree/empty-tree-rows], :default-sort-column :first-name, :aria-label "Empty tree"}]
First name | Last name |
---|
static tree with a three level hierarchy
(defn- example-commands [text] [:div.commands.w-100 [:button.btn.btn-primary {:on-click #(do (js/alert (str "View " text)) (.stopPropagation %))} "View"]])
(def example-data [{:key 0, :name "Users", :children [{:key 1, :name "Applicants", :commands (example-commands "Applicants")} {:key 2, :name "Handlers", :commands (example-commands "Handlers")} {:key 3, :name "Administration", :commands (example-commands "Administration"), :children [{:key 4, :name "Reporters", :commands (example-commands "Reporters")} {:key 5, :name "Owners", :commands (example-commands "Owners"), :children [{:key 6, :name "Super Owners", :commands (example-commands "Super owners")} {:key 7, :name "Org Owners", :commands (example-commands "Org Owners")}]}]}], :commands (example-commands "Users")}])
(rf/reg-sub :rems.tree/example-tree-rows (fn [_ _] example-data))
[tree {:id "rems-tree-example1", :columns [{:key :name, :title "Name", :sortable? false, :filterable? false} {:key :commands, :content :commands, :sortable? false, :filterable? false}], :rows [:rems.tree/example-tree-rows], :default-sort-column :title, :aria-label "Static tree with a three level hierarchy"}]
Name | |
---|---|
Users |
sortable and filterable tree
Filtering and search can be added by using the rems.tree/search
component
(let [example2 {:id "rems-tree-example2", :show-matching-parents? true, :columns [{:key :name, :title "Name"} {:key :commands, :content :commands, :sortable? false, :filterable? false}], :rows [:rems.tree/example-tree-rows], :default-sort-column :title, :aria-label "Sortable and filterable tree"}] [:div [search example2] [tree example2]])
Name | |
---|---|
Users |
rems.dropdown/dropdown (src/cljs/rems/dropdown.cljs:10:1)
Single- or multi-choice, searchable dropdown menu. `:id` unique id for the input `:class` additional classes for the input `:items` items shown in dropdown `:item-key` getter for the key of an option, used as the id of an item `:item-label` getter for the label of an option shown in the dropdown `:item-selected?` is this item currently selected? `:hide-selected?` should the items that are selected be shown in the dropdown, defaults: false for single value, true for a multiple choice `:item-disabled?` is this item currently disabled? `:disabled?` is the whole input disabled? `:multi?` is this a multiple choice dropdown? `:clearable?` should there be a clear selection button? `:placeholder` text to show when nothing is selected, defaults to (text :t.dropdown/placeholder) `:on-change` called each time the value changes, one or seq
dropdown menu, single-choice, empty
(def example-items [{:id 1, :name "Alice"} {:id 2, :name "Bob"} {:id 3, :name "Carl"} {:id 4, :name "Own"} {:id 5, :name "Deve"}])
[dropdown {:items example-items, :item-key :id, :item-label :name, :on-change on-change}]
dropdown menu, single-choice, selected item Bob
[dropdown {:items example-items, :item-key :id, :item-label :name, :item-selected? #(= "Bob" (:name %)), :on-change on-change}]
dropdown menu, multi-choice, several values selected
[dropdown {:items example-items, :item-key :id, :item-label :name, :item-selected? #(contains? #{1 3 5} (% :id)), :multi? true, :on-change on-change}]
disabled dropdown menu, multi-choice, several values selected
[dropdown {:items example-items, :item-key :id, :item-label :name, :item-selected? #(contains? #{1 3 5} (% :id)), :multi? true, :disabled? true, :on-change on-change}]
dropdown menu, multi-choice, several values selected, hide selected
[dropdown {:items example-items, :item-key :id, :item-label :name, :item-selected? #(contains? #{1 3 5} (% :id)), :multi? true, :hide-selected? false, :on-change on-change}]
rems.dropdown/async-dropdown (src/cljs/rems/dropdown.cljs:50:1)
Single- or multi-choice, searchable dropdown menu with support for asynchronous data loading. `:id` unique id for the input `:class` additional classes for the input `:item-key` getter for the key of an option, used as the id of an item `:item-label` getter for the label of an option shown in the dropdown `:hide-selected?` should the items that are selected be shown in the dropdown, defaults: false for single value, true for a multiple choice `:item-selected?` is this item currently selected? `:item-disabled?` is this item currently disabled? `:disabled?` is the whole input disabled? `:multi?` is this a multiple choice dropdown? `:clearable?` should there be a clear selection button? `:placeholder` text to show when nothing is selected, defaults to (text :t.dropdown/placeholder) `:on-change` called each time the value changes, one or seq `:on-load-options` function called with :query-string and :on-data keys when dropdown should load new data
async dropdown menu, single choice, empty
[async-dropdown {:item-key :id, :item-label :name, :on-change on-change, :on-load-options (fn [{:keys [_ on-data]}] (js/setTimeout #(on-data example-items) 500))}]
async dropdown menu, multi-choice, empty
[async-dropdown {:item-key :id, :item-label :name, :multi? true, :on-change on-change, :on-load-options (fn [{:keys [_ on-data]}] (js/setTimeout #(on-data example-items) 500))}]
async dropdown menu, multi-choice, several values selected
[async-dropdown {:item-key :id, :item-label :name, :items @async-example-items, :multi? true, :on-change (comp on-change #(reset! async-example-items %)), :on-load-options (fn [{:keys [_ on-data]}] (js/setTimeout #(on-data example-items) 500))}]
rems.phase/phases (src/cljs/rems/phase.cljs:6:1)
Component for phase progress bar. state - the overall active state phases - seq where each phase has the following structure :phase - unique id of the phase :active? - is the phase currently active :completed? - has the phase been completed :approved? - is the phase an approve phase that has been approved :rejected? - is the phase an approve phase that has been rejected :revoked? - is the phase an approve phase that has been revoked :closed? - has the (application) been closed
phase with localized names for each phase
[phases :submitted [{:phase :apply, :completed? true, :text :t.phases/apply} {:phase :approve, :active? true, :text :t.phases/approve} {:phase :result, :text :t.phases/approved}]]
phase with approved application
[phases :approved [{:phase :apply, :completed? true, :text :t.phases/apply} {:phase :approve, :completed? true, :text :t.phases/approve} {:phase :result, :completed? true, :approved? true, :text :t.phases/approved}]]
phase with rejected application
[phases :rejected [{:phase :apply, :completed? true, :text :t.phases/apply} {:phase :approve, :completed? true, :rejected? true, :text :t.phases/approve} {:phase :result, :completed? true, :rejected? true, :text :t.phases/rejected}]]
phase with revoked application
[phases :revoked [{:phase :apply, :completed? true, :text :t.phases/apply} {:phase :approve, :completed? true, :approved? true, :text :t.phases/approve} {:phase :result, :completed? true, :revoked? true, :text :t.phases/revoked}]]
phase with closed application
[phases :closed [{:phase :apply, :closed? true, :text :t.phases/apply} {:phase :approve, :closed? true, :text :t.phases/approve} {:phase :result, :closed? true, :text :t.phases/approved}]]
rems.atoms/success-symbol (src/cljs/rems/atoms.cljs:51:1)
No documentation available.
success symbol
[success-symbol]
rems.atoms/failure-symbol (src/cljs/rems/atoms.cljs:54:1)
No documentation available.
failure symbol
[failure-symbol]
rems.atoms/readonly-checkbox (src/cljs/rems/atoms.cljs:107:1)
Displays a readonly checkbox.
readonly-checkbox unchecked
[readonly-checkbox {:value false}]
readonly-checkbox checked
[readonly-checkbox {:value true}]
checkbox interactive unchecked
[checkbox {:value @state, :on-change on-change}]
checkbox with id and class
[checkbox {:id :special, :class :text-danger, :value @state, :on-change on-change}]
rems.atoms/info-field (src/cljs/rems/atoms.cljs:147:1)
A component that shows a readonly field with title and value. Used for e.g. displaying applicant attributes. The `value` can be a simple primitive or a collection. Uses a simple approach that can be extended if needed. Deeply nested data structures would be difficult to fit, so they are not supported. Additional options: `:inline?` - puts the label and value on the same row `:box?` - wrap the value into a field value box (default true) `:multiline?` - puts the value in multiple rows, if possible. see `rems.atoms/format-field-values`
info-field with text
[info-field "Users" "Bob Tester"]
info-field with array
[info-field "Users" ["Bob Tester" "Jane Coder"]]
info-field with array, multline
[info-field "Users" ["Bob Tester" "Jane Coder"] {:multiline? true}]
info-field with boolean
[info-field "Users" false]
info-field with map
[info-field "Users" {"Bob Tester" false, "Jane Coder" true}]
info-field with nested data is unsupported but shows somehow
[info-field "Users" [{"Bob Tester" false, "Jane Coder" {:type :coder, :missing nil}}]]
info-field without box around value
[info-field "Users" "Bob Tester" {:box? false}]
info-field inline
[info-field "Users" ["Bob Tester" "Jane Coder"] {:inline? true}]
rems.atoms/attachment-link (src/cljs/rems/atoms.cljs:195:1)
No documentation available.
attachment-link
[attachment-link #:attachment{:id 1, :filename "my-attachment.pdf"}]
attachment-link, long filename
[attachment-link #:attachment{:id 123, :filename "this_is_the_very_very_very_long_filename_of_a_test_file_the_file_itself_is_quite_short_though_abcdefghijklmnopqrstuvwxyz0123456789_overflow_overflow_overflow.txt"}]
rems.atoms/action-link (src/cljs/rems/atoms.cljs:292:1)
Takes an `action` description and creates a link that triggers it.
example command as link
(def example-command {:id "example-command", :class "example-command", :label "Example", :url "http://example.com/command", :on-click #(js/alert "click example")})
[action-link example-command]
rems.atoms/action-button (src/cljs/rems/atoms.cljs:279:1)
Takes an `action` description and creates a button that triggers it.
rems.atoms/rate-limited-action-button (src/cljs/rems/atoms.cljs:304:1)
Takes an `action` description and creates a button that triggers it. Click events are rate limited.
example command as rate-limited button
(defn- stateful-context [& pairs] (r/with-let [n (r/atom 0) on-click #(do (r/rswap! n inc) (println @n))] [:<> (for [[c cmd] pairs] [:span.ml-1 [c (assoc cmd :on-click on-click)]]) [:span.ml-2 "Count: " @n]]))
[stateful-context [rate-limited-action-button example-command] [rate-limited-action-button (assoc example-command :id "second-rate-limited-button")]]
rems.atoms/commands (src/cljs/rems/atoms.cljs:352:1)
Creates a standard commands group with left alignment.
empty commands
[commands]
with commands
(def another-command {:id "another-command", :class "another-command", :label "Another", :url "http://example.com/another", :on-click #(js/alert "click another")})
[commands [action-button example-command] [action-button another-command]]
rems.atoms/commands-group-button (src/cljs/rems/atoms.cljs:357:1)
Displays a group of commands in a dropdown button. If there is just one, replaces the dropdown button with the actual command. The individual commands must follow the `action` format, and can be used in both link or button variant depending on the number of commands.
empty group
[commands-group-button]
with more commands
[commands-group-button {:label "Group"} example-command another-command]
rems.atoms/rate-limited-button (src/cljs/rems/atoms.cljs:262:1)
atoms/button variant that allows click handler to be called, at most, once per interval `:wait`. Only the 1st call will go through if called multiple times. * `:wait` interval in milliseconds
rate limited button
(r/with-let [n (r/atom 0)] [rate-limited-button {:on-click #(r/rswap! n inc), :text (str "Count: " @n)}])
rems.user/username (src/cljs/rems/user.cljs:11:1)
A rems.atoms/info-field with the name of the user.
full set of attributes
[username {:userid "developer@uu.id", :email "developer@example.com", :name "Deve Loper"}]
fallback to userid
[username {:userid "developer@uu.id", :email "developer@example.com"}]
empty attributes
[username {}]
rems.user/attributes (src/cljs/rems/user.cljs:17:1)
A div with a rems.atoms/info-field for every user attribute in the given attributes. `attributes` - map, user attributes `invited-user?` - boolean, if user is invited, shows different email string
full set of attributes, false invited-user status
[attributes {:userid "developer@uu.id", :email "developer@uu.id", :name "Deve Loper", :notification-email "notification@example.com", :organizations [#:organization{:id "Testers"} #:organization{:id "Users"}], :address "Testikatu 1, 00100 Helsinki", :researcher-status-by "so", :nickname "The Dev"} false]
invited member set of attributes, true invited-user status
[attributes {:userid "invited@member.com", :email "invited@member.com", :name "Invited Mamber", :notification-email "invited@member.com", :organizations []} true]
invalid value for researcher status, no invited-user status
[attributes {:userid "developer@uu.id", :email "developer@uu.id", :organizations [#:organization{:id "Testers"} #:organization{:id "Users"}], :researcher-status-by :dac}]
less attributes, no invited-user status
[attributes {:email "developer@uu.id", :organizations [#:organization{:id "Testers"} #:organization{:id "Users"}]}]
empty attributes, no invited-user status
[attributes {}]
rems.attachment/upload-button (src/cljs/rems/attachment.cljs:51:1)
No documentation available.
default use
(let [state (r/cursor guide-state ["attachment-upload-button"])] [upload-button {:id "attachment-upload-button", :label (:filename @state), :status (:status @state), :on-upload (fn [{:keys [filename]}] (swap! state assoc :filename filename :status :pending) (js/setTimeout #(swap! state assoc :status :success) 1000))}])
pending state
[upload-button {:id "pending-upload-button", :status :pending}]
show allowed extensions in different element
(into [:div [rems.attachment/allowed-extensions-info]] (for [lang @rems.config/languages] [upload-button {:id (str "attachment-upload-button-2-" (name lang)), :label (str/upper-case (name lang)), :hide-info? true}]))