├── .babelrc
├── .codeclimate.yml
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmignore
├── .travis.yml
├── CONTRIBUTING.md
├── HISTORY.md
├── LICENSE
├── README.md
├── admin
├── client
│ ├── App
│ │ ├── App.js
│ │ ├── components
│ │ │ ├── Footer
│ │ │ │ ├── index.js
│ │ │ │ └── test
│ │ │ │ │ └── component.test.js
│ │ │ └── Navigation
│ │ │ │ ├── Mobile
│ │ │ │ ├── ListItem.js
│ │ │ │ ├── SectionItem.js
│ │ │ │ ├── index.js
│ │ │ │ └── test
│ │ │ │ │ ├── ListItem.test.js
│ │ │ │ │ └── SectionItem.test.js
│ │ │ │ ├── Primary
│ │ │ │ ├── NavItem.js
│ │ │ │ ├── index.js
│ │ │ │ └── test
│ │ │ │ │ ├── NavItem.test.js
│ │ │ │ │ └── PrimaryNavigation.test.js
│ │ │ │ └── Secondary
│ │ │ │ ├── NavItem.js
│ │ │ │ ├── index.js
│ │ │ │ └── test
│ │ │ │ └── NavItem.test.js
│ │ ├── elemental
│ │ │ ├── Alert
│ │ │ │ ├── colors.js
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── BlankState
│ │ │ │ └── index.js
│ │ │ ├── Button
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Center
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Chip
│ │ │ │ ├── colors.js
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Container
│ │ │ │ ├── index.js
│ │ │ │ ├── sizes.js
│ │ │ │ └── styles.js
│ │ │ ├── DropdownButton
│ │ │ │ └── index.js
│ │ │ ├── Form
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── FormField
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── FormInput
│ │ │ │ ├── index.js
│ │ │ │ ├── noedit.js
│ │ │ │ └── styles.js
│ │ │ ├── FormLabel
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── FormNote
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── FormSelect
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Glyph
│ │ │ │ ├── colors.js
│ │ │ │ ├── index.js
│ │ │ │ ├── octicons.js
│ │ │ │ ├── sizes.js
│ │ │ │ └── styles.js
│ │ │ ├── GlyphButton
│ │ │ │ └── index.js
│ │ │ ├── GlyphField
│ │ │ │ └── index.js
│ │ │ ├── Grid
│ │ │ │ └── index.js
│ │ │ ├── GridCol
│ │ │ │ └── index.js
│ │ │ ├── GridRow
│ │ │ │ └── index.js
│ │ │ ├── InlineGroup
│ │ │ │ └── index.js
│ │ │ ├── InlineGroupSection
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── LabelledControl
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── LoadingButton
│ │ │ │ └── index.js
│ │ │ ├── Modal
│ │ │ │ ├── body.js
│ │ │ │ ├── dialog.js
│ │ │ │ ├── footer.js
│ │ │ │ ├── header.js
│ │ │ │ └── index.js
│ │ │ ├── Pagination
│ │ │ │ ├── index.js
│ │ │ │ └── page.js
│ │ │ ├── PassContext
│ │ │ │ └── index.js
│ │ │ ├── Portal
│ │ │ │ └── index.js
│ │ │ ├── ResponsiveText
│ │ │ │ └── index.js
│ │ │ ├── ScreenReaderOnly
│ │ │ │ └── index.js
│ │ │ ├── ScrollLock
│ │ │ │ └── index.js
│ │ │ ├── SegmentedControl
│ │ │ │ ├── colors.js
│ │ │ │ ├── index.js
│ │ │ │ └── styles.js
│ │ │ ├── Spinner
│ │ │ │ ├── colors.js
│ │ │ │ ├── index.js
│ │ │ │ ├── sizes.js
│ │ │ │ └── styles.js
│ │ │ └── index.js
│ │ ├── index.js
│ │ ├── parsers
│ │ │ ├── filters.js
│ │ │ ├── index.js
│ │ │ └── tests
│ │ │ │ └── index.test.js
│ │ ├── sagas
│ │ │ ├── index.js
│ │ │ ├── queryParamsSagas.js
│ │ │ └── test
│ │ │ │ ├── index.test.js
│ │ │ │ └── queryParamsSagas.test.js
│ │ ├── screens
│ │ │ ├── Home
│ │ │ │ ├── actions.js
│ │ │ │ ├── components
│ │ │ │ │ ├── ListTile.js
│ │ │ │ │ ├── Lists.js
│ │ │ │ │ ├── Section.js
│ │ │ │ │ └── test
│ │ │ │ │ │ ├── ListTile.test.js
│ │ │ │ │ │ ├── Lists.test.js
│ │ │ │ │ │ └── Section.test.js
│ │ │ │ ├── constants.js
│ │ │ │ ├── index.js
│ │ │ │ ├── reducer.js
│ │ │ │ ├── test
│ │ │ │ │ ├── Home.test.js
│ │ │ │ │ ├── actions.test.js
│ │ │ │ │ └── reducer.test.js
│ │ │ │ └── utils
│ │ │ │ │ ├── getRelatedIconClass.js
│ │ │ │ │ └── test
│ │ │ │ │ └── getRelatedIconClass.test.js
│ │ │ ├── Item
│ │ │ │ ├── actions.js
│ │ │ │ ├── components
│ │ │ │ │ ├── AltText.js
│ │ │ │ │ ├── Drilldown.js
│ │ │ │ │ ├── DrilldownItem.js
│ │ │ │ │ ├── EditForm.js
│ │ │ │ │ ├── EditFormHeader.js
│ │ │ │ │ ├── EditFormHeaderSearch.js
│ │ │ │ │ ├── FooterBar.js
│ │ │ │ │ ├── FormHeading.js
│ │ │ │ │ ├── RelatedItemsList
│ │ │ │ │ │ ├── RelatedItemsList.js
│ │ │ │ │ │ ├── RelatedItemsListDragDrop.js
│ │ │ │ │ │ └── RelatedItemsListRow.js
│ │ │ │ │ ├── Toolbar
│ │ │ │ │ │ ├── ToolbarSection.js
│ │ │ │ │ │ ├── index.js
│ │ │ │ │ │ └── test
│ │ │ │ │ │ │ ├── Toolbar.test.js
│ │ │ │ │ │ │ └── ToolbarSection.test.js
│ │ │ │ │ └── test
│ │ │ │ │ │ ├── AltText.test.js
│ │ │ │ │ │ ├── EditFormHeader.test.js
│ │ │ │ │ │ └── FormHeading.test.js
│ │ │ │ ├── constants.js
│ │ │ │ ├── index.js
│ │ │ │ ├── reducer.js
│ │ │ │ └── test
│ │ │ │ │ ├── actions.test.js
│ │ │ │ │ └── reducer.test.js
│ │ │ └── List
│ │ │ │ ├── actions
│ │ │ │ ├── active.js
│ │ │ │ ├── dragdrop.js
│ │ │ │ ├── index.js
│ │ │ │ ├── items.js
│ │ │ │ └── test
│ │ │ │ │ ├── actions.test.js
│ │ │ │ │ ├── active.test.js
│ │ │ │ │ ├── dragdrop.test.js
│ │ │ │ │ └── items.test.js
│ │ │ │ ├── components
│ │ │ │ ├── Filtering
│ │ │ │ │ ├── Filter.js
│ │ │ │ │ ├── ListFilters.js
│ │ │ │ │ ├── ListFiltersAdd.js
│ │ │ │ │ ├── ListFiltersAddForm.js
│ │ │ │ │ └── getFilterLabel.js
│ │ │ │ ├── ItemsTable
│ │ │ │ │ ├── ItemsTable.js
│ │ │ │ │ ├── ItemsTableDragDrop.js
│ │ │ │ │ ├── ItemsTableDragDropZone.js
│ │ │ │ │ ├── ItemsTableDragDropZoneTarget.js
│ │ │ │ │ └── ItemsTableRow.js
│ │ │ │ ├── ListColumnsForm.js
│ │ │ │ ├── ListControl.js
│ │ │ │ ├── ListDownloadForm.js
│ │ │ │ ├── ListHeaderButton.js
│ │ │ │ ├── ListHeaderSearch.js
│ │ │ │ ├── ListHeaderTitle.js
│ │ │ │ ├── ListHeaderToolbar.js
│ │ │ │ ├── ListManagement.js
│ │ │ │ ├── ListSort.js
│ │ │ │ └── UpdateForm.js
│ │ │ │ ├── constants.js
│ │ │ │ ├── index.js
│ │ │ │ └── reducers
│ │ │ │ ├── active.js
│ │ │ │ ├── main.js
│ │ │ │ └── test
│ │ │ │ └── active.test.js
│ │ ├── shared
│ │ │ ├── AlertMessages.js
│ │ │ ├── ConfirmationDialog.js
│ │ │ ├── CreateForm.js
│ │ │ ├── FlashMessage.js
│ │ │ ├── FlashMessages.js
│ │ │ ├── InvalidFieldType.js
│ │ │ ├── Kbd.js
│ │ │ ├── Popout
│ │ │ │ ├── PopoutBody.js
│ │ │ │ ├── PopoutFooter.js
│ │ │ │ ├── PopoutHeader.js
│ │ │ │ ├── PopoutList.js
│ │ │ │ ├── PopoutListHeading.js
│ │ │ │ ├── PopoutListItem.js
│ │ │ │ ├── PopoutPane.js
│ │ │ │ ├── index.js
│ │ │ │ └── test
│ │ │ │ │ ├── Popout.test.js
│ │ │ │ │ ├── PopoutBody.test.js
│ │ │ │ │ ├── PopoutFooter.test.js
│ │ │ │ │ ├── PopoutHeader.test.js
│ │ │ │ │ ├── PopoutList.test.js
│ │ │ │ │ ├── PopoutListHeading.test.js
│ │ │ │ │ ├── PopoutListItem.test.js
│ │ │ │ │ └── PopoutPane.test.js
│ │ │ ├── Portal.js
│ │ │ └── test
│ │ │ │ ├── AlertMessages.test.js
│ │ │ │ ├── ConfirmationDialog.test.js
│ │ │ │ ├── CreateForm.test.js
│ │ │ │ ├── FlashMessage.test.js
│ │ │ │ ├── FlashMessages.test.js
│ │ │ │ ├── InvalidFieldType.test.js
│ │ │ │ └── Portal.test.js
│ │ ├── store.js
│ │ └── test
│ │ │ └── App.test.js
│ ├── README.md
│ ├── Signin
│ │ ├── Signin.js
│ │ ├── components
│ │ │ ├── Alert.js
│ │ │ ├── Brand.js
│ │ │ ├── LoginForm.js
│ │ │ ├── UserInfo.js
│ │ │ └── test
│ │ │ │ ├── Alert.test.js
│ │ │ │ ├── Brand.test.js
│ │ │ │ ├── LoginForm.test.js
│ │ │ │ └── UserInfo.test.js
│ │ ├── index.js
│ │ └── test
│ │ │ └── Signin.test.js
│ ├── constants.js
│ ├── packages.js
│ ├── theme.js
│ └── utils
│ │ ├── List.js
│ │ ├── cloudinaryResize.js
│ │ ├── color.js
│ │ ├── concatClassnames.js
│ │ ├── css.js
│ │ ├── lists.js
│ │ ├── queryParams.js
│ │ ├── string.js
│ │ └── test
│ │ └── queryParams.test.js
├── public
│ ├── fonts
│ │ └── octicons
│ │ │ ├── octicons.eot
│ │ │ ├── octicons.svg
│ │ │ ├── octicons.ttf
│ │ │ └── octicons.woff
│ ├── images
│ │ ├── datepicker-next.svg
│ │ ├── datepicker-prev.svg
│ │ ├── datepicker-select-handler.svg
│ │ ├── icons
│ │ │ ├── 16
│ │ │ │ ├── alert.png
│ │ │ │ ├── checkbox-checked.png
│ │ │ │ ├── checkbox-unchecked.png
│ │ │ │ ├── cross.png
│ │ │ │ ├── edit-bold.png
│ │ │ │ ├── edit-code.png
│ │ │ │ ├── edit-image.png
│ │ │ │ ├── edit-indent.png
│ │ │ │ ├── edit-italic.png
│ │ │ │ ├── edit-link.png
│ │ │ │ ├── edit-list-order.png
│ │ │ │ ├── edit-list.png
│ │ │ │ ├── edit-outdent.png
│ │ │ │ ├── edit-size.png
│ │ │ │ ├── exclamation.png
│ │ │ │ ├── field-boolean.png
│ │ │ │ ├── field-code.png
│ │ │ │ ├── field-colour.png
│ │ │ │ ├── field-date.png
│ │ │ │ ├── field-dateTime.png
│ │ │ │ ├── field-email.png
│ │ │ │ ├── field-facebook.png
│ │ │ │ ├── field-file.png
│ │ │ │ ├── field-geoArea.png
│ │ │ │ ├── field-html.png
│ │ │ │ ├── field-image.png
│ │ │ │ ├── field-key.png
│ │ │ │ ├── field-location.png
│ │ │ │ ├── field-minutes.png
│ │ │ │ ├── field-money.png
│ │ │ │ ├── field-mp3.png
│ │ │ │ ├── field-name.png
│ │ │ │ ├── field-number.png
│ │ │ │ ├── field-numericSelect.png
│ │ │ │ ├── field-password.png
│ │ │ │ ├── field-phone.png
│ │ │ │ ├── field-select.png
│ │ │ │ ├── field-sort.png
│ │ │ │ ├── field-text.png
│ │ │ │ ├── field-textarea.png
│ │ │ │ ├── field-textile.png
│ │ │ │ ├── field-url.png
│ │ │ │ └── tick-circle.png
│ │ │ └── 32
│ │ │ │ ├── _blank.png
│ │ │ │ ├── _page.png
│ │ │ │ ├── aac.png
│ │ │ │ ├── ai.png
│ │ │ │ ├── aiff.png
│ │ │ │ ├── avi.png
│ │ │ │ ├── bmp.png
│ │ │ │ ├── c.png
│ │ │ │ ├── cpp.png
│ │ │ │ ├── css.png
│ │ │ │ ├── dat.png
│ │ │ │ ├── dmg.png
│ │ │ │ ├── doc.png
│ │ │ │ ├── dotx.png
│ │ │ │ ├── dwg.png
│ │ │ │ ├── dxf.png
│ │ │ │ ├── eps.png
│ │ │ │ ├── exe.png
│ │ │ │ ├── flv.png
│ │ │ │ ├── gif.png
│ │ │ │ ├── h.png
│ │ │ │ ├── hpp.png
│ │ │ │ ├── html.png
│ │ │ │ ├── ics.png
│ │ │ │ ├── iso.png
│ │ │ │ ├── java.png
│ │ │ │ ├── jpg.png
│ │ │ │ ├── js.png
│ │ │ │ ├── key.png
│ │ │ │ ├── less.png
│ │ │ │ ├── mid.png
│ │ │ │ ├── mp3.png
│ │ │ │ ├── mp4.png
│ │ │ │ ├── mpg.png
│ │ │ │ ├── odf.png
│ │ │ │ ├── ods.png
│ │ │ │ ├── odt.png
│ │ │ │ ├── otp.png
│ │ │ │ ├── ots.png
│ │ │ │ ├── ott.png
│ │ │ │ ├── pdf.png
│ │ │ │ ├── php.png
│ │ │ │ ├── png.png
│ │ │ │ ├── ppt.png
│ │ │ │ ├── psd.png
│ │ │ │ ├── py.png
│ │ │ │ ├── qt.png
│ │ │ │ ├── rar.png
│ │ │ │ ├── rb.png
│ │ │ │ ├── rtf.png
│ │ │ │ ├── sass.png
│ │ │ │ ├── scss.png
│ │ │ │ ├── sql.png
│ │ │ │ ├── tga.png
│ │ │ │ ├── tgz.png
│ │ │ │ ├── tiff.png
│ │ │ │ ├── txt.png
│ │ │ │ ├── wav.png
│ │ │ │ ├── xls.png
│ │ │ │ ├── xlsx.png
│ │ │ │ ├── xml.png
│ │ │ │ ├── yml.png
│ │ │ │ └── zip.png
│ │ └── logo.png
│ ├── js
│ │ ├── content
│ │ │ └── editor.js
│ │ ├── lib
│ │ │ ├── cloudinary
│ │ │ │ └── jquery.cloudinary.js
│ │ │ ├── codemirror
│ │ │ │ ├── codemirror-compressed.js
│ │ │ │ └── codemirror.css
│ │ │ ├── jquery
│ │ │ │ ├── jquery-1.10.2.js
│ │ │ │ ├── jquery-1.10.2.min.js
│ │ │ │ └── jquery-1.10.2.min.map
│ │ │ └── jqueryfileupload
│ │ │ │ ├── app.js
│ │ │ │ ├── cors
│ │ │ │ ├── jquery.postmessage-transport.js
│ │ │ │ └── jquery.xdr-transport.js
│ │ │ │ ├── jquery.fileupload-angular.js
│ │ │ │ ├── jquery.fileupload-audio.js
│ │ │ │ ├── jquery.fileupload-image.js
│ │ │ │ ├── jquery.fileupload-jquery-ui.js
│ │ │ │ ├── jquery.fileupload-process.js
│ │ │ │ ├── jquery.fileupload-ui.js
│ │ │ │ ├── jquery.fileupload-validate.js
│ │ │ │ ├── jquery.fileupload-video.js
│ │ │ │ ├── jquery.fileupload.js
│ │ │ │ ├── jquery.iframe-transport.js
│ │ │ │ ├── main.js
│ │ │ │ └── vendor
│ │ │ │ └── jquery.ui.widget.js
│ │ └── packages.js
│ └── styles
│ │ ├── auth.less
│ │ ├── content
│ │ ├── editor.less
│ │ └── editor.min.css
│ │ ├── error.css
│ │ ├── keystone.less
│ │ ├── keystone
│ │ ├── animation.less
│ │ ├── base.less
│ │ ├── dashboard.less
│ │ ├── field-localfile.less
│ │ ├── field-types.less
│ │ ├── forms.less
│ │ ├── item.less
│ │ ├── list-controls.less
│ │ ├── list-dropzone.less
│ │ ├── list-sort.less
│ │ ├── list.less
│ │ ├── navigation.less
│ │ ├── popout.less
│ │ ├── tables.less
│ │ ├── toolbar.less
│ │ ├── utils.less
│ │ └── wysiwyg.less
│ │ ├── react
│ │ └── react.less
│ │ └── variables.less
└── server
│ ├── api
│ ├── Readme.md
│ ├── cloudinary.js
│ ├── counts.js
│ ├── download.js
│ ├── item
│ │ ├── get.js
│ │ ├── sortOrder.js
│ │ └── update.js
│ ├── list
│ │ ├── create.js
│ │ ├── delete.js
│ │ ├── download.js
│ │ ├── get.js
│ │ └── update.js
│ ├── s3.js
│ └── session
│ │ ├── get.js
│ │ ├── signin.js
│ │ └── signout.js
│ ├── app
│ ├── createDynamicRouter.js
│ ├── createHealthchecksHandler.js
│ └── createStaticRouter.js
│ ├── index.js
│ ├── middleware
│ ├── apiError.js
│ ├── browserify.js
│ ├── initList.js
│ └── logError.js
│ ├── routes
│ ├── index.js
│ ├── signin.js
│ └── signout.js
│ └── templates
│ ├── index.html
│ └── signin.html
├── build.js
├── docs
├── Getting Started
│ ├── Setting-Up
│ │ ├── part-1.md
│ │ ├── part-2.md
│ │ ├── part-3.md
│ │ └── part-4.md
│ ├── index.md
│ └── yo-generator.md
├── api
│ ├── Field
│ │ ├── Underscore-Methods.md
│ │ ├── index.md
│ │ └── options.md
│ ├── List
│ │ ├── add.md
│ │ ├── index.md
│ │ ├── model.md
│ │ ├── options.md
│ │ ├── register.md
│ │ ├── schema.md
│ │ └── update-item.md
│ ├── Methods
│ │ ├── closeDatabaseConnection.md
│ │ ├── create-items.md
│ │ ├── create-router.md
│ │ ├── get.md
│ │ ├── import.md
│ │ ├── importer.md
│ │ ├── index.md
│ │ ├── init.md
│ │ ├── list.md
│ │ ├── middleware.md
│ │ ├── openDatabaseConnection.md
│ │ ├── paginate.md
│ │ ├── pre.md
│ │ ├── set.md
│ │ ├── start.md
│ │ └── update-handler.md
│ ├── View
│ │ ├── index.md
│ │ ├── on.md
│ │ ├── query.md
│ │ └── render.md
│ └── index.md
├── documentation
│ ├── Configuration
│ │ ├── AdminUI-Options.md
│ │ ├── Database-Options.md
│ │ ├── Project-Options.md
│ │ ├── Server-Options.md
│ │ └── index.md
│ ├── Database
│ │ ├── application-updates.md
│ │ ├── index.md
│ │ └── relationships.md
│ └── index.md
└── guides
│ ├── API-File-Image-Uploads.md
│ ├── assets
│ ├── mailgun-dashboard.png
│ └── mailgun-go-to-auth-rep.png
│ ├── how-to-create-a-blog-with-keystone.md
│ ├── how-to-send-emails.md
│ ├── index.md
│ └── v0.3-to-v4.0-Upgrade-Guide.md
├── fields
├── README.md
├── components
│ ├── Checkbox.js
│ ├── CollapsedFieldLabel.js
│ ├── DateInput.js
│ ├── FileChangeMessage.js
│ ├── HiddenFileInput.js
│ ├── ImageThumbnail.js
│ ├── ItemsTableCell.js
│ ├── ItemsTableValue.js
│ ├── NestedFormField.js
│ ├── columns
│ │ ├── ArrayColumn.js
│ │ ├── CloudinaryImageSummary.js
│ │ ├── IdColumn.js
│ │ └── InvalidColumn.js
│ └── test
│ │ ├── ItemTableCell.test.js
│ │ └── ItemTableValue.test.js
├── explorer
│ ├── components
│ │ ├── Col.js
│ │ ├── FieldSpec.js
│ │ ├── FieldType.js
│ │ └── Row.js
│ ├── index.css
│ ├── index.html
│ ├── index.js
│ └── server.js
├── mixins
│ └── ArrayField.js
├── types
│ ├── Field.js
│ ├── Type.js
│ ├── azurefile
│ │ ├── AzureFileColumn.js
│ │ ├── AzureFileField.js
│ │ ├── AzureFileFilter.js
│ │ ├── AzureFileType.js
│ │ └── Readme.md
│ ├── boolean
│ │ ├── BooleanColumn.js
│ │ ├── BooleanField.js
│ │ ├── BooleanFilter.js
│ │ ├── BooleanType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── cloudinaryimage
│ │ ├── CloudinaryImageColumn.js
│ │ ├── CloudinaryImageField.js
│ │ ├── CloudinaryImageFilter.js
│ │ ├── CloudinaryImageType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ └── explorer.js
│ ├── cloudinaryimages
│ │ ├── CloudinaryImagesColumn.js
│ │ ├── CloudinaryImagesField.js
│ │ ├── CloudinaryImagesFilter.js
│ │ ├── CloudinaryImagesThumbnail.js
│ │ ├── CloudinaryImagesType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ └── explorer.js
│ ├── code
│ │ ├── CodeColumn.js
│ │ ├── CodeField.js
│ │ ├── CodeFilter.js
│ │ ├── CodeType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── color
│ │ ├── ColorColumn.js
│ │ ├── ColorField.js
│ │ ├── ColorFilter.js
│ │ ├── ColorType.js
│ │ ├── Readme.md
│ │ ├── colored-swatch.js
│ │ ├── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ │ └── transparent-swatch.js
│ ├── date
│ │ ├── DateColumn.js
│ │ ├── DateField.js
│ │ ├── DateFilter.js
│ │ ├── DateType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── datearray
│ │ ├── DateArrayColumn.js
│ │ ├── DateArrayField.js
│ │ ├── DateArrayFilter.js
│ │ ├── DateArrayType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── datetime
│ │ ├── DatetimeColumn.js
│ │ ├── DatetimeField.js
│ │ ├── DatetimeFilter.js
│ │ ├── DatetimeType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── email
│ │ ├── EmailColumn.js
│ │ ├── EmailField.js
│ │ ├── EmailFilter.js
│ │ ├── EmailType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── embedly
│ │ ├── EmbedlyColumn.js
│ │ ├── EmbedlyField.js
│ │ ├── EmbedlyFilter.js
│ │ ├── EmbedlyType.js
│ │ └── Readme.md
│ ├── file
│ │ ├── FileColumn.js
│ │ ├── FileField.js
│ │ ├── FileFilter.js
│ │ ├── FileType.js
│ │ └── Readme.md
│ ├── geopoint
│ │ ├── GeoPointColumn.js
│ │ ├── GeoPointField.js
│ │ ├── GeoPointFilter.js
│ │ ├── GeoPointType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── html
│ │ ├── HtmlColumn.js
│ │ ├── HtmlField.js
│ │ ├── HtmlFilter.js
│ │ ├── HtmlType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── key
│ │ ├── KeyColumn.js
│ │ ├── KeyField.js
│ │ ├── KeyFilter.js
│ │ ├── KeyType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── localfile
│ │ ├── LocalFileColumn.js
│ │ ├── LocalFileField.js
│ │ ├── LocalFileFilter.js
│ │ ├── LocalFileType.js
│ │ └── Readme.md
│ ├── localfiles
│ │ ├── LocalFilesColumn.js
│ │ ├── LocalFilesField.js
│ │ ├── LocalFilesFilter.js
│ │ ├── LocalFilesType.js
│ │ └── readme.md
│ ├── location
│ │ ├── LocationColumn.js
│ │ ├── LocationField.js
│ │ ├── LocationFilter.js
│ │ ├── LocationType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── markdown
│ │ ├── MarkdownColumn.js
│ │ ├── MarkdownField.js
│ │ ├── MarkdownFilter.js
│ │ ├── MarkdownType.js
│ │ ├── Readme.md
│ │ ├── less
│ │ │ └── bootstrap-markdown.less
│ │ ├── lib
│ │ │ └── bootstrap-markdown.js
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── money
│ │ ├── MoneyColumn.js
│ │ ├── MoneyField.js
│ │ ├── MoneyFilter.js
│ │ ├── MoneyType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── name
│ │ ├── NameColumn.js
│ │ ├── NameField.js
│ │ ├── NameFilter.js
│ │ ├── NameType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── number
│ │ ├── NumberColumn.js
│ │ ├── NumberField.js
│ │ ├── NumberFilter.js
│ │ ├── NumberType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── numberarray
│ │ ├── NumberArrayColumn.js
│ │ ├── NumberArrayField.js
│ │ ├── NumberArrayFilter.js
│ │ ├── NumberArrayType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── password
│ │ ├── PasswordColumn.js
│ │ ├── PasswordField.js
│ │ ├── PasswordFilter.js
│ │ ├── PasswordType.js
│ │ ├── Readme.md
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── relationship
│ │ ├── Readme.md
│ │ ├── RelationshipColumn.js
│ │ ├── RelationshipField.js
│ │ ├── RelationshipFilter.js
│ │ ├── RelationshipType.js
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── s3file
│ │ ├── Readme.md
│ │ ├── S3FileColumn.js
│ │ ├── S3FileField.js
│ │ ├── S3FileFilter.js
│ │ └── S3FileType.js
│ ├── select
│ │ ├── Readme.md
│ │ ├── SelectColumn.js
│ │ ├── SelectField.js
│ │ ├── SelectFilter.js
│ │ ├── SelectType.js
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── text
│ │ ├── Readme.md
│ │ ├── TextColumn.js
│ │ ├── TextField.js
│ │ ├── TextFilter.js
│ │ ├── TextType.js
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ ├── textarea
│ │ ├── Readme.md
│ │ ├── TextareaColumn.js
│ │ ├── TextareaField.js
│ │ ├── TextareaFilter.js
│ │ ├── TextareaType.js
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ └── type.js
│ ├── textarray
│ │ ├── Readme.md
│ │ ├── TextArrayColumn.js
│ │ ├── TextArrayField.js
│ │ ├── TextArrayFilter.js
│ │ ├── TextArrayType.js
│ │ └── test
│ │ │ ├── explorer.js
│ │ │ ├── filters.js
│ │ │ └── type.js
│ └── url
│ │ ├── Readme.md
│ │ ├── UrlColumn.js
│ │ ├── UrlField.js
│ │ ├── UrlFilter.js
│ │ ├── UrlType.js
│ │ └── test
│ │ ├── explorer.js
│ │ └── type.js
└── utils
│ ├── addPresenceToQuery.js
│ ├── bindFunctions.js
│ ├── definePrototypeGetters.js
│ ├── evalDependsOn.js
│ └── test
│ └── utils.test.js
├── greenkeeper-prs
├── checkout.sh
├── filterbranches.js
└── getbranches.sh
├── index.js
├── lib
├── content
│ ├── index.js
│ ├── page.js
│ ├── type.js
│ └── types
│ │ ├── html.js
│ │ ├── index.js
│ │ └── text.js
├── core
│ ├── closeDatabaseConnection.js
│ ├── createItems.js
│ ├── createKeystoneHash.js
│ ├── createRouter.js
│ ├── getOrphanedLists.js
│ ├── importer.js
│ ├── init.js
│ ├── initDatabaseConfig.js
│ ├── initExpressApp.js
│ ├── initExpressSession.js
│ ├── initNav.js
│ ├── list.js
│ ├── openDatabaseConnection.js
│ ├── options.js
│ ├── populateRelated.js
│ ├── redirect.js
│ ├── start.js
│ └── wrapHTMLError.js
├── email.js
├── fieldTypes.js
├── list.js
├── list
│ ├── add.js
│ ├── addFiltersToQuery.js
│ ├── addSearchToQuery.js
│ ├── apiForGet.js
│ ├── automap.js
│ ├── buildSearchTextIndex.js
│ ├── declaresTextIndex.js
│ ├── ensureTextIndex.js
│ ├── expandColumns.js
│ ├── expandPaths.js
│ ├── expandSort.js
│ ├── field.js
│ ├── getAdminURL.js
│ ├── getCSVData.js
│ ├── getData.js
│ ├── getDocumentName.js
│ ├── getOptions.js
│ ├── getPages.js
│ ├── getSearchFilters.js
│ ├── getUniqueValue.js
│ ├── isReserved.js
│ ├── map.js
│ ├── paginate.js
│ ├── processFilters.js
│ ├── register.js
│ ├── relationship.js
│ ├── selectColumns.js
│ ├── set.js
│ ├── underscoreMethod.js
│ └── updateItem.js
├── middleware
│ ├── api.js
│ ├── cors.js
│ └── language.js
├── path.js
├── safeRequire.js
├── schemaPlugins.js
├── schemaPlugins
│ ├── autokey.js
│ ├── history.js
│ ├── methods
│ │ ├── getRelated.js
│ │ └── populateRelated.js
│ ├── options
│ │ └── transform.js
│ ├── sortable.js
│ └── track.js
├── security
│ ├── csrf.js
│ ├── escapeValueForExcel.js
│ ├── frameGuard.js
│ └── ipRangeRestrict.js
├── session.js
├── storage
│ ├── README.md
│ ├── adapters
│ │ └── fs
│ │ │ ├── README.md
│ │ │ └── index.js
│ └── index.js
├── updateHandler.js
├── updates.js
├── uploads.js
└── view.js
├── netlify.toml
├── package-lock.json
├── package.json
├── server
├── bindBodyParser.js
├── bindErrorHandlers.js
├── bindIPRestrictions.js
├── bindLessMiddleware.js
├── bindRedirectsHandler.js
├── bindSassMiddleware.js
├── bindSessionMiddleware.js
├── bindStaticMiddleware.js
├── bindStylusMiddleware.js
├── createApp.js
├── initLetsEncrypt.js
├── initSslRedirect.js
├── initTrustProxy.js
├── initViewEngine.js
├── initViewLocals.js
├── startHTTPServer.js
├── startSecureServer.js
└── startSocketServer.js
├── templates
└── helpers
│ └── emails
│ ├── layouts
│ ├── default.jade
│ └── styles
│ │ ├── default.jade
│ │ └── ink.jade
│ └── mixins
│ └── button.jade
├── test
├── e2e
│ ├── README.md
│ ├── adminUI
│ │ └── tests
│ │ │ ├── group001Login
│ │ │ ├── uiTestSigninView.js
│ │ │ ├── uxTestSigninRedirect.js
│ │ │ └── uxTestSigninView.js
│ │ │ ├── group002App
│ │ │ ├── uiTestAppView.js
│ │ │ └── uxTestAppView.js
│ │ │ ├── group003Home
│ │ │ ├── uiTestHomeView.js
│ │ │ └── uxTestHomeView.js
│ │ │ ├── group004List
│ │ │ ├── uiTestListView.js
│ │ │ └── uxTestListView.js
│ │ │ ├── group005Item
│ │ │ ├── uiTestItemView.js
│ │ │ └── uxTestItemView.js
│ │ │ ├── group006Fields
│ │ │ ├── commonFieldTestUtils.js
│ │ │ ├── testBooleanField.js
│ │ │ ├── testCloudinaryImageField.js
│ │ │ ├── testCloudinaryImageMultipleField.js
│ │ │ ├── testCodeField.js
│ │ │ ├── testColorField.js
│ │ │ ├── testDateArrayField.js
│ │ │ ├── testDateField.js
│ │ │ ├── testDatetimeField.js
│ │ │ ├── testEmailField.js
│ │ │ ├── testFileField.js
│ │ │ ├── testGeoPointField.js
│ │ │ ├── testHtmlField.js
│ │ │ ├── testKeyField.js
│ │ │ ├── testLocationField.js
│ │ │ ├── testMarkdownField.js
│ │ │ ├── testMoneyField.js
│ │ │ ├── testNameField.js
│ │ │ ├── testNumberArrayField.js
│ │ │ ├── testNumberField.js
│ │ │ ├── testPasswordField.js
│ │ │ ├── testRelationshipField.js
│ │ │ ├── testSelectField.js
│ │ │ ├── testTextArrayField.js
│ │ │ ├── testTextField.js
│ │ │ ├── testTextareaField.js
│ │ │ └── testUrlField.js
│ │ │ └── group999FixMe
│ │ │ ├── 2382.js
│ │ │ ├── 2898.js
│ │ │ ├── 2940.js
│ │ │ ├── 2941.js
│ │ │ ├── 2945.js
│ │ │ ├── 3028.js
│ │ │ ├── 3126.js
│ │ │ └── testDependsOnField_issue3068.js
│ ├── adminuiCustom
│ │ ├── favicon.ico
│ │ ├── styles.less
│ │ └── variables.less
│ ├── drivers
│ │ └── chrome
│ │ │ ├── linux32
│ │ │ └── .empty
│ │ │ ├── linux64
│ │ │ └── .empty
│ │ │ ├── mac32
│ │ │ └── .empty
│ │ │ └── win32
│ │ │ └── .empty
│ ├── frontend
│ │ ├── index.html
│ │ └── main.css
│ ├── modelTestConfig
│ │ ├── BooleanModelTestConfig.js
│ │ ├── CloudinaryImageModelTestConfig.js
│ │ ├── CloudinaryImageMultipleModelTestConfig.js
│ │ ├── CodeModelTestConfig.js
│ │ ├── ColorModelTestConfig.js
│ │ ├── DateArrayModelTestConfig.js
│ │ ├── DateModelTestConfig.js
│ │ ├── DatetimeModelTestConfig.js
│ │ ├── EmailModelTestConfig.js
│ │ ├── FileModelTestConfig.js
│ │ ├── GeoPointModelTestConfig.js
│ │ ├── HtmlModelTestConfig.js
│ │ ├── KeyModelTestConfig.js
│ │ ├── LocationModelTestConfig.js
│ │ ├── MarkdownModelTestConfig.js
│ │ ├── MoneyModelTestConfig.js
│ │ ├── NameModelTestConfig.js
│ │ ├── NumberArrayModelTestConfig.js
│ │ ├── NumberModelTestConfig.js
│ │ ├── PasswordModelTestConfig.js
│ │ ├── README.md
│ │ ├── RelationshipModelTestConfig.js
│ │ ├── SelectModelTestConfig.js
│ │ ├── TextArrayModelTestConfig.js
│ │ ├── TextModelTestConfig.js
│ │ ├── TextareaModelTestConfig.js
│ │ ├── UrlModelTestConfig.js
│ │ └── UserModelTestConfig.js
│ ├── models
│ │ ├── Member.js
│ │ ├── OtherList.js
│ │ ├── SelectFieldOnInitial.js
│ │ ├── User.js
│ │ ├── fields
│ │ │ ├── Boolean.js
│ │ │ ├── CloudinaryImage.js
│ │ │ ├── CloudinaryImageMultiple.js
│ │ │ ├── Code.js
│ │ │ ├── Color.js
│ │ │ ├── Date.js
│ │ │ ├── DateArray.js
│ │ │ ├── Datetime.js
│ │ │ ├── Email.js
│ │ │ ├── File.js
│ │ │ ├── GeoPoint.js
│ │ │ ├── Html.js
│ │ │ ├── Key.js
│ │ │ ├── Location.js
│ │ │ ├── Markdown.js
│ │ │ ├── Money.js
│ │ │ ├── Name.js
│ │ │ ├── Number.js
│ │ │ ├── NumberArray.js
│ │ │ ├── Password.js
│ │ │ ├── Relationship.js
│ │ │ ├── Select.js
│ │ │ ├── Text.js
│ │ │ ├── TextArray.js
│ │ │ ├── Textarea.js
│ │ │ └── Url.js
│ │ └── misc
│ │ │ ├── DateFieldMap.js
│ │ │ ├── DependsOn.js
│ │ │ ├── HiddenRelationship.js
│ │ │ ├── InlineRelationship.js
│ │ │ ├── InvalidDefaultColumn.js
│ │ │ ├── ManyRelationship.js
│ │ │ ├── NoDefaultColumn.js
│ │ │ ├── ReservedListKeyword.js
│ │ │ ├── SourceRelationship.js
│ │ │ └── TargetRelationship.js
│ ├── routes
│ │ └── index.js
│ ├── server.js
│ ├── updates
│ │ ├── 0.0.1-updates-e2e.js
│ │ └── 0.0.2-updates-e2e.js
│ └── utils.js
├── helpers
│ ├── certs
│ │ ├── server.ca.key
│ │ ├── server.crt
│ │ └── server.csr
│ ├── getExpressApp.js
│ ├── getKeystoneApp.js
│ ├── getMongooseConnection.js
│ └── removeModel.js
├── mocha-admin.opts
├── mocha.opts
├── models
│ ├── DependsOn.js
│ └── Post.js
├── pretest.js
└── unit
│ ├── README.md
│ ├── field-filters.js
│ ├── field-types.js
│ ├── field-utils.js
│ ├── lib
│ ├── email.js
│ ├── list
│ │ ├── autokey.js
│ │ ├── dependsOn.js
│ │ └── pagination.js
│ ├── middleware
│ │ └── language.js
│ ├── path.js
│ ├── safeRequire.js
│ ├── security.js
│ ├── security
│ │ └── frame-guard.js
│ ├── session.js
│ └── view.js
│ ├── module-root.js
│ ├── req-user.js
│ ├── server
│ └── initViewEngine.js
│ └── track.js
└── website
├── .babelrc
├── .eslintrc.js
├── components
├── Container.js
├── GithubButton.js
├── Grid
│ ├── index.js
│ └── widths.js
├── Header.js
├── Navbar
│ ├── Brand.js
│ ├── Item.js
│ ├── Menu.js
│ ├── index.js
│ └── utils
│ │ ├── index.js
│ │ └── makeSection.js
├── Navigation.js
├── TwitterButton.js
├── Version5.js
└── index.js
├── css
├── prism-coy.css
└── styles.css
├── data
└── navigation.js
├── gatsby-config.js
├── gatsby-node.js
├── images
├── brand-continental.png
├── brand-event_cinemas.png
├── brand-macmillan.png
├── brand-sony.png
├── brand-vodafone.png
├── brand-westpac.png
├── keystone_admin.png
└── logo-inverted.svg
├── package.json
├── src
├── html.js
├── layouts
│ ├── components
│ │ └── Navbar.js
│ └── default.js
└── pages
│ ├── 404.js
│ ├── components
│ └── home
│ │ ├── AdminInterface.js
│ │ ├── CommunityResponse.js
│ │ ├── Footer.js
│ │ ├── Hero.js
│ │ ├── ValueProps.js
│ │ ├── ValueProps2.js
│ │ └── WhereNext.js
│ └── index.js
├── static
├── _redirects
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon.ico
├── robots.txt
└── sitemap.xml
├── templates
├── template-doc-layout.js
└── template-doc-page.js
├── theme.js
└── utils
└── typography.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@babel/plugin-transform-object-assign"
4 | ],
5 | "presets": [
6 | "@babel/preset-react",
7 | "@babel/preset-env"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/.codeclimate.yml:
--------------------------------------------------------------------------------
1 | ---
2 | engines:
3 | duplication:
4 | enabled: true
5 | config:
6 | languages:
7 | - javascript
8 | eslint:
9 | enabled: true
10 | config:
11 | config: .eslintrc
12 | fixme:
13 | enabled: true
14 | ratings:
15 | paths:
16 | - "**.js"
17 | exclude_paths:
18 | - node_modules/
19 | - test/
20 | - "**/test/"
21 | - admin/public/js/
22 | - admin/public/fonts/
23 | - fields/types/markdown/lib/
24 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for unifying the coding style for different editors and IDEs
2 | # editorconfig.org
3 | root = true
4 |
5 | [*]
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 | indent_style = tab
11 |
12 | [*.js]
13 | indent_size = 2
14 |
15 | [*.json]
16 | indent_style = space
17 | indent_size = 2
18 |
19 | [*.yml]
20 | indent_style = space
21 | indent_size = 2
22 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | admin/bundles/*
2 | admin/public/js/lib/*
3 | admin/public/js/packages.js
4 | bundles/*
5 | coverage/*
6 | docs/*
7 | fields/types/**/lib/*
8 | node_modules/*
9 | test/*
10 | website/*
11 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "keystone-react"
4 | ],
5 | "rules": {
6 | "react/jsx-no-bind": 0
7 | },
8 | "globals": {
9 | "_": true,
10 | "$": true,
11 | "after": true,
12 | "afterEach": true,
13 | "before": true,
14 | "beforeEach": true,
15 | "describe": true,
16 | "it": true,
17 | "jQuery": true,
18 | "Keystone": true
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.dat
2 | *.DS_Store
3 | *.gz
4 | *.log
5 | *.out
6 | *.pid
7 | *.seed
8 | *.swp
9 | *.un~
10 | *.iml
11 | *.ipr
12 | *.iws
13 | .idea/
14 | *.sublime-*
15 |
16 | logs
17 | node_modules/
18 | npm-debug.log
19 | pids
20 | results
21 | coverage
22 | coverage.html
23 | .cover*
24 | lib-cov
25 |
26 | bundles
27 | docs/_dist
28 | admin/public/styles/auth.css
29 | admin/public/styles/auth.min.css
30 | admin/public/styles/keystone.css
31 | admin/public/styles/keystone.min.css
32 | reports
33 |
34 | test/e2e/drivers/*
35 |
36 | package-lock.json
37 | yarn.lock
38 |
39 | # Website dependencies
40 | website/.cache
41 | website/public
42 |
43 | .vscode
44 |
45 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | docs
2 | examples
3 | /test/
4 |
--------------------------------------------------------------------------------
/admin/client/App/components/Navigation/Mobile/ListItem.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A list item of the mobile navigation
3 | */
4 |
5 | import React from 'react';
6 | import { Link } from 'react-router';
7 |
8 | const MobileListItem = React.createClass({
9 | displayName: 'MobileListItem',
10 | propTypes: {
11 | children: React.PropTypes.node.isRequired,
12 | className: React.PropTypes.string,
13 | href: React.PropTypes.string.isRequired,
14 | onClick: React.PropTypes.func,
15 | },
16 | render () {
17 | return (
18 |
24 | {this.props.children}
25 |
26 | );
27 | },
28 | });
29 |
30 | module.exports = MobileListItem;
31 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Alert/colors.js:
--------------------------------------------------------------------------------
1 | import theme from '../../../theme';
2 |
3 | module.exports = {
4 | danger: theme.alert.color.danger,
5 | error: theme.alert.color.danger,
6 | info: theme.alert.color.info,
7 | success: theme.alert.color.success,
8 | warning: theme.alert.color.warning,
9 | };
10 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Center/index.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 | import { css } from 'glamor';
3 | import classes from './styles';
4 |
5 | function Center ({
6 | className,
7 | component: Component,
8 | height,
9 | style,
10 | ...props
11 | }) {
12 | props.className = css(classes.center, className);
13 | props.style = { height, ...style };
14 |
15 | return ;
16 | };
17 | Center.propTypes = {
18 | component: PropTypes.oneOfType([
19 | PropTypes.func,
20 | PropTypes.string,
21 | ]),
22 | height: PropTypes.oneOfType([
23 | PropTypes.number,
24 | PropTypes.string,
25 | ]),
26 | };
27 | Center.defaultProps = {
28 | component: 'div',
29 | height: 'auto',
30 | };
31 |
32 | module.exports = Center;
33 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Center/styles.js:
--------------------------------------------------------------------------------
1 | // ==============================
2 | // Center
3 | // ==============================
4 |
5 | module.exports = {
6 | center: {
7 | display: 'flex',
8 | alignItems: 'center',
9 | justifyContent: 'center',
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Container/sizes.js:
--------------------------------------------------------------------------------
1 | import theme from '../../../theme';
2 |
3 | module.exports = {
4 | small: theme.container.size.small,
5 | medium: theme.container.size.medium,
6 | large: theme.container.size.large,
7 | };
8 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Form/styles.js:
--------------------------------------------------------------------------------
1 | // ==============================
2 | // Form
3 | // ==============================
4 |
5 | module.exports = {
6 | Form: {},
7 | };
8 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/FormNote/styles.js:
--------------------------------------------------------------------------------
1 | // ==============================
2 | // Form Note
3 | // ==============================
4 |
5 | import theme from '../../../theme';
6 |
7 | module.exports = {
8 | note: {
9 | color: theme.form.note.color,
10 | fontSize: theme.form.note.fontSize,
11 | marginTop: theme.spacing.small,
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Glyph/colors.js:
--------------------------------------------------------------------------------
1 | import theme from '../../../theme';
2 |
3 | module.exports = {
4 | danger: theme.glyph.color.danger,
5 | inherit: theme.glyph.color.inherit,
6 | inverted: theme.glyph.color.inverted,
7 | primary: theme.glyph.color.primary,
8 | success: theme.glyph.color.success,
9 | warning: theme.glyph.color.warning,
10 | };
11 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Glyph/sizes.js:
--------------------------------------------------------------------------------
1 | import theme from '../../../theme';
2 |
3 | module.exports = {
4 | small: theme.glyph.size.small,
5 | medium: theme.glyph.size.medium,
6 | large: theme.glyph.size.large,
7 | };
8 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Glyph/styles.js:
--------------------------------------------------------------------------------
1 | // ==============================
2 | // Glyph
3 | // ==============================
4 |
5 | import colors from './colors';
6 | import sizes from './sizes';
7 |
8 | // Prepare variants
9 | const colorVariants = {};
10 | Object.keys(colors).forEach(color => {
11 | colorVariants[`color__${color}`] = {
12 | color: colors[color],
13 | };
14 | });
15 |
16 | // Prepare sizes
17 | const sizeVariants = {};
18 | Object.keys(sizes).forEach(size => {
19 | sizeVariants[`size__${size}`] = {
20 | fontSize: sizes[size],
21 | };
22 | });
23 |
24 | module.exports = {
25 | glyph: {},
26 |
27 | // Colors
28 | ...colorVariants,
29 |
30 | // Sizes
31 | ...sizeVariants,
32 | };
33 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Grid/index.js:
--------------------------------------------------------------------------------
1 | import Col from '../GridCol';
2 | import Row from '../GridRow';
3 |
4 | export { Col, Row };
5 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/LabelledControl/index.js:
--------------------------------------------------------------------------------
1 | import { css } from 'glamor';
2 | import React, { PropTypes } from 'react';
3 | import classes from './styles';
4 |
5 | function LabelledControl ({
6 | className,
7 | inline,
8 | label,
9 | title,
10 | ...props
11 | }) {
12 | const labelClassName = css(
13 | classes.wrapper,
14 | inline && classes.wrapper__inline,
15 | className
16 | );
17 |
18 | return (
19 |
23 | );
24 | };
25 |
26 | LabelledControl.propTypes = {
27 | inline: PropTypes.bool,
28 | title: PropTypes.string,
29 | type: PropTypes.oneOf(['checkbox', 'radio']).isRequired,
30 | };
31 |
32 | module.exports = LabelledControl;
33 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/LabelledControl/styles.js:
--------------------------------------------------------------------------------
1 | // ==============================
2 | // Alert
3 | // ==============================
4 |
5 | /* eslint quote-props: ["error", "as-needed"] */
6 |
7 | import theme from '../../../theme';
8 |
9 | module.exports = {
10 | wrapper: {
11 | display: 'block',
12 | height: theme.input.height,
13 | lineHeight: theme.input.lineHeight,
14 | },
15 | wrapper__inline: {
16 | display: 'inline',
17 | },
18 |
19 | // checkbox or radio
20 | control: {
21 | marginRight: '0.5em',
22 | },
23 | };
24 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Modal/body.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { css } from 'glamor';
3 | import theme from '../../../theme';
4 |
5 | function ModalBody ({
6 | className,
7 | ...props
8 | }) {
9 | return (
10 |
14 | );
15 | };
16 |
17 | const classes = {
18 | body: {
19 | paddingBottom: theme.modal.padding.body.vertical,
20 | paddingLeft: theme.modal.padding.body.horizontal,
21 | paddingRight: theme.modal.padding.body.horizontal,
22 | paddingTop: theme.modal.padding.body.vertical,
23 | },
24 | };
25 |
26 | module.exports = ModalBody;
27 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Modal/index.js:
--------------------------------------------------------------------------------
1 | import Body from './body';
2 | import Dialog from './dialog';
3 | import Footer from './footer';
4 | import Header from './header';
5 |
6 | export {
7 | Body,
8 | Dialog,
9 | Footer,
10 | Header,
11 | };
12 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/PassContext/index.js:
--------------------------------------------------------------------------------
1 | import { Children, Component, PropTypes } from 'react';
2 |
3 | // Pass the Lightbox context through to the Portal's descendents
4 | // StackOverflow discussion http://goo.gl/oclrJ9
5 |
6 | class PassContext extends Component {
7 | getChildContext () {
8 | return this.props.context;
9 | }
10 | render () {
11 | return Children.only(this.props.children);
12 | }
13 | };
14 |
15 | PassContext.propTypes = {
16 | context: PropTypes.object.isRequired,
17 | };
18 | PassContext.childContextTypes = {
19 | onClose: PropTypes.func,
20 | };
21 |
22 | export default PassContext;
23 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/ScreenReaderOnly/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { css } from 'glamor';
3 |
4 | function ScreenReaderOnly ({ className, ...props }) {
5 | props.className = css(classes.srOnly, className);
6 |
7 | return ;
8 | };
9 |
10 | const classes = {
11 | srOnly: {
12 | border: 0,
13 | clip: 'rect(0,0,0,0)',
14 | height: 1,
15 | margin: -1,
16 | overflow: 'hidden',
17 | padding: 0,
18 | position: 'absolute',
19 | width: 1,
20 | },
21 | };
22 |
23 | module.exports = ScreenReaderOnly;
24 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/SegmentedControl/colors.js:
--------------------------------------------------------------------------------
1 | import theme from '../../../theme';
2 |
3 | module.exports = {
4 | danger: theme.color.danger,
5 | default: theme.color.gray80,
6 | error: theme.color.danger,
7 | info: theme.color.info,
8 | primary: theme.color.primary,
9 | success: theme.color.success,
10 | warning: theme.color.warning,
11 | };
12 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Spinner/colors.js:
--------------------------------------------------------------------------------
1 | module.exports = ['danger', 'default', 'inverted', 'primary', 'success', 'warning'];
2 |
--------------------------------------------------------------------------------
/admin/client/App/elemental/Spinner/sizes.js:
--------------------------------------------------------------------------------
1 | module.exports = ['small', 'medium', 'large'];
2 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Home/constants.js:
--------------------------------------------------------------------------------
1 | export const LOAD_COUNTS = 'app/Home/LOAD_COUNTS';
2 | export const COUNTS_LOADING_SUCCESS = 'app/Home/COUNTS_LOADING_SUCCESS';
3 | export const COUNTS_LOADING_ERROR = 'app/Home/COUNTS_LOADING_ERROR';
4 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Home/reducer.js:
--------------------------------------------------------------------------------
1 | import assign from 'object-assign';
2 | import {
3 | LOAD_COUNTS,
4 | COUNTS_LOADING_SUCCESS,
5 | COUNTS_LOADING_ERROR,
6 | } from './constants';
7 |
8 | const initialState = {
9 | counts: {},
10 | loading: false,
11 | error: null,
12 | };
13 |
14 | function home (state = initialState, action) {
15 | switch (action.type) {
16 | case LOAD_COUNTS:
17 | return assign({}, state, {
18 | loading: true,
19 | });
20 | case COUNTS_LOADING_SUCCESS:
21 | return assign({}, state, {
22 | loading: false,
23 | counts: action.counts,
24 | error: null,
25 | });
26 | case COUNTS_LOADING_ERROR:
27 | return assign({}, state, {
28 | loading: false,
29 | error: action.error,
30 | });
31 | default:
32 | return state;
33 | }
34 | }
35 |
36 | export default home;
37 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Home/test/actions.test.js:
--------------------------------------------------------------------------------
1 | import demand from 'must';
2 | import {
3 | countsLoaded,
4 | } from '../actions';
5 | import {
6 | COUNTS_LOADING_SUCCESS,
7 | } from '../constants';
8 |
9 | describe(' actions', () => {
10 | describe('countsLoaded()', () => {
11 | it('should return a type of COUNTS_LOADING_SUCCESS', () => {
12 | demand(countsLoaded().type).eql(COUNTS_LOADING_SUCCESS);
13 | });
14 |
15 | it('should pass the counts on', () => {
16 | const counts = { 'some/path': 100 };
17 | demand(countsLoaded(counts).counts).eql(counts);
18 | });
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Home/utils/test/getRelatedIconClass.test.js:
--------------------------------------------------------------------------------
1 | import demand from 'must';
2 | import getRelatedIconClass from '../getRelatedIconClass';
3 |
4 | describe('getRelatedIconClass', () => {
5 | it('should return "octicon-primitive-dot" by default', () => {
6 | demand(getRelatedIconClass('')).eql('octicon octicon-primitive-dot');
7 | });
8 |
9 | it('should return a related icon class', () => {
10 | demand(getRelatedIconClass('times')).eql('octicon octicon-clock');
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/components/FormHeading.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import evalDependsOn from '../../../../../../fields/utils/evalDependsOn';
3 |
4 | module.exports = React.createClass({
5 | displayName: 'FormHeading',
6 | propTypes: {
7 | options: React.PropTypes.object,
8 | },
9 | render () {
10 | if (!evalDependsOn(this.props.options.dependsOn, this.props.options.values)) {
11 | return null;
12 | }
13 | return {this.props.content}
;
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/components/Toolbar/ToolbarSection.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 | import classNames from 'classnames';
3 |
4 | function ToolbarSection ({ className, left, right, ...props }) {
5 | props.className = classNames('Toolbar__section', {
6 | 'Toolbar__section--left': left,
7 | 'Toolbar__section--right': right,
8 | }, className);
9 |
10 | return ;
11 | };
12 |
13 | ToolbarSection.propTypes = {
14 | left: PropTypes.bool,
15 | right: PropTypes.bool,
16 | };
17 |
18 | module.exports = ToolbarSection;
19 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/components/Toolbar/index.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 |
3 | const Toolbar = (props) => ;
4 |
5 | Toolbar.displayName = 'Toolbar';
6 | Toolbar.propTypes = {
7 | children: PropTypes.node.isRequired,
8 | };
9 |
10 | module.exports = Toolbar;
11 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/components/Toolbar/test/Toolbar.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { shallow } from 'enzyme';
3 | import demand from 'must';
4 | import Toolbar from '../';
5 |
6 | describe('', () => {
7 | it('should render a div', () => {
8 | const component = shallow();
9 | demand(component.find('div').length).eql(1);
10 | });
11 |
12 | it('should have a class of Toolbar', () => {
13 | const component = shallow();
14 | demand(component.find('div').prop('className')).eql('Toolbar');
15 | });
16 |
17 | it('should render its children', () => {
18 | const children = (Hello World!
);
19 | const component = shallow(
20 | {children}
21 | );
22 |
23 | demand(component.contains(children)).true();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/components/test/AltText.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import demand from 'must';
3 | import AltText from '../AltText';
4 | import { shallow } from 'enzyme';
5 |
6 | describe('', () => {
7 | it('should render a span by default', () => {
8 | const component = shallow();
9 | demand(component.find('span').length).gt(0);
10 | });
11 |
12 | it('should render a different component if passed in', () => {
13 | const passed = 'div';
14 | const component = shallow();
15 | demand(component.find(passed).length).gt(0);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/components/test/FormHeading.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import demand from 'must';
3 | import FormHeading from '../FormHeading';
4 | import { shallow } from 'enzyme';
5 |
6 | // Does not test evalDependsOn since that's already tested
7 | describe('', () => {
8 | it('should render an h3', () => {
9 | const component = shallow(
10 |
11 | );
12 | demand(component.find('h3').length).eql(1);
13 | });
14 |
15 | it('should render its content', () => {
16 | const content = 'Hello World!';
17 | const component = shallow(
18 |
19 | );
20 | demand(component.contains(content)).true();
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/admin/client/App/screens/Item/constants.js:
--------------------------------------------------------------------------------
1 | export const SELECT_ITEM = 'app/Item/SELECT_ITEM';
2 | export const LOAD_DATA = 'app/Item/LOAD_DATA';
3 | export const DATA_LOADING_SUCCESS = 'app/Item/DATA_LOADING_SUCCESS';
4 | export const DATA_LOADING_ERROR = 'app/Item/DATA_LOADING_ERROR';
5 | export const DRAG_MOVE_ITEM = 'app/Item/DRAG_MOVE_ITEM';
6 | export const DRAG_RESET_ITEMS = 'app/Item/DRAG_RESET_ITEMS';
7 | export const LOAD_RELATIONSHIP_DATA = 'app/Item/LOAD_RELATIONSHIP_DATA';
8 | export const ASYNC_FIELD_LOADING = 'loading';
9 | export const ASYNC_FIELD_LOADED = 'loaded';
10 |
--------------------------------------------------------------------------------
/admin/client/App/screens/List/actions/test/actions.test.js:
--------------------------------------------------------------------------------
1 | import demand from 'must';
2 | import {
3 | setCurrentPage,
4 | } from '../';
5 | import {
6 | SET_CURRENT_PAGE,
7 | } from '../../constants';
8 |
9 | describe('
actions', () => {
10 | describe('setCurrentPage', () => {
11 | it('should have a type of SET_CURRENT_PAGE', () => {
12 | demand(setCurrentPage().type).eql(SET_CURRENT_PAGE);
13 | });
14 |
15 | it('should pass on the page index', () => {
16 | const index = 25;
17 | demand(setCurrentPage(index).index).eql(index);
18 | });
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/admin/client/App/screens/List/actions/test/items.test.js:
--------------------------------------------------------------------------------
1 | import demand from 'must';
2 | import {
3 | itemsLoaded,
4 | } from '../items';
5 | import {
6 | ITEMS_LOADED,
7 | } from '../../constants';
8 |
9 | describe(' items actions', () => {
10 | describe('itemsLoaded()', () => {
11 | it('should have a type of ITEMS_LOADED', () => {
12 | demand(itemsLoaded().type).eql(ITEMS_LOADED);
13 | });
14 |
15 | it('should pass on the items', () => {
16 | const items = [{ some: 'item' }];
17 | demand(itemsLoaded(items).items).eql(items);
18 | });
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/admin/client/App/shared/InvalidFieldType.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Renders an "Invalid Field Type" error
3 | */
4 |
5 | import React from 'react';
6 |
7 | const InvalidFieldType = function (props) {
8 | return (
9 |
10 | Invalid field type {props.type} at path {props.path}
11 |
12 | );
13 | };
14 |
15 | InvalidFieldType.propTypes = {
16 | path: React.PropTypes.string,
17 | type: React.PropTypes.string,
18 | };
19 |
20 | module.exports = InvalidFieldType;
21 |
--------------------------------------------------------------------------------
/admin/client/App/shared/Popout/PopoutBody.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Render the body of a popout
3 | */
4 |
5 | import React from 'react';
6 | import blacklist from 'blacklist';
7 | import classnames from 'classnames';
8 |
9 | var PopoutBody = React.createClass({
10 | displayName: 'PopoutBody',
11 | propTypes: {
12 | children: React.PropTypes.node.isRequired,
13 | className: React.PropTypes.string,
14 | scrollable: React.PropTypes.bool,
15 | },
16 | render () {
17 | const className = classnames('Popout__body', {
18 | 'Popout__scrollable-area': this.props.scrollable,
19 | }, this.props.className);
20 | const props = blacklist(this.props, 'className', 'scrollable');
21 |
22 | return (
23 |
24 | );
25 | },
26 | });
27 |
28 | module.exports = PopoutBody;
29 |
--------------------------------------------------------------------------------
/admin/client/App/shared/Popout/PopoutListHeading.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Render a popout list heading
3 | */
4 |
5 | import React from 'react';
6 | import blacklist from 'blacklist';
7 | import classnames from 'classnames';
8 |
9 | var PopoutListHeading = React.createClass({
10 | displayName: 'PopoutListHeading',
11 | propTypes: {
12 | children: React.PropTypes.node.isRequired,
13 | className: React.PropTypes.string,
14 | },
15 | render () {
16 | const className = classnames('PopoutList__heading', this.props.className);
17 | const props = blacklist(this.props, 'className');
18 |
19 | return (
20 |
21 | );
22 | },
23 | });
24 |
25 | module.exports = PopoutListHeading;
26 |
--------------------------------------------------------------------------------
/admin/client/App/shared/test/CreateForm.test.js:
--------------------------------------------------------------------------------
1 | // import React from 'react';
2 | // import { shallow } from 'enzyme';
3 | // import demand from 'must';
4 | // import CreateForm from '../CreateForm';
5 | // import { Modal, Form } from 'elemental';
6 | //
7 | // describe('', () => {
8 | // beforeEach(() => {
9 | // global.Keystone = {
10 | // csrf: {
11 | // key: 'something',
12 | // value: 'else',
13 | // },
14 | // };
15 | // });
16 | //
17 | // it('should render a Modal', () => {
18 | // const component = shallow();
19 | // demand(component.find(Modal).length).equal(1);
20 | // });
21 | //
22 | // it('should render a Form if it\'s open', () => {
23 | // const component = shallow();
24 | // demand(component.find(Form).length).equal(1);
25 | // });
26 | // });
27 |
--------------------------------------------------------------------------------
/admin/client/App/shared/test/InvalidFieldType.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { shallow } from 'enzyme';
3 | import demand from 'must';
4 | import InvalidFieldType from '../InvalidFieldType';
5 |
6 | describe('', () => {
7 | it('should render a message saying that a field type is invalid', () => {
8 | const type = 'txt';
9 | const path = 'some/path';
10 | const component = shallow();
11 |
12 | demand(component.text()).eql(`Invalid field type ${type} at path ${path}`);
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/admin/client/App/shared/test/Portal.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { shallow } from 'enzyme';
3 | import demand from 'must';
4 | import Portal from '../Portal';
5 |
6 | describe('', () => {
7 | it('should return null', () => {
8 | const component = shallow();
9 | demand(component.type()).eql(null);
10 | });
11 | });
12 |
--------------------------------------------------------------------------------
/admin/client/constants.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Constants
3 | */
4 |
5 | // breakpoints
6 | exports.breakpoint = {
7 | xs: 480,
8 | sm: 768,
9 | md: 992,
10 | lg: 1200,
11 | };
12 |
13 | // border radii
14 | exports.borderRadius = {
15 | xs: 2,
16 | sm: 4,
17 | md: 8,
18 | lg: 16,
19 | xl: 32,
20 | };
21 |
22 | // color
23 | exports.color = {
24 | appDanger: '#d64242',
25 | appInfo: '#56cdfc',
26 | appPrimary: '#1385e5',
27 | appSuccess: '#34c240',
28 | appWarning: '#fa9f47',
29 | };
30 |
31 | // spacing
32 | exports.spacing = {
33 | xs: 5,
34 | sm: 10,
35 | md: 20,
36 | lg: 40,
37 | xl: 80,
38 | };
39 |
40 | // table constants
41 |
42 | exports.TABLE_CONTROL_COLUMN_WIDTH = 26; // icon + padding
43 | exports.NETWORK_ERROR_RETRY_DELAY = 500; // in ms
44 |
--------------------------------------------------------------------------------
/admin/client/utils/cloudinaryResize.js:
--------------------------------------------------------------------------------
1 | import url from 'cloudinary-microurl';
2 | const CLOUD_NAME = window.Keystone.cloudinary.cloud_name;
3 |
4 | /*
5 | Take a cloudinary public id + options object
6 | and return a url
7 | */
8 | function cloudinaryResize (publicId, options = {}) {
9 | if (!publicId || !CLOUD_NAME) return false;
10 |
11 | return url(publicId, {
12 | cloud_name: CLOUD_NAME, // single cloud for the admin UI
13 | quality: 80, // 80% quality, which ~halves image download size
14 | ...options,
15 | });
16 | };
17 |
18 | module.exports = cloudinaryResize;
19 |
--------------------------------------------------------------------------------
/admin/client/utils/concatClassnames.js:
--------------------------------------------------------------------------------
1 | // ======================
2 | // Concatenate Classnames
3 | // ======================
4 | //
5 | // Support className as an array:
6 | // force classname prop into an array (possibly of arrays) then flatten
7 |
8 | /*
9 | // To use spread the new array into glamor's `css` function
10 |
11 | function Component ({ className, ...props }) {
12 | props.className = css(
13 | classes.component,
14 | ...concatClassnames(className)
15 | );
16 |
17 | return ;
18 | };
19 | */
20 |
21 | module.exports = function concatClassnames (className) {
22 | return [className].reduce((a, b) => {
23 | return a.concat(b);
24 | }, []);
25 | };
26 |
--------------------------------------------------------------------------------
/admin/client/utils/lists.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Exports an object of lists, keyed with their key instead of their name and
3 | * wrapped with the List helper (./List.js)
4 | */
5 |
6 | import List from './List';
7 |
8 | exports.listsByKey = {};
9 | exports.listsByPath = {};
10 |
11 | for (const key in Keystone.lists) {
12 | // Guard for-ins
13 | if ({}.hasOwnProperty.call(Keystone.lists, key)) {
14 | var list = new List(Keystone.lists[key]);
15 | exports.listsByKey[key] = list;
16 | exports.listsByPath[list.path] = list;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/admin/public/fonts/octicons/octicons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/fonts/octicons/octicons.eot
--------------------------------------------------------------------------------
/admin/public/fonts/octicons/octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/fonts/octicons/octicons.ttf
--------------------------------------------------------------------------------
/admin/public/fonts/octicons/octicons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/fonts/octicons/octicons.woff
--------------------------------------------------------------------------------
/admin/public/images/datepicker-select-handler.svg:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/admin/public/images/icons/16/alert.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/alert.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/checkbox-checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/checkbox-checked.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/checkbox-unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/checkbox-unchecked.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/cross.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/cross.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-bold.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-bold.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-code.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-image.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-indent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-indent.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-italic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-italic.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-link.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-list-order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-list-order.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-list.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-outdent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-outdent.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/edit-size.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/edit-size.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/exclamation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/exclamation.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-boolean.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-boolean.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-code.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-colour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-colour.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-date.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-date.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-dateTime.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-dateTime.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-email.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-facebook.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-file.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-geoArea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-geoArea.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-html.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-html.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-image.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-key.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-key.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-location.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-minutes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-minutes.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-money.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-money.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-mp3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-mp3.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-name.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-number.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-number.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-numericSelect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-numericSelect.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-password.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-phone.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-select.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-sort.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-text.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-textarea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-textarea.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-textile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-textile.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/field-url.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/field-url.png
--------------------------------------------------------------------------------
/admin/public/images/icons/16/tick-circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/16/tick-circle.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/_blank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/_blank.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/_page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/_page.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/aac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/aac.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/ai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/ai.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/aiff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/aiff.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/avi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/avi.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/bmp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/bmp.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/c.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/cpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/cpp.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/css.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/css.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/dat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/dat.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/dmg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/dmg.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/doc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/doc.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/dotx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/dotx.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/dwg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/dwg.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/dxf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/dxf.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/eps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/eps.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/exe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/exe.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/flv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/flv.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/gif.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/gif.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/h.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/hpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/hpp.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/html.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/html.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/ics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/ics.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/iso.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/iso.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/java.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/java.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/jpg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/jpg.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/js.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/js.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/key.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/key.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/less.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/less.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/mid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/mid.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/mp3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/mp3.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/mp4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/mp4.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/mpg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/mpg.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/odf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/odf.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/ods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/ods.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/odt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/odt.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/otp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/otp.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/ots.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/ots.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/ott.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/ott.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/pdf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/pdf.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/php.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/php.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/png.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/ppt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/ppt.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/psd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/psd.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/py.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/py.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/qt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/qt.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/rar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/rar.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/rb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/rb.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/rtf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/rtf.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/sass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/sass.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/scss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/scss.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/sql.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/sql.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/tga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/tga.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/tgz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/tgz.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/tiff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/tiff.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/txt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/txt.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/wav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/wav.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/xls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/xls.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/xlsx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/xlsx.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/xml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/xml.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/yml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/yml.png
--------------------------------------------------------------------------------
/admin/public/images/icons/32/zip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/icons/32/zip.png
--------------------------------------------------------------------------------
/admin/public/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/admin/public/images/logo.png
--------------------------------------------------------------------------------
/admin/public/styles/content/editor.min.css:
--------------------------------------------------------------------------------
1 | .ks-editable-btn{background:rgba(255,255,255,0.75);border-radius:5px;border:1px solid rgba(0,0,0,0.5);color:#666;cursor:pointer;display:inline-block;font-size:13px;font-weight:normal;line-height:16px;padding:5px 10px;position:absolute;text-align:center;text-decoration:none;text-transform:uppercase;vertical-align:middle;white-space:nowrap}.ks-editable-btn:active,.ks-editable-btn:hover,.ks-editable-btn:focus{background:white;border:1px solid #000;color:black;text-decoration:none}.ks-editable-btn.active{background-image:none;box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);outline:0}
--------------------------------------------------------------------------------
/admin/public/styles/error.css:
--------------------------------------------------------------------------------
1 | /*
2 | Generic Errors
3 | */
4 |
5 | html {
6 | font-size: 62.5%;
7 | }
8 | body {
9 | background-color: #f6f6f6;
10 | color: #888;
11 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
12 | font-size: 16px;
13 | font-size: 1.6rem;
14 | font-weight: 300;
15 | line-height: 1.42857143;
16 | height: 80%;
17 | margin: 0;
18 | }
19 |
20 | /* center the error */
21 | .error {
22 | margin: 0 auto;
23 | max-width: 600px;
24 | position: relative;
25 | width: 90%;
26 | top: 50%;
27 |
28 | -webkit-transform: translate(0, -50%);
29 | -ms-transform: translate(0, -50%);
30 | transform: translate(0, -50%);
31 | }
32 |
33 | h1, h2, h3 {
34 | font-weight: 300;
35 | }
36 | h1 {
37 | font-size: 1.5em;
38 | }
39 | h2 {
40 | font-size: 1.25em;
41 | }
42 | h3 {
43 | font-size: 1.1em;
44 | }
45 |
--------------------------------------------------------------------------------
/admin/public/styles/keystone/animation.less:
--------------------------------------------------------------------------------
1 | //
2 | // Generic Animations
3 | // ==============================
4 |
5 |
6 |
7 |
8 | // Fade
9 | // ------------------------------
10 |
11 | .react-transitiongroup-fade-enter {
12 | .animation( fadeIn 200ms );
13 | }
14 | .react-transitiongroup-fade-leave {
15 | .animation( fadeOut 200ms );
16 | }
--------------------------------------------------------------------------------
/admin/public/styles/keystone/field-localfile.less:
--------------------------------------------------------------------------------
1 | //
2 | // Local File
3 | // ==============================
4 |
5 | .field-type-localfiles {
6 | .sortable-placeholder {
7 | border: 1px dashed #777;
8 | background: none;
9 | margin-top: 0px;
10 | margin-left: 0px;
11 | margin-right: 10px;
12 | margin-bottom: 0px;
13 | float: left;
14 | }
15 | .file-sortable {
16 | position: relative;
17 | float:left;
18 | cursor:pointer;
19 | min-width: 80px;
20 | min-height: 80px;
21 | margin-left: 0px;
22 | margin-right: 10px;
23 | }
24 | .file-preview.remove {
25 | img {
26 | opacity: .3;
27 | }
28 | }
29 | .delete-pending {
30 | position: absolute;
31 | font-size: 1.7em;
32 | left:50%;
33 | top:50%;
34 | margin-left:-13px;
35 | margin-top:-44px;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/admin/public/styles/keystone/list-sort.less:
--------------------------------------------------------------------------------
1 | //
2 | // List Sorting
3 | // ==============================
4 |
5 |
6 |
7 |
8 | // Buttons
9 | // ------------------------------
10 |
11 | .ItemList__sort-button {
12 | background: none;
13 | border: none;
14 | padding: 0;
15 | }
16 |
--------------------------------------------------------------------------------
/admin/public/styles/keystone/toolbar.less:
--------------------------------------------------------------------------------
1 | //
2 | // Toolbar
3 | // ==============================
4 |
5 |
6 |
7 |
8 | // Base
9 |
10 | .Toolbar {
11 | .clearfix();
12 | border-bottom: 1px dashed darken(@body-bg, 10%);
13 | margin-bottom: 2em;
14 | padding-bottom: 1em;
15 | padding-top: 1em;
16 |
17 | // clear the interior floats
18 | > .container {
19 | &:extend(.u-clearfix all);
20 | }
21 | }
22 |
23 |
24 | // Sections
25 |
26 | // remove the padding from Link style Buttons on either side to keep everything aligned correctly
27 |
28 | .Toolbar__section--left {
29 | float: left;
30 |
31 | > .Button--link:first-child {
32 | padding-left: 0;
33 | }
34 | }
35 | .Toolbar__section--right {
36 | float: right;
37 |
38 | > .Button--link:last-child {
39 | padding-right: 0;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/admin/server/api/counts.js:
--------------------------------------------------------------------------------
1 | var async = require('async');
2 |
3 | module.exports = function (req, res) {
4 | var keystone = req.keystone;
5 | var counts = {};
6 | async.each(keystone.lists, function (list, next) {
7 | list.model.count(function (err, count) {
8 | counts[list.key] = count;
9 | next(err);
10 | });
11 | }, function (err) {
12 | if (err) return res.apiError('database error', err);
13 | return res.json({
14 | counts: counts,
15 | });
16 | });
17 | };
18 |
--------------------------------------------------------------------------------
/admin/server/api/item/sortOrder.js:
--------------------------------------------------------------------------------
1 | /*
2 | TODO: Needs Review and Spec
3 | */
4 |
5 | var getList = require('../list/get');
6 |
7 | module.exports = function (req, res) {
8 | var keystone = req.keystone;
9 | if (!keystone.security.csrf.validate(req)) {
10 | console.log('Refusing to reorder ' + req.list.key + ' ' + req.params.id + '; CSRF failure');
11 | return res.apiError(403, 'invalid csrf');
12 | }
13 | req.list.model.reorderItems(req.params.id, req.params.sortOrder, req.params.newOrder, function (err) {
14 | if (err) return res.apiError('database error', err);
15 | return getList(req, res);
16 | });
17 | };
18 |
--------------------------------------------------------------------------------
/admin/server/api/list/create.js:
--------------------------------------------------------------------------------
1 | module.exports = function (req, res) {
2 | var keystone = req.keystone;
3 | if (!keystone.security.csrf.validate(req)) {
4 | return res.apiError(403, 'invalid csrf');
5 | }
6 |
7 | var item = new req.list.model();
8 | req.list.updateItem(item, req.body, {
9 | files: req.files,
10 | ignoreNoEdit: true,
11 | user: req.user,
12 | }, function (err) {
13 | if (err) {
14 | var status = err.error === 'validation errors' ? 400 : 500;
15 | var error = err.error === 'database error' ? err.detail : err;
16 | return res.apiError(status, error);
17 | }
18 | res.json(req.list.getData(item));
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/admin/server/api/session/get.js:
--------------------------------------------------------------------------------
1 | function get (req, res) {
2 | return res.json({ user: req.user });
3 | }
4 |
5 | module.exports = get;
6 |
--------------------------------------------------------------------------------
/admin/server/api/session/signout.js:
--------------------------------------------------------------------------------
1 | function signout (req, res) {
2 | var keystone = req.keystone;
3 | if (!keystone.security.csrf.validate(req)) {
4 | return res.apiError(403, 'invalid csrf');
5 | }
6 | var user = req.user;
7 | keystone.callHook(user, 'pre:signout', function (err) {
8 | if (err) return res.status(500).json({ error: 'pre:signout error', detail: err });
9 | res.clearCookie('keystone.uid');
10 | req.user = null;
11 | req.session.regenerate(function (err) {
12 | if (err) return res.status(500).json({ error: 'session error', detail: err });
13 | keystone.callHook(user, 'post:signout', function (err) {
14 | if (err) return res.status(500).json({ error: 'post:signout error', detail: err });
15 | res.json({ success: true });
16 | });
17 | });
18 | });
19 | }
20 |
21 | module.exports = signout;
22 |
--------------------------------------------------------------------------------
/admin/server/app/createHealthchecksHandler.js:
--------------------------------------------------------------------------------
1 | var safeRequire = require('../../../lib/safeRequire');
2 |
3 | function createHealthchecksHandler (keystone) {
4 | var healthcheck = safeRequire('keystone-healthchecks', 'healthchecks');
5 | var healthcheckConfig = keystone.get('healthchecks');
6 |
7 | if (healthcheckConfig === true) {
8 | healthcheckConfig = {};
9 | // By default, we simply bind the user model healthcheck if there is a
10 | // user model. This validates we can successfully query the database.
11 | if (keystone.get('user model')) {
12 | var User = keystone.list(keystone.get('user model'));
13 | healthcheckConfig.canQueryUsers = healthcheck.healthchecks.canQueryListFactory(User);
14 | }
15 | }
16 |
17 | return healthcheck.createRoute(healthcheckConfig);
18 | }
19 |
20 | module.exports = createHealthchecksHandler;
21 |
--------------------------------------------------------------------------------
/admin/server/index.js:
--------------------------------------------------------------------------------
1 | exports.createDynamicRouter = require('./app/createDynamicRouter');
2 | exports.createStaticRouter = require('./app/createStaticRouter');
3 |
--------------------------------------------------------------------------------
/admin/server/middleware/initList.js:
--------------------------------------------------------------------------------
1 | module.exports = function initList (req, res, next) {
2 | var keystone = req.keystone;
3 | req.list = keystone.list(req.params.list);
4 | if (!req.list) {
5 | if (req.headers.accept === 'application/json') {
6 | return res.status(404).json({ error: 'invalid list path' });
7 | }
8 | req.flash('error', 'List ' + req.params.list + ' could not be found.');
9 | return res.redirect('/' + keystone.get('admin path'));
10 | }
11 | next();
12 | };
13 |
--------------------------------------------------------------------------------
/admin/server/middleware/logError.js:
--------------------------------------------------------------------------------
1 | module.exports = function (req, res, next) {
2 | res.logError = function logError (endpoint, description, err) {
3 | if (arguments.length === 2 && typeof description !== 'string') {
4 | err = description;
5 | description = null;
6 | }
7 | var msg = '[' + endpoint + ']';
8 | msg += description ? ' ' + description + ':' : ' error:';
9 | if (err) {
10 | console.log(msg, err.message, '\n' + err.stack);
11 | } else {
12 | console.log(msg);
13 | }
14 | };
15 | next();
16 | };
17 |
--------------------------------------------------------------------------------
/admin/server/routes/signout.js:
--------------------------------------------------------------------------------
1 | var session = require('../../../lib/session');
2 |
3 | module.exports = function SignoutRoute (req, res) {
4 | var keystone = req.keystone;
5 | session.signout(req, res, function () {
6 | // After logging out, the user will be redirected to /signin?signedout
7 | // It shows a bar on top of the sign in panel saying "You have been signed out".
8 | if (typeof keystone.get('signout redirect') === 'string') {
9 | return res.redirect(keystone.get('signout redirect'));
10 | } else if (typeof keystone.get('signout redirect') === 'function') {
11 | return keystone.get('signout redirect')(req, res);
12 | } else {
13 | return res.redirect('/' + keystone.get('admin path') + '/signin?signedout');
14 | }
15 | });
16 | };
17 |
--------------------------------------------------------------------------------
/admin/server/templates/signin.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sign in to <%= brand %>
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/build.js:
--------------------------------------------------------------------------------
1 | var browserify = require('browserify');
2 |
3 | var packages = require('./admin/client/packages');
4 | var b = browserify({
5 | debug: process.env.NODE_ENV !== 'production',
6 | });
7 | packages.forEach(function (i) { b.require(i); });
8 | b.bundle().pipe(process.stdout);
9 |
--------------------------------------------------------------------------------
/docs/api/Field/Underscore-Methods.md:
--------------------------------------------------------------------------------
1 | # Underscore methods
2 |
3 | Many fields have special functions to allow you to manipulate data, which are referred to throughout the documentation called `underscore methods`. These allow specific actions to be called that relate to the data in that field. An example is the `password.compare` method.
4 |
5 | To access an underscore method, you can use an instance of the object. For example, if you have a user with a password field, you may want to access the compare method.
6 |
7 | Once you have retrieved a user from the database you can find the method at:
8 |
9 | ```js
10 | user._.password.compare()
11 | ```
12 |
13 | > NOTE: Underscore Methods in Keystone have no relation to the javascript underscore library.
14 |
--------------------------------------------------------------------------------
/docs/api/List/add.md:
--------------------------------------------------------------------------------
1 | # Add
2 |
3 | ## add(fields:Object, prefix:String)
4 |
5 | Adds fields to a [keystone List](/api/list/options). Must be used before [register()](/api/list/register). This takes an object with all of the fields, as well as a prefix option. The prefix will be added to the list's collection name in mongo.
6 |
7 | Example call:
8 |
9 | ```javascript
10 | var Cat = new keystone.List('Cat');
11 |
12 | Cat.add({
13 | name: { type: String },
14 | age: { type: Number },
15 | });
16 | ```
17 |
18 | Each field uses its key as the name of the field within the database.
19 |
20 | All fields must have a type, either `String`, `Number`, `Boolean`, or one of the defined [Keystone field types](/api/field)
21 |
--------------------------------------------------------------------------------
/docs/api/List/model.md:
--------------------------------------------------------------------------------
1 | # Model
2 |
3 | Once you retrieve a list from Keystone, the [mongoose](http://mongoosejs.com/) methods can be accessed from `.model`.
4 |
5 | Example:
6 |
7 | ```javascript
8 | var User = require('keystone').list('User');
9 |
10 | User.model.find({});
11 | ```
12 |
13 | See the mongoose [query](http://mongoosejs.com/docs/queries.html) documentation for more details on querying your database.
14 |
--------------------------------------------------------------------------------
/docs/api/List/register.md:
--------------------------------------------------------------------------------
1 | # Register
2 |
3 | Adds a list to Keystone's know lists.
4 |
5 | This checks the options chosen for a list and validates them, and then makes them available through [keystone.list](/api/methods/list). Without register being run, the list will not be added to either Mongoose or Keystone.
6 |
7 | This should be run before [keystone.start](/api/methods/start)
8 |
--------------------------------------------------------------------------------
/docs/api/List/schema.md:
--------------------------------------------------------------------------------
1 | # Schema
2 |
3 | The mongoose schema is accessible on new lists, and can be extended before the list is registered.
4 |
5 | The most common uses of this are to add pre-save, and post-save hooks, add a schema method, or to add a virtual field. See the mongoose documentation for more information: [mongoose schema docs](http://mongoosejs.com/docs/guide.html#options).
6 |
7 | Example:
8 |
9 | ```javascript
10 | User.schema.virtual('canAccessKeystone').get(function () {
11 | if (this.isAdmin) return true;
12 | });
13 | ```
14 |
--------------------------------------------------------------------------------
/docs/api/Methods/closeDatabaseConnection.md:
--------------------------------------------------------------------------------
1 | # Close Database connection
2 |
3 | ## `keystone.closeDatabaseConnection(callback:Function)`
4 |
5 | Closes all database connections Keystone has open.
6 |
--------------------------------------------------------------------------------
/docs/api/Methods/create-router.md:
--------------------------------------------------------------------------------
1 | # Create Router
2 |
3 | ## `var newRouter = keystone.createRouter()`
4 |
5 | Returns a new [express router](https://expressjs.com/en/4x/api.html#router) object.
6 |
--------------------------------------------------------------------------------
/docs/api/Methods/get.md:
--------------------------------------------------------------------------------
1 | # Get
2 |
3 | ## `keystone.get(key:String)`
4 |
5 | Retrieve a property from Keystone's options. For information about Keystone's options, see [configuration](/documentation/configuration) documentation.
6 |
7 | This can be used to retrieve information about Keystone's running once it has started.
8 |
9 | Example:
10 |
11 | ```javascript
12 | keystone.get('env')
13 | ```
14 |
15 | > NOTE: `keystone.get` is an alias for [keystone.set](/api/methods/set). As such, passing in a second argument will cause it to set the value of the Keystone option to the second argument before returning the value.
16 |
--------------------------------------------------------------------------------
/docs/api/Methods/importer.md:
--------------------------------------------------------------------------------
1 | # Importer
2 |
3 | ## `keystone.importer(relativeDirName:String)`
4 |
5 | Returns a function that imports all javascript files in a directory, using the passed in directory as the relative path from which to make the search.
6 |
7 | Example:
8 |
9 | ```javascript
10 | var importRoutes = keystone.importer(__dirname);
11 |
12 | var routes = {
13 | views: importRoutes('./views'),
14 | };
15 |
16 | exports = module.exports = function (app) {
17 | app.get('/', routes.views.index)
18 | };
19 | ```
20 |
--------------------------------------------------------------------------------
/docs/api/Methods/init.md:
--------------------------------------------------------------------------------
1 | # Init
2 |
3 | ## `Keystone.init(options:Object)`
4 |
5 | `Keystone.init` provides initial options to Keystone. These are used to format and customise how Keystone runs.
6 |
7 | Some properties can be provided to init but not to [set](/api/methods/set):
8 |
9 | - cloudinary config
10 | - auth
11 | - nav
12 | - mongo
13 | - module root
14 | - app
15 | - mongoose
16 | - frame guard
17 |
18 | The initialization options can be found in the [configuration](/documentation/configuration) documentation.
19 |
20 | For information on setting up Keystone, see the [installation guide](/getting-started/setting-up/part-1)
21 |
--------------------------------------------------------------------------------
/docs/api/Methods/list.md:
--------------------------------------------------------------------------------
1 | # list
2 |
3 | ## `keystone.list(listName:String)`
4 |
5 | A function used to retrieve a particular Keystone list, so that items can be retrieved from the database, and saved to the database.
6 |
7 | Example:
8 |
9 | ```javascript
10 | var User = require('keystone').list('User');
11 |
12 | User.model.find({}, callback)
13 | ```
14 |
15 | > NOTE: Keystone models use mongoose methods such as find undecorated.
16 |
--------------------------------------------------------------------------------
/docs/api/Methods/openDatabaseConnection.md:
--------------------------------------------------------------------------------
1 | # Open Database Connection
2 |
3 | ## `keystone.openDatabaseConnection(callback:Function)`
4 |
5 | Opens a database connection using the options set in Keystone. If the Keystone database settings are not configured, or the models are not registered, this will fail.
6 |
7 | `openDatabaseConnection` is called by [start](/api/methods/start), and will be called before the express server is started.
8 |
--------------------------------------------------------------------------------
/docs/api/Methods/pre.md:
--------------------------------------------------------------------------------
1 | # Pre
2 |
3 | ## `keystone.pre(actionName:String, desiredAction:Function)`
4 |
5 | Pre can be used to add some of the global middleware that Keystone can add. Most specifically, any with the `pre` prefix. For more information about adding middleware, see the [middleware documentation](/api/methods/middleware).
6 |
--------------------------------------------------------------------------------
/docs/api/View/query.md:
--------------------------------------------------------------------------------
1 | # query
2 |
3 | `view.query(key:String, query:QueryObject[, options:Object])`
4 |
5 | Attaches a database query to be run before the render occurs, during the `queryQueue` run. The data returned from the query will be attached to the `locals` with the value of the key.
6 |
7 | Example:
8 |
9 | ```javascript
10 | var User = keystone.list('User');
11 |
12 | view.query('currentUser', User.model.findOne({ name: req.body.name }));
13 | ```
14 |
15 | This query will add the user with a matching name to `locals.currentUser` for use by the template in rendering.
16 |
--------------------------------------------------------------------------------
/docs/api/index.md:
--------------------------------------------------------------------------------
1 | # API References
2 |
3 | ## Most Common Locations
4 |
5 | - [List](/api/list)
6 | - [Methods](/api/methods/close-database-connection)
7 | - [View](/api/view/on)
8 | - [Field Types](/api/field/options)
9 |
--------------------------------------------------------------------------------
/docs/documentation/index.md:
--------------------------------------------------------------------------------
1 | # Documentation
2 |
3 | ## Most Common Locations
4 |
5 | - [Setting Keystone Options](/documentation/configuration)
6 | - [Database Configuration](/documentation/database)
7 | - [Adding Routes](/documentation/configuration/#adding-routes)
8 | - [Using Keystone Views](/api/view)
9 |
10 | If you want a quick run-down of setting up a Keystone project from scratch, with an explanation of the steps involved, you can see our [setting up](/getting-started/setting-up/part-1) information.
11 |
--------------------------------------------------------------------------------
/docs/guides/assets/mailgun-dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/docs/guides/assets/mailgun-dashboard.png
--------------------------------------------------------------------------------
/docs/guides/assets/mailgun-go-to-auth-rep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/docs/guides/assets/mailgun-go-to-auth-rep.png
--------------------------------------------------------------------------------
/fields/components/CollapsedFieldLabel.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Button } from '../../admin/client/App/elemental';
3 |
4 | // NOTE marginBottom of 1px stops things jumping around
5 | // TODO find out why this is necessary
6 |
7 | function CollapsedFieldLabel ({ style, ...props }) {
8 | const __style__ = {
9 | marginBottom: 1,
10 | paddingLeft: 0,
11 | paddingRight: 0,
12 | ...style,
13 | };
14 |
15 | return (
16 |
17 | );
18 | };
19 |
20 | module.exports = CollapsedFieldLabel;
21 |
--------------------------------------------------------------------------------
/fields/components/ItemsTableCell.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import classnames from 'classnames';
3 |
4 | function ItemsTableCell ({ className, ...props }) {
5 | props.className = classnames('ItemList__col', className);
6 |
7 | return | ;
8 | };
9 |
10 | module.exports = ItemsTableCell;
11 |
--------------------------------------------------------------------------------
/fields/components/NestedFormField.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { FormField, FormLabel } from '../../admin/client/App/elemental';
3 | import theme from '../../admin/client/theme';
4 |
5 | function NestedFormField ({ children, className, label, ...props }) {
6 | return (
7 |
8 |
9 | {label}
10 |
11 | {children}
12 |
13 | );
14 | };
15 | const classes = {
16 | label: {
17 | color: theme.color.gray40,
18 | fontSize: theme.font.size.small,
19 |
20 | [`@media (min-width: ${theme.breakpoint.tabletLandscapeMin})`]: {
21 | paddingLeft: '1em',
22 | },
23 | },
24 | };
25 |
26 | module.exports = NestedFormField;
27 |
--------------------------------------------------------------------------------
/fields/components/columns/ArrayColumn.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ItemsTableCell from '../../components/ItemsTableCell';
3 | import ItemsTableValue from '../../components/ItemsTableValue';
4 |
5 | var ArrayColumn = React.createClass({
6 | displayName: 'ArrayColumn',
7 | propTypes: {
8 | col: React.PropTypes.object,
9 | data: React.PropTypes.object,
10 | },
11 | renderValue () {
12 | const value = this.props.data.fields[this.props.col.path];
13 | if (!value || !value.length) return null;
14 |
15 | return value.join(', ');
16 | },
17 | render () {
18 | return (
19 |
20 |
21 | {this.renderValue()}
22 |
23 |
24 | );
25 | },
26 | });
27 |
28 | module.exports = ArrayColumn;
29 |
--------------------------------------------------------------------------------
/fields/components/columns/InvalidColumn.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ItemsTableCell from '../../components/ItemsTableCell';
3 | import ItemsTableValue from '../../components/ItemsTableValue';
4 |
5 | var InvalidColumn = React.createClass({
6 | displayName: 'InvalidColumn',
7 | propTypes: {
8 | col: React.PropTypes.object,
9 | },
10 | renderValue () {
11 | return (
12 |
13 | (Invalid Type: {this.props.col.type})
14 |
15 | );
16 |
17 | },
18 | render () {
19 | return (
20 |
21 | {this.renderValue()}
22 |
23 | );
24 | },
25 | });
26 |
27 | module.exports = InvalidColumn;
28 |
--------------------------------------------------------------------------------
/fields/types/azurefile/AzureFileColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/azurefile/AzureFileField.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/azurefile/AzureFileFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/boolean/BooleanColumn.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Checkbox from '../../components/Checkbox';
3 | import ItemsTableCell from '../../components/ItemsTableCell';
4 | import ItemsTableValue from '../../components/ItemsTableValue';
5 |
6 | var BooleanColumn = React.createClass({
7 | displayName: 'BooleanColumn',
8 | propTypes: {
9 | col: React.PropTypes.object,
10 | data: React.PropTypes.object,
11 | },
12 | renderValue () {
13 | return (
14 |
15 |
16 |
17 | );
18 | },
19 | render () {
20 | return (
21 |
22 | {this.renderValue()}
23 |
24 | );
25 | },
26 | });
27 |
28 | module.exports = BooleanColumn;
29 |
--------------------------------------------------------------------------------
/fields/types/boolean/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../BooleanField'),
3 | Filter: require('../BooleanFilter'),
4 | readme: require('fs').readFileSync('./fields/types/boolean/Readme.md', 'utf8'),
5 | section: 'Miscellaneous',
6 | spec: {
7 | label: 'Boolean',
8 | path: 'boolean',
9 | value: false,
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/cloudinaryimages/CloudinaryImagesFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../cloudinaryimage/CloudinaryImageFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/cloudinaryimages/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../CloudinaryImagesField'),
3 | Filter: require('../CloudinaryImagesFilter'),
4 | section: 'Miscellaneous',
5 | spec: {
6 | label: 'CloudinaryImages',
7 | path: 'cloudinaryimages',
8 | paths: {
9 | action: 'cloudinaryimages_action',
10 | folder: 'cloudinaryimages.folder',
11 | order: 'cloudinaryimages_order',
12 | upload: 'cloudinaryimages_upload',
13 | uploads: 'cloudinaryimages_uploads',
14 | },
15 | value: [],
16 | },
17 | };
18 |
--------------------------------------------------------------------------------
/fields/types/code/CodeColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/code/CodeFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/code/Readme.md:
--------------------------------------------------------------------------------
1 | # Code Field
2 |
3 | Stores a `String` in the model.
4 | Displayed with CodeMirror in the Admin UI.
5 |
6 | ## Example
7 |
8 | ```js
9 | { type: Types.Code, height: 180, language: json }
10 | ```
11 |
12 | ## Options
13 |
14 | `height` `Number`
15 | The height of the field (in pixels). Default: 180
16 |
17 | `language` `String`
18 | The language in the code field.
19 |
20 | Supported languages:
21 | `c++, objectivec, css, asp, c, vb, xml, php, html, ini, js, java, coffee, lisp, perl, python, sql, json, less, sass, sh, ruby, jsp, tpl, jade`
22 |
23 | ## Methods
24 |
25 | ### Inherits from [`Text`](../text)
26 |
27 | * `addFilterToQuery`
28 | * `validateInput`
29 | * `validateRequiredInput`
30 |
31 | ## Filtering
32 |
33 | Uses the same logic and filter UI as the [`Text`](../text) field type.
34 |
--------------------------------------------------------------------------------
/fields/types/code/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../CodeField'),
3 | Filter: require('../CodeFilter'),
4 | readme: require('fs').readFileSync('./fields/types/code/Readme.md', 'utf8'),
5 | section: 'Text',
6 | spec: {
7 | label: 'Code',
8 | path: 'text',
9 | value: 'Hello World!
',
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/color/ColorFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/color/ColorType.js:
--------------------------------------------------------------------------------
1 | var FieldType = require('../Type');
2 | var TextType = require('../text/TextType');
3 | var util = require('util');
4 |
5 |
6 | /**
7 | * Color FieldType Constructor
8 | * @extends Field
9 | * @api public
10 | */
11 | function color (list, path, options) {
12 | this._nativeType = String;
13 | color.super_.call(this, list, path, options);
14 | }
15 | color.properName = 'Color';
16 | util.inherits(color, FieldType);
17 |
18 | color.prototype.validateInput = TextType.prototype.validateInput;
19 | color.prototype.validateRequiredInput = TextType.prototype.validateRequiredInput;
20 |
21 | /* Inherit from TextType prototype */
22 | color.prototype.addFilterToQuery = TextType.prototype.addFilterToQuery;
23 |
24 | /* Export Field Type */
25 | module.exports = color;
26 |
--------------------------------------------------------------------------------
/fields/types/color/Readme.md:
--------------------------------------------------------------------------------
1 | # Color Field
2 |
3 | Stores a `String` in the model.
4 | Displayed as a text field with a color picker.
5 |
6 | ## Example
7 |
8 | ```js
9 | { type: Types.Color }
10 | ```
11 |
12 | ## Methods
13 |
14 | ### Inherits from [`Text`](../text)
15 |
16 | * `addFilterToQuery`
17 | * `validateInput`
18 | * `validateRequiredInput`
19 |
20 | ## Filtering
21 |
22 | Uses the same logic and filter UI as the [`Text`](../text) field type.
23 |
--------------------------------------------------------------------------------
/fields/types/color/colored-swatch.js:
--------------------------------------------------------------------------------
1 | module.exports = (
2 | ``
7 | );
8 |
--------------------------------------------------------------------------------
/fields/types/color/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../ColorField'),
3 | Filter: require('../ColorFilter'),
4 | readme: require('fs').readFileSync('./fields/types/color/Readme.md', 'utf8'),
5 | section: 'Text',
6 | spec: {
7 | label: 'Color',
8 | path: 'color',
9 | value: 'white',
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/color/transparent-swatch.js:
--------------------------------------------------------------------------------
1 | module.exports = (
2 | ``
7 | );
8 |
--------------------------------------------------------------------------------
/fields/types/date/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../DateField'),
3 | Filter: require('../DateFilter'),
4 | readme: require('fs').readFileSync('./fields/types/date/Readme.md', 'utf8'),
5 | section: 'Date',
6 | spec: {
7 | label: 'Date',
8 | path: 'date',
9 | value: '2016-07-11',
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/datearray/DateArrayColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../../components/columns/ArrayColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/datearray/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../DateArrayField'),
3 | Filter: require('../DateArrayFilter'),
4 | section: 'Date',
5 | spec: {
6 | label: 'Datearray',
7 | path: 'datearray',
8 | value: ['2016-07-11', '2016-04-23', '2014-11-12'],
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/fields/types/datetime/DatetimeColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../date/DateColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/datetime/DatetimeFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../date/DateFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/datetime/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../DatetimeField'),
3 | Filter: require('../DatetimeFilter'),
4 | readme: require('fs').readFileSync('./fields/types/datetime/Readme.md', 'utf8'),
5 | section: 'Date',
6 | spec: {
7 | label: 'Datetime',
8 | path: 'datetime',
9 | paths: {
10 | date: 'datetime.date',
11 | time: 'datetime.time',
12 | },
13 | value: new Date(),
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/fields/types/email/EmailColumn.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ItemsTableCell from '../../components/ItemsTableCell';
3 | import ItemsTableValue from '../../components/ItemsTableValue';
4 |
5 | var EmailColumn = React.createClass({
6 | displayName: 'EmailColumn',
7 | propTypes: {
8 | col: React.PropTypes.object,
9 | data: React.PropTypes.object,
10 | },
11 | renderValue () {
12 | const value = this.props.data.fields[this.props.col.path];
13 | if (!value) return;
14 |
15 | return (
16 |
17 | {value}
18 |
19 | );
20 | },
21 | render () {
22 | return (
23 |
24 | {this.renderValue()}
25 |
26 | );
27 | },
28 | });
29 |
30 | module.exports = EmailColumn;
31 |
--------------------------------------------------------------------------------
/fields/types/email/EmailFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/email/Readme.md:
--------------------------------------------------------------------------------
1 | # Email Field
2 |
3 | `String` — Displayed as a text field in the Admin UI.
4 |
5 | > Note: Input must look like a valid email address (can be blank unless field is required)
6 |
7 | ```js
8 | { type: Types.Email, displayGravatar: true }
9 | ```
10 |
11 | ## Options
12 |
13 | ### `displayGravatar` `Boolean`
14 | whether to display a gravatar image in the Admin UI
15 |
16 | ## Underscore methods
17 |
18 | ### `gravatarUrl(input, size, defaultImage, rating)`
19 | generates a gravatar image request url
20 |
21 | ```js
22 | item.email = "demo@keystonejs.com";
23 | item._.email.gravatarUrl(); // "//www.gravatar.com/avatar/74a0071e5f3a7107b570b7d4a1a7619d?s=80&d=identicon&r=g"
24 | item._.email.gravatarUrl(200,'mm','r'); // "//www.gravatar.com/avatar/74a0071e5f3a7107b570b7d4a1a7619d?s=200&d=mm&r=r"
25 | ```
26 |
--------------------------------------------------------------------------------
/fields/types/email/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../EmailField'),
3 | Filter: require('../EmailFilter'),
4 | section: 'Text',
5 | spec: {
6 | label: 'Email',
7 | path: 'email',
8 | value: 'user@keystonejs.com',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/fields/types/embedly/EmbedlyColumn.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 |
3 | var EmbedlyColumn = React.createClass({
4 | renderValue: function () {
5 | var value = this.props.data.fields[this.props.col.path];
6 | if (!value || !_.size(value)) return;
7 | return {value.url};
8 | },
9 | render: function () {
10 | return (
11 |
12 | {this.renderValue()}
13 | |
14 | );
15 | },
16 | });
17 |
18 | module.exports = EmbedlyColumn;
19 |
--------------------------------------------------------------------------------
/fields/types/embedly/EmbedlyFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../cloudinaryimage/CloudinaryImageFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/file/FileFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../cloudinaryimage/CloudinaryImageFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/geopoint/Readme.md:
--------------------------------------------------------------------------------
1 | # GeoPoint Field
2 |
3 | Stores an `Array` of `Number` values in the model.
4 |
5 | Displayed as two text input fields in the Admin UI of latitude and longitude.
6 |
7 | If you are updating the database, it requires the two numbers to be in [longitude, latitude] order.
8 |
9 | ## Example
10 | ```js
11 | { type: Types.GeoPoint }
12 | ```
13 |
14 | Uses MongoDB's [2dsphere](https://docs.mongodb.com/manual/core/2dsphere/) index to add the longitude / latitude pair to schema.
15 |
--------------------------------------------------------------------------------
/fields/types/geopoint/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../GeoPointField'),
3 | Filter: require('../GeoPointFilter'),
4 | section: 'Miscellaneous',
5 | spec: {
6 | label: 'Geopoint',
7 | path: 'geopoint',
8 | value: [],
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/fields/types/html/HtmlColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/html/HtmlFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/html/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../HtmlField'),
3 | Filter: require('../HtmlFilter'),
4 | readme: require('fs').readFileSync('./fields/types/html/Readme.md', 'utf8'),
5 | section: 'Text',
6 | spec: {
7 | label: 'Html',
8 | path: 'html',
9 | value: 'Hello World!
',
10 | wysiwyg: true,
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/fields/types/key/KeyColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/key/KeyField.js:
--------------------------------------------------------------------------------
1 | import Field from '../Field';
2 |
3 | module.exports = Field.create({
4 | displayName: 'KeyField',
5 | statics: {
6 | type: 'Key',
7 | },
8 | });
9 |
--------------------------------------------------------------------------------
/fields/types/key/KeyFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/key/Readme.md:
--------------------------------------------------------------------------------
1 | # Key Field
2 |
3 | `String` — Displayed as a text field in the Admin UI.
4 |
5 | Automatically converts input to a valid key (no spaces or special characters). White space is replaced with a separator.
6 |
7 | ```js
8 | { type: Types.Key }
9 | ```
10 |
11 | ## Options
12 |
13 | `separator` `String`
14 | the separator to use when replace white space in the input; defaults to `-`.
15 |
--------------------------------------------------------------------------------
/fields/types/key/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../KeyField'),
3 | Filter: require('../KeyFilter'),
4 | section: 'Text',
5 | spec: {
6 | label: 'Key',
7 | path: 'key',
8 | value: 'keystone',
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/fields/types/localfile/LocalFileColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/localfile/LocalFileField.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/localfile/LocalFileFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/localfiles/LocalFilesColumn.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 |
3 | var LocalFilesColumn = React.createClass({
4 | renderValue: function () {
5 | var value = this.props.data.fields[this.props.col.path];
6 | if (value.length === 0) return '';
7 | var fileOrFiles = (value.length > 1) ? 'Files' : 'File';
8 | return value.length + ' ' + fileOrFiles;
9 | },
10 | render: function () {
11 | return (
12 |
13 | {this.renderValue()}
14 | |
15 | );
16 | },
17 | });
18 |
19 | module.exports = LocalFilesColumn;
20 |
--------------------------------------------------------------------------------
/fields/types/localfiles/LocalFilesFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../cloudinaryimage/CloudinaryImageFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/localfiles/readme.md:
--------------------------------------------------------------------------------
1 | # LocalFiles
2 |
3 | > Warning: the LocalFiles Field has been deprecated. Please use the [File](/api/field/File) and a storage adapter going forward.
4 |
--------------------------------------------------------------------------------
/fields/types/markdown/MarkdownColumn.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ItemsTableCell from '../../components/ItemsTableCell';
3 | import ItemsTableValue from '../../components/ItemsTableValue';
4 |
5 | var MarkdownColumn = React.createClass({
6 | displayName: 'MarkdownColumn',
7 | propTypes: {
8 | col: React.PropTypes.object,
9 | data: React.PropTypes.object,
10 | },
11 | renderValue () {
12 | const value = this.props.data.fields[this.props.col.path];
13 | return (value && Object.keys(value).length) ? value.md.substr(0, 100) : null;
14 | },
15 | render () {
16 | return (
17 |
18 |
19 | {this.renderValue()}
20 |
21 |
22 | );
23 | },
24 | });
25 |
26 | module.exports = MarkdownColumn;
27 |
--------------------------------------------------------------------------------
/fields/types/markdown/MarkdownFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/markdown/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../MarkdownField'),
3 | Filter: require('../MarkdownFilter'),
4 | readme: require('fs').readFileSync('./fields/types/markdown/Readme.md', 'utf8'),
5 | section: 'Text',
6 | spec: {
7 | label: 'Markdown',
8 | path: 'markdown',
9 | paths: {
10 | html: 'markdown.html',
11 | md: 'markdown.md',
12 | },
13 | wysiwyg: true,
14 | toolbarOptions: {},
15 | value: {
16 | html: 'Hello World!
',
17 | md: '*Hello World!*',
18 | },
19 | },
20 | };
21 |
--------------------------------------------------------------------------------
/fields/types/money/MoneyColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../number/NumberColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/money/MoneyFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../number/NumberFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/money/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../MoneyField'),
3 | Filter: require('../MoneyFilter'),
4 | readme: require('fs').readFileSync('./fields/types/money/Readme.md', 'utf8'),
5 | section: 'Number',
6 | spec: {
7 | label: 'Money',
8 | path: 'text',
9 | value: 0,
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/name/NameFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/name/Readme.md:
--------------------------------------------------------------------------------
1 | # Name Field
2 |
3 | `Object` — Displayed as **firstname lastname** fields in the Admin UI.
4 |
5 | ```js
6 | { type: Types.Name }
7 | ```
8 |
9 | ## Schema
10 |
11 | The name field adds `first` and `last` `String` paths to the schema, as well as a `full` virtual getter and setter.
12 |
13 | If it is updated with a string, it will split it into first and last name based on the first space.
14 |
15 | ### `first` `String`
16 | first name
17 |
18 | ### `last` `String`
19 | last name
20 |
21 | ## Virtuals
22 |
23 | ### `full` `String`
24 | first and last name, concatenated with a space (if both have a value).
25 | The `name.full` setter splits input at the first space.
26 |
--------------------------------------------------------------------------------
/fields/types/name/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../NameField'),
3 | Filter: require('../NameFilter'),
4 | section: 'Text',
5 | spec: {
6 | label: 'Name',
7 | path: 'name',
8 | paths: {
9 | first: 'name.first',
10 | last: 'name.last',
11 | },
12 | value: {
13 | first: 'Jed',
14 | last: 'Watson',
15 | },
16 | },
17 | };
18 |
--------------------------------------------------------------------------------
/fields/types/number/NumberField.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Field from '../Field';
3 | import { FormInput } from '../../../admin/client/App/elemental';
4 |
5 | module.exports = Field.create({
6 | displayName: 'NumberField',
7 | statics: {
8 | type: 'Number',
9 | },
10 | valueChanged (event) {
11 | var newValue = event.target.value;
12 | if (/^-?\d*\.?\d*$/.test(newValue)) {
13 | this.props.onChange({
14 | path: this.props.path,
15 | value: newValue,
16 | });
17 | }
18 | },
19 | renderField () {
20 | return (
21 |
28 | );
29 | },
30 | });
31 |
--------------------------------------------------------------------------------
/fields/types/number/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../NumberField'),
3 | Filter: require('../NumberFilter'),
4 | readme: require('fs').readFileSync('./fields/types/number/Readme.md', 'utf8'),
5 | section: 'Number',
6 | spec: {
7 | label: 'Number',
8 | path: 'text',
9 | value: 0,
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/numberarray/NumberArrayColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../../components/columns/ArrayColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/numberarray/NumberArrayField.js:
--------------------------------------------------------------------------------
1 | import ArrayFieldMixin from '../../mixins/ArrayField';
2 | import Field from '../Field';
3 |
4 | module.exports = Field.create({
5 |
6 | displayName: 'NumberArrayField',
7 | statics: {
8 | type: 'NumberArray',
9 | },
10 |
11 | mixins: [ArrayFieldMixin],
12 |
13 | isValid (input) {
14 | return /^-?\d*\.?\d*$/.test(input);
15 | },
16 |
17 | });
18 |
--------------------------------------------------------------------------------
/fields/types/numberarray/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../NumberArrayField'),
3 | Filter: require('../NumberArrayFilter'),
4 | section: 'Number',
5 | spec: {
6 | label: 'Numberarray',
7 | path: 'textarray',
8 | value: [4, 15, 2838],
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/fields/types/password/PasswordColumn.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ItemsTableCell from '../../components/ItemsTableCell';
3 | import ItemsTableValue from '../../components/ItemsTableValue';
4 |
5 | var PasswordColumn = React.createClass({
6 | displayName: 'PasswordColumn',
7 | propTypes: {
8 | col: React.PropTypes.object,
9 | data: React.PropTypes.object,
10 | },
11 | renderValue () {
12 | const value = this.props.data.fields[this.props.col.path];
13 | return value ? '********' : '';
14 | },
15 | render () {
16 | return (
17 |
18 |
19 | {this.renderValue()}
20 |
21 |
22 | );
23 | },
24 | });
25 |
26 | module.exports = PasswordColumn;
27 |
--------------------------------------------------------------------------------
/fields/types/password/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../PasswordField'),
3 | Filter: require('../PasswordFilter'),
4 | section: 'Miscellaneous',
5 | spec: {
6 | label: 'Password',
7 | path: 'password',
8 | paths: {
9 | confirm: 'password_confirm',
10 | },
11 | value: undefined,
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/fields/types/s3file/S3FileColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/s3file/S3FileField.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/s3file/S3FileFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = undefined;
2 |
--------------------------------------------------------------------------------
/fields/types/select/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../SelectField'),
3 | Filter: require('../SelectFilter'),
4 | readme: require('fs').readFileSync('./fields/types/select/Readme.md', 'utf8'),
5 | section: 'Miscellaneous',
6 | spec: [{
7 | label: 'Text Select',
8 | path: 'textSelect',
9 | ops: [
10 | { label: 'Caramel', value: 'caramel' },
11 | { label: 'Chocolate', value: 'chocolate' },
12 | { label: 'Strawberry', value: 'strawberry' },
13 | { label: 'Vanilla', value: 'vanilla' },
14 | ],
15 | value: 'chocolate',
16 | }, {
17 | label: 'Numeric Select',
18 | path: 'numericSelect',
19 | numeric: true,
20 | ops: [
21 | { label: 'One', value: 1 },
22 | { label: 'Two', value: 2 },
23 | { label: 'Three', value: 3 },
24 | ],
25 | value: 'chocolate',
26 | }],
27 | };
28 |
--------------------------------------------------------------------------------
/fields/types/text/TextField.js:
--------------------------------------------------------------------------------
1 | import Field from '../Field';
2 |
3 | module.exports = Field.create({
4 | displayName: 'TextField',
5 | statics: {
6 | type: 'Text',
7 | },
8 | });
9 |
--------------------------------------------------------------------------------
/fields/types/text/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../TextField'),
3 | Filter: require('../TextFilter'),
4 | readme: require('fs').readFileSync('./fields/types/text/Readme.md', 'utf8'),
5 | section: 'Text',
6 | spec: {
7 | label: 'Text',
8 | path: 'text',
9 | value: 'Hello World',
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/textarea/Readme.md:
--------------------------------------------------------------------------------
1 | # Textarea Field
2 |
3 | Stores a `String` in the model.
4 | Displayed as a textarea field in the Admin UI.
5 |
6 | ```js
7 | { type: Types.Textarea }
8 | ```
9 |
10 | ## Methods
11 |
12 | ### `format`
13 |
14 | Uses the `textToHTML()` method in [keystone-utils](https://github.com/keystonejs/keystone-utils#conversion-utilities) to convert the value to HTML.
15 |
16 | ## Options
17 |
18 | ### `height` `Number`
19 | the height of the field (in pixels)
20 |
21 | ### Inherits from [`Text`](../text)
22 |
23 | * `addFilterToQuery`
24 | * `crop`
25 | * `validateInput`
26 | * `validateRequiredInput`
27 |
28 | ## Filtering
29 |
30 | Uses the same logic and filter UI as the [`Text`](../text) field type.
31 |
--------------------------------------------------------------------------------
/fields/types/textarea/TextareaColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/textarea/TextareaFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/textarea/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../TextareaField'),
3 | Filter: require('../TextareaFilter'),
4 | readme: require('fs').readFileSync('./fields/types/textarea/Readme.md', 'utf8'),
5 | section: 'Text',
6 | spec: {
7 | label: 'Textarea',
8 | path: 'textarea',
9 | value: 'Hello World',
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/fields/types/textarray/TextArrayColumn.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../../components/columns/ArrayColumn');
2 |
--------------------------------------------------------------------------------
/fields/types/textarray/TextArrayField.js:
--------------------------------------------------------------------------------
1 | import ArrayFieldMixin from '../../mixins/ArrayField';
2 | import Field from '../Field';
3 |
4 | module.exports = Field.create({
5 | displayName: 'TextArrayField',
6 | statics: {
7 | type: 'TextArray',
8 | },
9 | mixins: [ArrayFieldMixin],
10 | });
11 |
--------------------------------------------------------------------------------
/fields/types/textarray/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require('../TextArrayField'),
3 | Filter: require('../TextArrayFilter'),
4 | section: 'Text',
5 | spec: {
6 | label: 'Textarray',
7 | path: 'textarray',
8 | value: ['Hello', 'World'],
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/fields/types/url/UrlFilter.js:
--------------------------------------------------------------------------------
1 | module.exports = require('../text/TextFilter');
2 |
--------------------------------------------------------------------------------
/fields/types/url/test/explorer.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | Field: require("../UrlField"),
3 | Filter: require("../UrlFilter"),
4 | readme: require("fs").readFileSync("./fields/types/url/Readme.md", "utf8"),
5 | section: "Text",
6 | spec: {
7 | label: "Url",
8 | path: "textarea",
9 | value: "http://keystonejs.com"
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/fields/utils/bindFunctions.js:
--------------------------------------------------------------------------------
1 | /*
2 | Tidier binding for component methods to Classes
3 | ===============================================
4 |
5 | constructor() {
6 | super();
7 | bindFunctions.call(this, ['handleClick', 'handleOther']);
8 | }
9 | */
10 | module.exports = function bindFunctions (functions) {
11 | functions.forEach(f => (this[f] = this[f].bind(this)));
12 | };
13 |
--------------------------------------------------------------------------------
/fields/utils/definePrototypeGetters.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines a getter on the Field prototype
3 | *
4 | * @param {string} key The key the getter should be at
5 | * @param {function} getter The getter itself
6 | */
7 | function definePrototypeGetter (Constructor, key, getter) {
8 | Object.defineProperty(Constructor.prototype, key, {
9 | get: getter,
10 | });
11 | }
12 |
13 | /**
14 | * Define multiple getters on the Field prototype at once
15 | *
16 | * @param {object} getterObj The getters with a getter at the key
17 | */
18 | function definePrototypeGetters (Constructor, getterObj) {
19 | Object.keys(getterObj).map(function (key) {
20 | definePrototypeGetter(Constructor, key, getterObj[key]);
21 | });
22 | }
23 |
24 | module.exports = definePrototypeGetters;
25 | module.definePrototypeGetter = definePrototypeGetter;
26 |
--------------------------------------------------------------------------------
/greenkeeper-prs/checkout.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | BRANCHES=`cat /dev/stdin`
3 | echo $BRANCHES
4 | for BRANCH in $BRANCHES
5 | do
6 | echo "Checking out $BRANCH"
7 | git checkout $BRANCH
8 | git merge master
9 | git commit -am 'merge in master'
10 | git push origin $BRANCH
11 | exit 1
12 | done
13 |
--------------------------------------------------------------------------------
/greenkeeper-prs/getbranches.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 | for BRANCH in $(git branch --all | grep remotes/origin/greenkeeper)
3 | do
4 | BRANCH_NAME=$(echo $BRANCH | sed "s/remotes\/origin\///g")
5 | echo $BRANCH_NAME
6 | done
7 | echo "%DONE%"
8 |
--------------------------------------------------------------------------------
/lib/content/type.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Type Class
3 | * @api private
4 | */
5 |
6 | var Type = function (path, options) { // eslint-disable-line no-unused-vars
7 | // TODO
8 | };
9 |
10 |
11 | /*!
12 | * Export class
13 | */
14 |
15 | module.exports = Type;
16 |
--------------------------------------------------------------------------------
/lib/content/types/html.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Module dependencies.
3 | */
4 |
5 | var util = require('util');
6 | var super_ = require('../type');
7 |
8 | /**
9 | * HTML ContentType Constructor
10 | * @extends Field
11 | * @api public
12 | */
13 |
14 | function html (path, options) {
15 | html.super_.call(path, options);
16 | }
17 |
18 | /*!
19 | * Inherit from Type
20 | */
21 |
22 | util.inherits(html, super_);
23 |
24 |
25 | /*!
26 | * Export class
27 | */
28 |
29 | module.exports = html;
30 |
--------------------------------------------------------------------------------
/lib/content/types/index.js:
--------------------------------------------------------------------------------
1 | exports.Text = require('./text');
2 | exports.Html = require('./html');
3 |
--------------------------------------------------------------------------------
/lib/content/types/text.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Module dependencies.
3 | */
4 |
5 | var util = require('util');
6 | var super_ = require('../type');
7 |
8 | /**
9 | * Text ContentType Constructor
10 | * @extends Field
11 | * @api public
12 | */
13 |
14 | function text (path, options) {
15 | text.super_.call(path, options);
16 | }
17 |
18 | /*!
19 | * Inherit from Type
20 | */
21 |
22 | util.inherits(text, super_);
23 |
24 |
25 | /*!
26 | * Export class
27 | */
28 |
29 | module.exports = text;
30 |
--------------------------------------------------------------------------------
/lib/core/closeDatabaseConnection.js:
--------------------------------------------------------------------------------
1 | var debug = require('debug')('keystone:core:closeDatabaseConnection');
2 |
3 | module.exports = function closeDatabaseConnection (callback) {
4 | this.mongoose.disconnect(function () {
5 | debug('mongo connection closed');
6 | callback && callback();
7 | });
8 | return this;
9 | };
10 |
--------------------------------------------------------------------------------
/lib/core/createKeystoneHash.js:
--------------------------------------------------------------------------------
1 | var crypto = require('crypto');
2 | var forEach = require('lodash/forEach');
3 |
4 | function createKeystoneHash () {
5 | var hash = crypto.createHash('md5');
6 | hash.update(this.version);
7 |
8 | forEach(this.lists, function (list, key) {
9 | hash.update(JSON.stringify(list.getOptions()));
10 | });
11 |
12 | return hash.digest('hex').slice(0, 6);
13 | }
14 |
15 | module.exports = createKeystoneHash;
16 |
--------------------------------------------------------------------------------
/lib/core/createRouter.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 |
3 | /*
4 | This is a shorthand method for keystone instances to create a new express
5 | router, to make it simpler for projects that don't directly depend on express
6 | */
7 | function createRouter () {
8 | return express.Router();
9 | }
10 |
11 | module.exports = createRouter;
12 |
--------------------------------------------------------------------------------
/lib/core/getOrphanedLists.js:
--------------------------------------------------------------------------------
1 | var _ = require('lodash');
2 |
3 | /**
4 | * Retrieves orphaned lists (those not in a nav section)
5 | */
6 |
7 | function getOrphanedLists () {
8 | if (!this.nav) {
9 | return [];
10 | }
11 | return _.filter(this.lists, function (list, key) {
12 | if (list.get('hidden')) return false;
13 | return (!this.nav.by.list[key]) ? list : false;
14 | }.bind(this));
15 | }
16 |
17 | module.exports = getOrphanedLists;
18 |
--------------------------------------------------------------------------------
/lib/core/init.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Initialises Keystone with the provided options
3 | */
4 |
5 | function init (options) {
6 | this.options(options);
7 | return this;
8 | }
9 |
10 | module.exports = init;
11 |
--------------------------------------------------------------------------------
/lib/core/initDatabaseConfig.js:
--------------------------------------------------------------------------------
1 | var utils = require('keystone-utils');
2 |
3 | module.exports = function initDatabaseConfig () {
4 | if (!this.get('mongo')) {
5 | var dbName = this.get('db name')
6 | || utils.slug(this.get('name'));
7 | var dbUrl = process.env.MONGO_URI
8 | || process.env.MONGODB_URI
9 | || process.env.MONGO_URL
10 | || process.env.MONGODB_URL
11 | || process.env.MONGOLAB_URI
12 | || process.env.MONGOLAB_URL
13 | || (process.env.OPENSHIFT_MONGODB_DB_URL
14 | || 'mongodb://localhost/') + dbName;
15 | this.set('mongo', dbUrl);
16 | }
17 | return this;
18 | };
19 |
--------------------------------------------------------------------------------
/lib/core/initExpressApp.js:
--------------------------------------------------------------------------------
1 | module.exports = function initExpressApp (customApp) {
2 | if (this.app) return this;
3 | this.initDatabaseConfig();
4 | this.initExpressSession(this.mongoose);
5 | if (customApp) {
6 | this.app = customApp;
7 | require('../../server/createApp')(this);
8 | } else {
9 | this.app = require('../../server/createApp')(this);
10 | }
11 | return this;
12 | };
13 |
--------------------------------------------------------------------------------
/lib/core/list.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Retrieves a list
3 | */
4 |
5 | module.exports = function list (key) {
6 | var result = this.lists[key] || this.lists[this.paths[key]];
7 | if (!result) throw new ReferenceError('Unknown keystone list ' + JSON.stringify(key));
8 | return result;
9 | };
10 |
--------------------------------------------------------------------------------
/lib/core/populateRelated.js:
--------------------------------------------------------------------------------
1 | var async = require('async');
2 |
3 | /**
4 | * Populates relationships on a document or array of documents
5 | *
6 | * WARNING: This is currently highly inefficient and should only be used in development, or for
7 | * small data sets. There are lots of things that can be done to improve performance... later.
8 | *
9 | * @api public
10 | */
11 |
12 | module.exports = function populateRelated (docs, relationships, callback) {
13 | if (Array.isArray(docs)) {
14 | async.each(docs, function (doc, done) {
15 | doc.populateRelated(relationships, done);
16 | }, callback);
17 | } else if (docs && docs.populateRelated) {
18 | docs.populateRelated(relationships, callback);
19 | } else {
20 | callback();
21 | }
22 | return this;
23 | };
24 |
--------------------------------------------------------------------------------
/lib/core/redirect.js:
--------------------------------------------------------------------------------
1 | var _ = require('lodash');
2 | var utils = require('keystone-utils');
3 |
4 | /**
5 | * Adds one or more redirections (urls that are redirected when no matching
6 | * routes are found, before treating the request as a 404)
7 | *
8 | * #### Example:
9 | * keystone.redirect('/old-route', 'new-route');
10 | *
11 | * // or
12 | *
13 | * keystone.redirect({
14 | * 'old-route': 'new-route'
15 | * });
16 | */
17 |
18 | function redirect () {
19 | if (arguments.length === 1 && utils.isObject(arguments[0])) {
20 | _.extend(this._redirects, arguments[0]);
21 | } else if (arguments.length === 2 && typeof arguments[0] === 'string' && typeof arguments[1] === 'string') {
22 | this._redirects[arguments[0]] = arguments[1];
23 | }
24 | return this;
25 | }
26 |
27 | module.exports = redirect;
28 |
--------------------------------------------------------------------------------
/lib/core/wrapHTMLError.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Wraps an error in simple HTML to be sent as a response to the browser
3 | *
4 | * @api public
5 | */
6 |
7 | function wrapHTMLError (title, err) {
8 | return 'Error'
9 | + ''
10 | + '' + title + '
'
11 | + '
' + (err || '') + '
';
12 | }
13 |
14 | module.exports = wrapHTMLError;
15 |
--------------------------------------------------------------------------------
/lib/list/automap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Checks to see if a field path matches a currently unmapped path, and
3 | * if so, adds a mapping for it.
4 | */
5 | function automap (field) {
6 | if ((field.path in this.mappings) && !this.mappings[field.path]) {
7 | this.map(field.path, field.path);
8 | }
9 | return this;
10 | }
11 |
12 | module.exports = automap;
13 |
--------------------------------------------------------------------------------
/lib/list/declaresTextIndex.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Look for a text index defined in the current list schema; returns boolean
3 | * Note this doesn't check for text indexes that exist in the DB
4 | */
5 |
6 | function declaresTextIndex () {
7 | var indexes = this.schema.indexes();
8 |
9 | for (var i = 0; i < indexes.length; i++) {
10 | var fields = indexes[i][0];
11 | var fieldNames = Object.keys(fields);
12 |
13 | for (var h = 0; h < fieldNames.length; h++) {
14 | var val = fields[fieldNames[h]];
15 | if (typeof val === 'string' && val.toLowerCase() === 'text') return true;
16 | }
17 | }
18 | return false;
19 | }
20 |
21 | module.exports = declaresTextIndex;
22 |
--------------------------------------------------------------------------------
/lib/list/expandPaths.js:
--------------------------------------------------------------------------------
1 | var listToArray = require('list-to-array');
2 |
3 | function expandPaths (paths) {
4 | return listToArray(paths).map(function (path) {
5 | if (path === '__name__') {
6 | path = this.mappings.name;
7 | }
8 | return {
9 | path: path,
10 | field: this.fields[path],
11 | };
12 | }, this);
13 | }
14 |
15 | module.exports = expandPaths;
16 |
--------------------------------------------------------------------------------
/lib/list/getAdminURL.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gets the Admin URL to view the list (or an item if provided)
3 | *
4 | * Example:
5 | * var listURL = list.getAdminURL()
6 | * var itemURL = list.getAdminURL(item)
7 | *
8 | * @param {Object} item
9 | */
10 | function getAdminURL (item) {
11 | return '/' + this.keystone.get('admin path') + '/' + this.path + (item ? '/' + item.id : '');
12 | }
13 |
14 | module.exports = getAdminURL;
15 |
--------------------------------------------------------------------------------
/lib/list/isReserved.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check whether or not a `path` is a reserved path. This restricts the use
3 | * of `Object.prototype` method keys as well as internal mongo paths.
4 | */
5 |
6 | var reservedPaths = [
7 | '_',
8 | '__defineGetter__',
9 | '__defineSetter__',
10 | '__lookupGetter__',
11 | '__lookupSetter__',
12 | '__proto__',
13 | '_id',
14 | 'hasOwnProperty',
15 | 'id',
16 | 'isPrototypeOf',
17 | 'list',
18 | 'propertyIsEnumerable',
19 | 'prototype',
20 | 'toLocaleString',
21 | 'toString',
22 | 'valueOf',
23 | ];
24 |
25 | function isReserved (path) {
26 | return reservedPaths.indexOf(path) >= 0;
27 | }
28 |
29 | module.exports = isReserved;
30 |
--------------------------------------------------------------------------------
/lib/list/map.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Maps a built-in field (e.g. name) to a specific path
3 | */
4 | function map (field, path) {
5 | if (path) {
6 | this.mappings[field] = path;
7 | }
8 | return this.mappings[field];
9 | }
10 |
11 | module.exports = map;
12 |
--------------------------------------------------------------------------------
/lib/list/processFilters.js:
--------------------------------------------------------------------------------
1 | var queryfilterlib = require('queryfilter');
2 |
3 | /**
4 | * Processes a filter string into a filters object
5 | *
6 | * NOTE: This function is deprecated in favor of List.prototype.addFiltersToQuery
7 | * and will be removed in a later version.
8 | *
9 | * @param {String} filters
10 | */
11 | function processFilters (q) {
12 | var list = this;
13 | var filters = {};
14 | queryfilterlib.QueryFilters.create(q).getFilters().forEach(function (filter) {
15 | filter.path = filter.key; // alias for b/c
16 | filter.field = list.fields[filter.key];
17 | filters[filter.path] = filter;
18 | });
19 | return filters;
20 | }
21 |
22 | module.exports = processFilters;
23 |
--------------------------------------------------------------------------------
/lib/list/selectColumns.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Specified select and populate options for a query based the provided columns.
3 | *
4 | * @param {Query} query
5 | * @param {Array} columns
6 | */
7 | function selectColumns (q, cols) {
8 | // Populate relationship columns
9 | var select = [];
10 | var populate = {};
11 | var path;
12 | cols.forEach(function (col) {
13 | select.push(col.path);
14 | if (col.populate) {
15 | if (!populate[col.populate.path]) {
16 | populate[col.populate.path] = [];
17 | }
18 | populate[col.populate.path].push(col.populate.subpath);
19 | }
20 | });
21 | q.select(select.join(' '));
22 | for (path in populate) {
23 | if (populate.hasOwnProperty(path)) {
24 | q.populate(path, populate[path].join(' '));
25 | }
26 | }
27 | }
28 |
29 | module.exports = selectColumns;
30 |
--------------------------------------------------------------------------------
/lib/list/set.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Gets and Sets list options. Aliased as .get()
3 | *
4 | * Example:
5 | * list.set('test') // returns the 'test' value
6 | * list.set('test', value) // sets the 'test' option to `value`
7 | */
8 | function set (key, value) {
9 | if (arguments.length === 1) {
10 | return this.options[key];
11 | }
12 | this.options[key] = value;
13 | return value;
14 | }
15 |
16 | module.exports = set;
17 |
--------------------------------------------------------------------------------
/lib/list/underscoreMethod.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Adds a method to the underscoreMethods collection on the list, which is then
3 | * added to the schema before the list is registered with mongoose.
4 | */
5 | function underscoreMethod (path, fn) {
6 | var target = this.underscoreMethods;
7 | path = path.split('.');
8 | var last = path.pop();
9 | path.forEach(function (part) {
10 | if (!target[part]) target[part] = {};
11 | target = target[part];
12 | });
13 | target[last] = fn;
14 | return this;
15 | }
16 |
17 | module.exports = underscoreMethod;
18 |
--------------------------------------------------------------------------------
/lib/middleware/language.js:
--------------------------------------------------------------------------------
1 | var requestLanguage = require('express-request-language');
2 | var assign = require('object-assign');
3 |
4 | module.exports = function (keystone) {
5 | var languageOptions = assign({
6 | 'supported languages': ['en-US'],
7 | 'language cookie': 'language',
8 | 'language cookie options': {},
9 | 'language select url': '/languages/{language}',
10 | }, keystone.get('language options'));
11 |
12 | return requestLanguage({
13 | languages: languageOptions['supported languages'],
14 | cookie: {
15 | name: languageOptions['language cookie'],
16 | url: languageOptions['language select url'],
17 | options: languageOptions['language cookie options'],
18 | },
19 | queryName: languageOptions['language query name'],
20 | });
21 | };
22 |
--------------------------------------------------------------------------------
/lib/safeRequire.js:
--------------------------------------------------------------------------------
1 | module.exports = function safeRequire (library, feature) {
2 | try {
3 | return require(library);
4 | } catch (error) {
5 | if (error.code === 'MODULE_NOT_FOUND') {
6 | console.error('\nTo use ' + feature + ' install ' + library);
7 | process.exit(1);
8 | return;
9 | }
10 |
11 | throw error;
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/lib/schemaPlugins.js:
--------------------------------------------------------------------------------
1 | exports.sortable = require('./schemaPlugins/sortable');
2 | exports.autokey = require('./schemaPlugins/autokey');
3 | exports.track = require('./schemaPlugins/track');
4 | exports.history = require('./schemaPlugins/history');
5 |
6 | exports.methods = {
7 | getRelated: require('./schemaPlugins/methods/getRelated'),
8 | populateRelated: require('./schemaPlugins/methods/populateRelated'),
9 | };
10 |
11 | exports.options = {
12 | transform: require('./schemaPlugins/options/transform'),
13 | };
14 |
--------------------------------------------------------------------------------
/lib/schemaPlugins/methods/populateRelated.js:
--------------------------------------------------------------------------------
1 | var _ = require('lodash');
2 |
3 | module.exports = function populateRelated (rel, callback) {
4 |
5 | var item = this;
6 |
7 | if (typeof callback !== 'function') {
8 | throw new Error('List.populateRelated(rel, callback) requires a callback function.');
9 | }
10 |
11 | this.getRelated(rel, function (err, results) {
12 | _.forEach(results, function (data, key) {
13 | item[key] = data;
14 | });
15 | callback(err, results);
16 | }, true);
17 |
18 | };
19 |
--------------------------------------------------------------------------------
/lib/schemaPlugins/options/transform.js:
--------------------------------------------------------------------------------
1 | var _ = require('lodash');
2 |
3 | module.exports = function transform (doc, ret) {
4 | if (doc._populatedRelationships) {
5 | _.forEach(doc._populatedRelationships, function (on, key) {
6 | if (!on) return;
7 | ret[key] = doc[key];
8 | });
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/lib/security/frameGuard.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Adds iframe protection headers to the response
3 | *
4 | * ####Example:
5 | *
6 | * app.use(keystone.security.frameGuard(keystone));
7 | *
8 | * @param {app.request} req
9 | * @param {app.response} res
10 | * @param {function} next
11 | * @api public
12 | */
13 |
14 | module.exports = function (keystone) {
15 | return function frameGuard (req, res, next) {
16 | var options = keystone.get('frame guard');
17 | if (options) {
18 | res.header('x-frame-options', options);
19 | }
20 | next();
21 | };
22 | };
23 |
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | # Global settings applied to the whole site.
2 | [build]
3 | base = "website"
4 | publish = "website/public"
5 | command = "gatsby build"
6 |
--------------------------------------------------------------------------------
/server/bindBodyParser.js:
--------------------------------------------------------------------------------
1 | var bodyParser = require('body-parser');
2 |
3 | var uploads = require('../lib/uploads');
4 |
5 | module.exports = function bindBodyParser (keystone, app) {
6 | // Set up body options and cookie parser
7 | var bodyParserParams = {};
8 | if (keystone.get('file limit')) {
9 | bodyParserParams.limit = keystone.get('file limit');
10 | }
11 | app.use(bodyParser.json(bodyParserParams));
12 | bodyParserParams.extended = true;
13 | app.use(bodyParser.urlencoded(bodyParserParams));
14 | if (keystone.get('handle uploads')) {
15 | uploads.configure(app, keystone.get('multer options'));
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/server/bindIPRestrictions.js:
--------------------------------------------------------------------------------
1 | var debug = require('debug')('keystone:server:bindIpRestrictions');
2 |
3 | module.exports = function bindIPRestrictions (keystone, app) {
4 | // Check for IP range restrictions
5 | if (keystone.get('allowed ip ranges')) {
6 | if (!app.get('trust proxy')) {
7 | console.log(
8 | 'KeystoneJS Initialisaton Error:\n\n'
9 | + 'to set IP range restrictions the "trust proxy" setting must be enabled.\n\n'
10 | );
11 | process.exit(1);
12 | }
13 | debug('adding IP ranges', keystone.get('allowed ip ranges'));
14 | app.use(require('../lib/security/ipRangeRestrict')(
15 | keystone.get('allowed ip ranges'),
16 | keystone.wrapHTMLError
17 | ));
18 | }
19 | };
20 |
--------------------------------------------------------------------------------
/server/bindLessMiddleware.js:
--------------------------------------------------------------------------------
1 | module.exports = function bindLessMiddleware (keystone, app) {
2 | // the less option can be a single path, or array of paths
3 | // when set, we configure the less middleware
4 | var lessPaths = keystone.get('less');
5 | var lessOptions = keystone.get('less options') || {};
6 |
7 | if (typeof lessPaths === 'string') {
8 | lessPaths = [lessPaths];
9 | }
10 |
11 | if (Array.isArray(lessPaths)) {
12 | lessPaths.forEach(function (path) {
13 | app.use(require('less-middleware')(keystone.expandPath(path), lessOptions));
14 | });
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/server/bindRedirectsHandler.js:
--------------------------------------------------------------------------------
1 | module.exports = function bindErrorHandlers (keystone, app) {
2 | if (Object.keys(keystone._redirects).length) {
3 | app.use(function (req, res, next) {
4 | if (keystone._redirects[req.path]) {
5 | res.redirect(keystone._redirects[req.path]);
6 | } else {
7 | next();
8 | }
9 | });
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/server/bindSessionMiddleware.js:
--------------------------------------------------------------------------------
1 | module.exports = function bindSessionMiddleware (keystone, app) {
2 |
3 | app.use(keystone.get('session options').cookieParser);
4 |
5 | // pre:session hooks
6 | if (typeof keystone.get('pre:session') === 'function') {
7 | keystone.get('pre:session')(app);
8 | }
9 | app.use(function (req, res, next) {
10 | keystone.callHook('pre:session', req, res, next);
11 | });
12 |
13 | app.use(keystone.expressSession);
14 | app.use(require('connect-flash')());
15 |
16 | if (keystone.get('session') === true) {
17 | app.use(keystone.session.persist);
18 | } else if (typeof keystone.get('session') === 'function') {
19 | app.use(keystone.get('session'));
20 | }
21 |
22 | };
23 |
--------------------------------------------------------------------------------
/server/bindStaticMiddleware.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 |
3 | module.exports = function bindStaticMiddleware (keystone, app) {
4 | // the static option can be a single path, or array of paths
5 | // when set, we configure the express static middleware
6 |
7 | var staticPaths = keystone.get('static');
8 | var staticOptions = keystone.get('static options');
9 |
10 | if (typeof staticPaths === 'string') {
11 | staticPaths = [staticPaths];
12 | }
13 |
14 | if (Array.isArray(staticPaths)) {
15 | staticPaths.forEach(function (value) {
16 | app.use(express.static(keystone.expandPath(value), staticOptions));
17 | });
18 | }
19 | };
20 |
--------------------------------------------------------------------------------
/server/initSslRedirect.js:
--------------------------------------------------------------------------------
1 | module.exports = function (keystone, app) {
2 | var portString;
3 | function sslRedirect (req, res, next) {
4 | if (req.secure) {
5 | next();
6 | } else {
7 | // Don't redirect connections from localhost
8 | if (req.ip === '127.0.0.1') {
9 | return next();
10 | } else {
11 | res.redirect(302, 'https://' + req.hostname + portString + req.originalUrl);
12 | }
13 | }
14 | };
15 |
16 | if (keystone.get('ssl') === 'force') {
17 | var port = keystone.get('ssl public port') || keystone.get('ssl port');
18 | if (Number(port) === 443) {
19 | portString = '';
20 | } else {
21 | portString = ':' + port;
22 | }
23 | app.use(sslRedirect);
24 | }
25 | };
26 |
--------------------------------------------------------------------------------
/server/initTrustProxy.js:
--------------------------------------------------------------------------------
1 | module.exports = function initTrustProxy (keystone, app) {
2 | // Process 'X-Forwarded-For' request header
3 | if (keystone.get('trust proxy') === true) {
4 | app.enable('trust proxy');
5 | } else {
6 | app.disable('trust proxy');
7 | }
8 | };
9 |
--------------------------------------------------------------------------------
/server/initViewEngine.js:
--------------------------------------------------------------------------------
1 | module.exports = function initViewEngine (keystone, app) {
2 | // Allow usage of custom view engines
3 | if (keystone.get('custom engine')) {
4 | app.engine(keystone.get('view engine'), keystone.get('custom engine'));
5 | }
6 |
7 | // Set location of view templates and view engine
8 | app.set('views', keystone.getPath('views') || 'views');
9 | app.set('view engine', keystone.get('view engine'));
10 |
11 | var customView = keystone.get('view');
12 | if (customView) {
13 | app.set('view', customView);
14 | }
15 | };
16 |
--------------------------------------------------------------------------------
/server/initViewLocals.js:
--------------------------------------------------------------------------------
1 | var assign = require('object-assign');
2 |
3 | module.exports = function initViewLocals (keystone, app) {
4 | // Apply locals
5 | if (typeof keystone.get('locals') === 'object') {
6 | assign(app.locals, keystone.get('locals'));
7 | }
8 |
9 | // Default "pretty html" mode except in production
10 | // Only if it has not been specified in the locals setting
11 | if (app.locals.pretty === undefined && keystone.get('env') !== 'production') {
12 | app.locals.pretty = true;
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/server/startSocketServer.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Configures and starts express server.
3 | *
4 | * Events are fired during initialisation to allow customisation, including:
5 | * - onSocketServerCreated
6 | *
7 | * consumed by lib/core/start.js
8 | *
9 | * @api private
10 | */
11 |
12 | var fs = require('fs');
13 |
14 | module.exports = function (keystone, app, callback) {
15 |
16 | var unixSocket = keystone.get('unix socket');
17 | var message = keystone.get('name') + ' is ready on ' + unixSocket;
18 |
19 | fs.unlink(unixSocket, function () {
20 | // we expect err if the file is new so don't capture the argument
21 | keystone.httpServer = app.listen(unixSocket, function (err) {
22 | callback(err, message);
23 | });
24 | fs.chmod(unixSocket, 0x777);
25 | });
26 |
27 | };
28 |
--------------------------------------------------------------------------------
/test/e2e/adminUI/tests/group001Login/uiTestSigninView.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | before: function (browser) {
3 | browser.adminUIApp = browser.page.adminUIApp();
4 | browser.adminUISigninScreen = browser.page.adminUISignin();
5 |
6 | browser.adminUIApp.gotoSigninScreen();
7 | },
8 | after: function (browser) {
9 | browser.end();
10 | },
11 | 'Signin page should show correctly': function (browser) {
12 | browser.adminUISigninScreen.assertUI();
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/test/e2e/adminUI/tests/group001Login/uxTestSigninRedirect.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | before: function (browser) {
3 | browser.adminUIApp = browser.page.adminUIApp();
4 | browser.adminUISigninScreen = browser.page.adminUISignin();
5 |
6 | browser.url(browser.adminUIApp.url + 'users');
7 | browser.adminUIApp.waitForSigninScreen();
8 | browser.assert.urlEquals(browser.adminUIApp.url + 'signin?from=/keystone/users');
9 | },
10 | after: function (browser) {
11 | browser.
12 | end();
13 | },
14 | 'AdminUI should allow users to login and redirect to custom url': function (browser) {
15 | browser.adminUISigninScreen.signin({wait: false});
16 | browser.adminUIApp.waitForListScreen();
17 | browser.assert.urlEquals(browser.adminUIApp.url + 'users');
18 | },
19 | };
20 |
--------------------------------------------------------------------------------
/test/e2e/adminUI/tests/group001Login/uxTestSigninView.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | before: function (browser) {
3 | browser.adminUIApp = browser.page.adminUIApp();
4 | browser.adminUISigninScreen = browser.page.adminUISignin();
5 |
6 | browser.adminUIApp.gotoSigninScreen();
7 | },
8 | after: function (browser) {
9 | browser.end();
10 | },
11 | 'Signin page should allow users to login': function (browser) {
12 | browser.adminUISigninScreen.signin();
13 | browser.adminUIApp.assertElementIsVisible({ element: '@homeScreen' });
14 | },
15 | 'Signin page should be presented upon signout': function (browser) {
16 | browser.adminUIApp.signout();
17 | browser.adminUIApp.assertElementIsVisible({ element: '@signinScreen' });
18 | },
19 | };
20 |
--------------------------------------------------------------------------------
/test/e2e/adminUI/tests/group006Fields/commonFieldTestUtils.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | before: function (browser) {
3 | browser.adminUIApp = browser.page.adminUIApp();
4 | browser.adminUISigninScreen = browser.page.adminUISignin();
5 | browser.adminUIListScreen = browser.page.adminUIListScreen();
6 | browser.adminUIItemScreen = browser.page.adminUIItemScreen();
7 | browser.adminUIInitialFormScreen = browser.page.adminUIInitialForm();
8 |
9 | browser.adminUIApp.gotoSigninScreen();
10 | browser.adminUISigninScreen.signin();
11 | },
12 | after: function (browser) {
13 | browser.adminUIApp.signout();
14 | browser.end();
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/test/e2e/adminuiCustom/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/test/e2e/adminuiCustom/favicon.ico
--------------------------------------------------------------------------------
/test/e2e/adminuiCustom/styles.less:
--------------------------------------------------------------------------------
1 | @import "variables";
2 |
3 | nav.primary-navbar {
4 | background-color: green;
5 | }
6 |
--------------------------------------------------------------------------------
/test/e2e/adminuiCustom/variables.less:
--------------------------------------------------------------------------------
1 | @primary-navbar-bg: green;
2 | @secondary-navbar-bg: lightgreen;
3 |
--------------------------------------------------------------------------------
/test/e2e/drivers/chrome/linux32/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/test/e2e/drivers/chrome/linux32/.empty
--------------------------------------------------------------------------------
/test/e2e/drivers/chrome/linux64/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/test/e2e/drivers/chrome/linux64/.empty
--------------------------------------------------------------------------------
/test/e2e/drivers/chrome/mac32/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/test/e2e/drivers/chrome/mac32/.empty
--------------------------------------------------------------------------------
/test/e2e/drivers/chrome/win32/.empty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/test/e2e/drivers/chrome/win32/.empty
--------------------------------------------------------------------------------
/test/e2e/frontend/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | test frontend
8 |
9 |
10 |
11 |
12 |
13 |
14 | Hello Keystoner!
15 | Welcome to the e2e test front page...make sure they all pass :=)
16 | Goto the Admin UI
17 | Admin UI Login Info:
18 | Email: user@test.e2e
19 | Password: test
20 |
21 |
22 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/CloudinaryImageModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var CloudinaryImageFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'CloudinaryImageFieldTestObject'));
5 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
6 |
7 | module.exports = function CloudinaryImageModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new CloudinaryImageFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new CloudinaryImageFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/CodeModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var CodeFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'CodeFieldTestObject'));
5 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
6 |
7 | module.exports = function CodeModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new CodeFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new CodeFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/ColorModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var ColorFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'ColorFieldTestObject'));
6 |
7 | module.exports = function ColorModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new ColorFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new ColorFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/DateArrayModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var DateArrayFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'DateArrayFieldTestObject'));
6 |
7 | module.exports = function DateArrayModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new DateArrayFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new DateArrayFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/DateModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var DateFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'DateFieldTestObject'));
6 |
7 | module.exports = function DateModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new DateFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new DateFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/DatetimeModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var DatetimeFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'DatetimeFieldTestObject'));
6 |
7 | module.exports = function DatetimeModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new DatetimeFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new DatetimeFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/EmailModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var EmailFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'EmailFieldTestObject'));
6 |
7 | module.exports = function EmailModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new EmailFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new EmailFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/FileModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var FileFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'FileFieldTestObject'));
6 |
7 | module.exports = function FileModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new FileFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new FileFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/GeoPointModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var GeoPointFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'GeoPointFieldTestObject'));
6 |
7 | module.exports = function GeoPointModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new GeoPointFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new GeoPointFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/HtmlModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var HtmlFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'HtmlFieldTestObject'));
6 |
7 | module.exports = function HtmlModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new HtmlFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new HtmlFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/KeyModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var KeyFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'KeyFieldTestObject'));
6 |
7 | module.exports = function KeyModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new KeyFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new KeyFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/LocationModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var LocationFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'LocationFieldTestObject'));
6 |
7 | module.exports = function LocationModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new LocationFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new LocationFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/NameModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var NameFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'NameFieldTestObject'));
5 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
6 |
7 | module.exports = function NameModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new NameFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new NameFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/NumberArrayModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var NumberArrayFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'NumberArrayFieldTestObject'));
6 |
7 | module.exports = function NumberArrayModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new NumberArrayFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new NumberArrayFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/NumberModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var NumberFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'NumberFieldTestObject'));
6 |
7 | module.exports = function NumberModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new NumberFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new NumberFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/RelationshipModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var RelationshipFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'RelationshipFieldTestObject'));
6 |
7 | module.exports = function RelationshipModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new RelationshipFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new RelationshipFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/SelectModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var SelectFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'SelectFieldTestObject'));
5 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
6 |
7 | module.exports = function SelectModelTestConfig(config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new SelectFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new SelectFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/TextArrayModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var TextArrayFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextArrayFieldTestObject'));
6 |
7 | module.exports = function TextArrayModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new TextArrayFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new TextArrayFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/TextModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 |
6 | module.exports = function TextModelTestConfig (config) {
7 | return {
8 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
9 | fieldA: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
10 | fieldB: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/TextareaModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var TextareaFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextareaFieldTestObject'));
6 |
7 | module.exports = function TextareaModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new TextareaFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new TextareaFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/modelTestConfig/UrlModelTestConfig.js:
--------------------------------------------------------------------------------
1 | var objectAssign = require('object-assign');
2 | var fieldTestObjectsPath = require('keystone-nightwatch-e2e').fieldTestObjectsPath;
3 | var path = require('path');
4 | var TextFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'TextFieldTestObject'));
5 | var UrlFieldTestObject = require(path.resolve(fieldTestObjectsPath, 'UrlFieldTestObject'));
6 |
7 | module.exports = function UrlModelTestConfig (config) {
8 | return {
9 | name: new TextFieldTestObject(objectAssign({}, config, {fieldName: 'name'})),
10 | fieldA: new UrlFieldTestObject(objectAssign({}, config, {fieldName: 'fieldA'})),
11 | fieldB: new UrlFieldTestObject(objectAssign({}, config, {fieldName: 'fieldB'})),
12 | };
13 | };
14 |
--------------------------------------------------------------------------------
/test/e2e/models/Member.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../index.js');
2 | var User = require('./User');
3 |
4 | var Member = new keystone.List('Member', {
5 | inherits: User,
6 | track: true,
7 | });
8 |
9 | Member.register();
10 |
11 | module.exports = Member;
12 |
--------------------------------------------------------------------------------
/test/e2e/models/OtherList.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var OtherList = new keystone.List('OtherList', {
5 | autokey: {path: 'key', from: 'name', unique: true},
6 | track: true
7 | });
8 |
9 | OtherList.add({
10 | name: {
11 | type: Types.Name,
12 | required: true,
13 | index: true
14 | },
15 | });
16 |
17 | OtherList.defaultColumns = 'name';
18 | OtherList.register();
19 |
20 | module.exports = OtherList;
21 |
--------------------------------------------------------------------------------
/test/e2e/models/SelectFieldOnInitial.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var SelectFieldOnInitial = new keystone.List('SelectFieldOnInitial', {
5 | autokey: {path: 'key', from: 'name', unique: true},
6 | track: true
7 | });
8 |
9 | SelectFieldOnInitial.add({
10 | name: {
11 | type: String,
12 | required: true,
13 | index: true
14 | },
15 | type: {
16 | type: Types.Select,
17 | options: 'Pizza, Burger, Hot Dog',
18 | required: true,
19 | initial: true,
20 | noedit: true,
21 | label: "Food Type",
22 | index: true
23 | },
24 | });
25 |
26 | SelectFieldOnInitial.defaultColumns = 'name, type';
27 | SelectFieldOnInitial.register();
28 |
29 | module.exports = SelectFieldOnInitial;
30 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/CloudinaryImage.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var CloudinaryImage = new keystone.List('CloudinaryImage', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | CloudinaryImage.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.CloudinaryImage,
22 | },
23 | fieldB: {
24 | type: Types.CloudinaryImage,
25 | },
26 | });
27 |
28 | CloudinaryImage.defaultColumns = 'name, fieldA, fieldB';
29 | CloudinaryImage.register();
30 |
31 | module.exports = CloudinaryImage;
32 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/CloudinaryImageMultiple.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var CloudinaryImageMultiple = new keystone.List('CloudinaryImageMultiple', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | CloudinaryImageMultiple.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.CloudinaryImages,
22 | },
23 | fieldB: {
24 | type: Types.CloudinaryImages,
25 | },
26 | });
27 |
28 | CloudinaryImageMultiple.defaultColumns = 'name, fieldA, fieldB';
29 | CloudinaryImageMultiple.register();
30 |
31 | module.exports = CloudinaryImageMultiple;
32 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Code.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Code = new keystone.List('Code', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Code.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Code,
22 | initial: true,
23 | height: 200,
24 | },
25 | fieldB: {
26 | type: Types.Code,
27 | height: 200,
28 | },
29 | });
30 |
31 | Code.defaultColumns = 'name, fieldA, fieldB';
32 | Code.register();
33 |
34 | module.exports = Code;
35 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Color.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Color = new keystone.List('Color', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Color.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Color,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Color,
26 | },
27 | });
28 |
29 | Color.defaultColumns = 'name, fieldA, fieldB';
30 | Color.register();
31 |
32 | module.exports = Color;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Date.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Date = new keystone.List('Date', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Date.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Date,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Date,
26 | },
27 | });
28 |
29 | Date.defaultColumns = 'name, fieldA, fieldB';
30 | Date.register();
31 |
32 | module.exports = Date;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/DateArray.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var DateArray = new keystone.List('DateArray', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | DateArray.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.DateArray,
22 | },
23 | fieldB: {
24 | type: Types.DateArray,
25 | },
26 | });
27 |
28 | DateArray.defaultColumns = 'name, fieldA, fieldB';
29 | DateArray.register();
30 |
31 | module.exports = DateArray;
32 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Datetime.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Datetime = new keystone.List('Datetime', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Datetime.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Datetime,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Datetime,
26 | },
27 | });
28 |
29 | Datetime.defaultColumns = 'name, fieldA, fieldB';
30 | Datetime.register();
31 |
32 | module.exports = Datetime;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Email.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Email = new keystone.List('Email', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Email.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Email,
22 | initial: true,
23 | index: true,
24 | },
25 | fieldB: {
26 | type: Types.Email,
27 | index: true,
28 | },
29 | });
30 |
31 | Email.defaultColumns = 'name, fieldA, fieldB';
32 | Email.register();
33 |
34 | module.exports = Email;
35 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/GeoPoint.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var GeoPoint = new keystone.List('GeoPoint', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | GeoPoint.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.GeoPoint,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.GeoPoint,
26 | },
27 | });
28 |
29 | GeoPoint.defaultColumns = 'name, fieldA, fieldB';
30 | GeoPoint.register();
31 |
32 | module.exports = GeoPoint;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Html.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Html = new keystone.List('Html', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Html.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Html,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Html,
26 | },
27 | });
28 |
29 | Html.defaultColumns = 'name, fieldA, fieldB';
30 | Html.register();
31 |
32 | module.exports = Html;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Key.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Key = new keystone.List('Key', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Key.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Key,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Key,
26 | },
27 | });
28 |
29 | Key.defaultColumns = 'name, fieldA, fieldB';
30 | Key.register();
31 |
32 | module.exports = Key;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Location.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Location = new keystone.List('Location', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Location.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Location,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Location,
26 | },
27 | });
28 |
29 | Location.defaultColumns = 'name, fieldA, fieldB';
30 | Location.register();
31 |
32 | module.exports = Location;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Markdown.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Markdown = new keystone.List('Markdown', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Markdown.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Markdown,
22 | initial: true,
23 | height: 200,
24 | },
25 | fieldB: {
26 | type: Types.Markdown,
27 | height: 200,
28 | },
29 | });
30 |
31 | Markdown.defaultColumns = 'name, fieldA, fieldB';
32 | Markdown.register();
33 |
34 | module.exports = Markdown;
35 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Money.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Money = new keystone.List('Money', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Money.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Money,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Money,
26 | },
27 | });
28 |
29 | Money.defaultColumns = 'name, fieldA, fieldB';
30 | Money.register();
31 |
32 | module.exports = Money;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Name.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Name = new keystone.List('Name', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Name.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Name,
22 | initial: true,
23 | index: true,
24 | },
25 | fieldB: {
26 | type: Types.Name,
27 | index: true,
28 | },
29 | });
30 |
31 | Name.defaultColumns = 'name, fieldA, fieldB';
32 | Name.register();
33 |
34 | module.exports = Name;
35 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Number.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Num = new keystone.List('Number', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true
11 | });
12 |
13 | Num.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Number,
22 | initial: true,
23 | index: true,
24 | },
25 | fieldB: {
26 | type: Number,
27 | index: true
28 | }
29 | });
30 |
31 | Num.defaultColumns = 'name, fieldA, fieldB';
32 | Num.register();
33 |
34 | module.exports = Num;
35 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/NumberArray.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var NumberArray = new keystone.List('NumberArray', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | NumberArray.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.NumberArray,
22 | },
23 | fieldB: {
24 | type: Types.NumberArray,
25 | },
26 | });
27 |
28 | NumberArray.defaultColumns = 'name, fieldA, fieldB';
29 | NumberArray.register();
30 |
31 | module.exports = NumberArray;
32 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Password.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Password = new keystone.List('Password', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Password.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Password,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Password,
26 | },
27 | });
28 |
29 | Password.defaultColumns = 'name, fieldA, fieldB';
30 | Password.register();
31 |
32 | module.exports = Password;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Relationship.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Relationship = new keystone.List('Relationship', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Relationship.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Relationship,
22 | ref: 'User',
23 | inline: true,
24 | initial: true,
25 | },
26 | fieldB: {
27 | type: Types.Relationship,
28 | ref: 'User',
29 | },
30 | });
31 |
32 | Relationship.defaultColumns = 'name, fieldA, fieldB';
33 | Relationship.register();
34 |
35 | module.exports = Relationship;
36 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Select.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Select = new keystone.List('Select', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Select.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | index: true,
18 | },
19 | fieldA: {
20 | type: Types.Select,
21 | options: 'one, two, three',
22 | initial: true,
23 | required: true,
24 | index: true,
25 | },
26 | fieldB: {
27 | type: Types.Select,
28 | numeric: true,
29 | options: [
30 | { value: 1, label: 'One' },
31 | { value: 2, label: 'Two' },
32 | ]},
33 | });
34 |
35 | Select.defaultColumns = 'name, fieldA, fieldB';
36 | Select.register();
37 |
38 | module.exports = Select;
39 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Text.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Text = new keystone.List('Text', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Text.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Text,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Text,
26 | },
27 | });
28 |
29 | Text.defaultColumns = 'name, fieldA, fieldB';
30 | Text.register();
31 |
32 | module.exports = Text;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/TextArray.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var TextArray = new keystone.List('TextArray', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | TextArray.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.TextArray,
22 | },
23 | fieldB: {
24 | type: Types.TextArray,
25 | },
26 | });
27 |
28 | TextArray.defaultColumns = 'name, fieldA, fieldB';
29 | TextArray.register();
30 |
31 | module.exports = TextArray;
32 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Textarea.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Textarea = new keystone.List('Textarea', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Textarea.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Textarea,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Textarea,
26 | },
27 | });
28 |
29 | Textarea.defaultColumns = 'name, fieldA, fieldB';
30 | Textarea.register();
31 |
32 | module.exports = Textarea;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/fields/Url.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var Url = new keystone.List('Url', {
5 | autokey: {
6 | path: 'key',
7 | from: 'name',
8 | unique: true,
9 | },
10 | track: true,
11 | });
12 |
13 | Url.add({
14 | name: {
15 | type: String,
16 | initial: true,
17 | required: true,
18 | index: true,
19 | },
20 | fieldA: {
21 | type: Types.Url,
22 | initial: true,
23 | },
24 | fieldB: {
25 | type: Types.Url,
26 | },
27 | });
28 |
29 | Url.defaultColumns = 'name, fieldA, fieldB';
30 | Url.register();
31 |
32 | module.exports = Url;
33 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/DateFieldMap.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | // Model to demonstrate issue #2929
5 |
6 | var DateFieldMap = new keystone.List('DateFieldMap', {
7 | map: { name: 'datefield' },
8 | });
9 |
10 | DateFieldMap.add({
11 | datefield: { type: Types.Date, initial: true },
12 | });
13 |
14 | DateFieldMap.register();
15 | DateFieldMap.defaultColumns = 'datefield';
16 |
17 | module.exports = DateFieldMap;
18 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/DependsOn.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | // Model to demonstrate issue #2929
5 |
6 | var DependsOn = new keystone.List('DependsOn', {
7 | autokey: {
8 | path: 'key',
9 | from: 'name',
10 | unique: true,
11 | },
12 | track: true,
13 | });
14 |
15 | DependsOn.add({
16 | dependency: { type: Boolean, initial: true, default: false },
17 | dependent:
18 | {
19 | type: Types.Select,
20 | options: ['spam', 'ham'],
21 | initial: true,
22 | dependsOn: { dependency: false }
23 | }
24 | });
25 |
26 | DependsOn.register();
27 |
28 | module.exports = DependsOn;
29 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/HiddenRelationship.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var HiddenRelationship = new keystone.List('HiddenRelationship');
5 |
6 | HiddenRelationship.add({
7 | fieldA: { type: Types.Relationship, ref: 'User', initial: true, hidden: true },
8 | });
9 |
10 | HiddenRelationship.register();
11 | module.exports = HiddenRelationship;
12 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/InlineRelationship.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var InlineRelationship = new keystone.List('InlineRelationship');
5 |
6 | InlineRelationship.add({
7 | fieldA: { type: Types.Relationship, ref: 'User', createInline: true },
8 | });
9 |
10 | InlineRelationship.register();
11 | module.exports = InlineRelationship;
12 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/InvalidDefaultColumn.js:
--------------------------------------------------------------------------------
1 | // THIS MODEL IS USED TO MAKE SURE INVALID DEFAULT COLUMNS ARE PROPERLY WARNED ABOUT
2 | var keystone = require('../../../../index');
3 |
4 | var InvalidDefaultColumn = new keystone.List('InvalidDefaultColumn');
5 |
6 | // THIS SHOULD CAUSE THE FOLLOWING WARNING TO BE GENERATED IN THE ADMIN UI CONSOLE:
7 | // 'List InvalidDefaultColumn specified an invalid default column: bar'
8 | InvalidDefaultColumn.add({
9 | foo: {type: String}
10 | });
11 |
12 | InvalidDefaultColumn.defaultColumns = 'bar';
13 | InvalidDefaultColumn.register();
14 |
15 | module.exports = InvalidDefaultColumn;
16 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/ManyRelationship.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var ManyRelationship = new keystone.List('ManyRelationship');
5 |
6 | ManyRelationship.add({
7 | name: { type: String, initial: true, index: true },
8 | fieldA: { type: Types.Relationship, ref: 'Text', initial: true, many: true },
9 | });
10 |
11 | ManyRelationship.register();
12 | module.exports = ManyRelationship;
13 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/NoDefaultColumn.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | var NoDefaultColumn = new keystone.List('NoDefaultColumn', {
5 | track: true,
6 | });
7 |
8 | NoDefaultColumn.add({
9 | fieldA: {
10 | type: Types.Text,
11 | initial: true,
12 | },
13 | fieldB: {
14 | type: Types.Text,
15 | },
16 | });
17 |
18 | NoDefaultColumn.register();
19 |
20 | module.exports = NoDefaultColumn;
21 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/SourceRelationship.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index');
2 | var Types = keystone.Field.Types;
3 |
4 | var SourceRelationship = new keystone.List('SourceRelationship');
5 |
6 | SourceRelationship.add({
7 | name: {
8 | type: String,
9 | initial: true,
10 | },
11 | fieldA: {
12 | type: Types.Relationship,
13 | ref: 'TargetRelationship'
14 | },
15 | });
16 |
17 | SourceRelationship.register();
18 | SourceRelationship.defaultColumns = 'name, fieldA';
19 |
20 | module.exports = SourceRelationship;
21 |
--------------------------------------------------------------------------------
/test/e2e/models/misc/TargetRelationship.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../../../index');
2 | var Types = keystone.Field.Types;
3 |
4 | var TargetRelationship = new keystone.List('TargetRelationship');
5 |
6 | TargetRelationship.add({
7 | name: {
8 | type: String,
9 | initial: true,
10 | },
11 | });
12 |
13 | TargetRelationship.relationship({
14 | ref: 'SourceRelationship',
15 | refPath: 'fieldA',
16 | path: 'sourceFieldA'
17 | });
18 |
19 | TargetRelationship.register();
20 | TargetRelationship.defaultColumns = 'name';
21 |
22 | module.exports = TargetRelationship;
23 |
--------------------------------------------------------------------------------
/test/e2e/routes/index.js:
--------------------------------------------------------------------------------
1 | module.exports = function(app) {
2 | app.get('/', function (req, res) {
3 | res.render('index');
4 | });
5 | };
6 |
--------------------------------------------------------------------------------
/test/e2e/updates/0.0.1-updates-e2e.js:
--------------------------------------------------------------------------------
1 | /*
2 | This updates finds the e2e User and sets its properties, including setting the isAdmin property to true.
3 | e2e will check that setting in the admin UI.
4 | */
5 | exports.options = {
6 | verbose: true,
7 | strict: true
8 | };
9 |
10 | exports.create = {
11 | User: [{
12 | 'name.first': 'e2e',
13 | 'name.last': 'user',
14 | 'name.full': 'e2e user',
15 | email: 'user@test.e2e',
16 | password: 'test',
17 | isAdmin: true,
18 | __ref: 'e2e_user'
19 | },
20 | {
21 | 'name.first': 'e2e',
22 | 'name.last': 'member',
23 | 'name.full': 'e2e member',
24 | email: 'member@test.e2e',
25 | password: 'test',
26 | isAdmin: true,
27 | isMember: true,
28 | __ref: 'e2e_member'
29 | }],
30 | };
31 |
--------------------------------------------------------------------------------
/test/e2e/updates/0.0.2-updates-e2e.js:
--------------------------------------------------------------------------------
1 | /*
2 | This updates finds the e2e Member and sets its isAdmin property to false.
3 | e2e will check that setting in the admin UI.
4 | */
5 | var keystone = require('../../../index.js');
6 |
7 | module.exports = function(done) {
8 | var Member = keystone.list('User');
9 | Member.model.findOneAndUpdate({isMember: true}, {$set: {isAdmin: false}}, {new: true}).exec(function (err, member) {
10 | if (!err && member) {
11 | //console.log("***updated member: " + JSON.stringify(member.id));
12 | //console.log("***member is admin: " + JSON.stringify(member.isAdmin));
13 | } else if (err) {
14 | console.error("***failed to read member: "+ err);
15 | } else if (!member) {
16 | console.error("***did not find a member");
17 | }
18 | done(err);
19 | });
20 | };
21 |
--------------------------------------------------------------------------------
/test/helpers/getExpressApp.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../index.js');
2 | var mongoose = require('./getMongooseConnection.js');
3 | var methodOverride = require('method-override');
4 | var bodyParser = require('body-parser');
5 |
6 | function getExpressApp() {
7 | var app;
8 |
9 | keystone.init({
10 | 'mongoose': mongoose
11 | });
12 | app = keystone.express();
13 |
14 | app.use(bodyParser.json());
15 | app.use(bodyParser.urlencoded({
16 | extended: true
17 | }));
18 | app.use(methodOverride());
19 |
20 | return app;
21 | }
22 |
23 | module.exports = getExpressApp;
24 |
--------------------------------------------------------------------------------
/test/helpers/getMongooseConnection.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 |
3 | module.exports = mongoose.connect('mongodb://localhost/test');
4 |
--------------------------------------------------------------------------------
/test/helpers/removeModel.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 |
3 | module.exports = function removeModel(modelName) {
4 | delete mongoose.models[modelName];
5 | delete mongoose.modelSchemas[modelName];
6 | };
7 |
--------------------------------------------------------------------------------
/test/mocha-admin.opts:
--------------------------------------------------------------------------------
1 | admin/**/*.test.js
2 | --require @babel/polyfill
3 | --reporter spec
4 | --compilers js:@babel/register
5 |
--------------------------------------------------------------------------------
/test/mocha.opts:
--------------------------------------------------------------------------------
1 | test/unit
2 | --recursive
3 | --require must
4 | --reporter progress
5 |
--------------------------------------------------------------------------------
/test/models/DependsOn.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../index.js');
2 | var Types = keystone.Field.Types;
3 |
4 | // Simple model
5 | var DependsOn = new keystone.List('DependsOn', {
6 | autokey: { path: 'slug', from: 'title', unique: true },
7 | });
8 |
9 | // Add index
10 | DependsOn.add({
11 | title: { type: String, required: true, default: '' },
12 | state: { type: Types.Select, options: 'draft, published, archived', default: 'draft' },
13 | publishedDate: { type: Types.Date, dependsOn: {state: 'published'}, required: true, initial: false },
14 | });
15 |
16 | DependsOn.register();
17 |
--------------------------------------------------------------------------------
/test/models/Post.js:
--------------------------------------------------------------------------------
1 | var keystone = require('../../index.js'),
2 | Types = keystone.Field.Types;
3 |
4 | // Simple model
5 | var Post = new keystone.List('Post', {
6 | autokey: { path: 'slug', from: 'title', unique: true },
7 | });
8 |
9 | // Add index
10 | Post.add({
11 | title: { type: String, required: true, default: '' },
12 | content: { type: Types.Text, default: '' },
13 | });
14 |
15 | Post.schema.index({
16 | title: 'text',
17 | content: 'text'
18 | }, {
19 | name: 'searchIndex',
20 | weights: {
21 | content: 2,
22 | title: 1
23 | }
24 | });
25 |
26 | Post.register();
27 |
--------------------------------------------------------------------------------
/test/pretest.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 | var mongoUri = 'mongodb://localhost/test';
3 |
4 | function dropTestDatabase(done) {
5 | mongoose.connect(mongoUri, { useMongoClient: true }, function (err) {
6 | if (!err) {
7 | mongoose.connection.db.dropDatabase(function (err) {
8 | mongoose.connection.close(function (err) {
9 | done(err);
10 | });
11 | });
12 | } else {
13 | done(err);
14 | }
15 | });
16 | }
17 |
18 | function pretestTasks() {
19 | dropTestDatabase(function () {});
20 | }
21 |
22 | pretestTasks();
23 |
--------------------------------------------------------------------------------
/test/unit/README.md:
--------------------------------------------------------------------------------
1 | ## Keystone Tests
2 |
3 | #### Server
4 |
5 | When testing ssl configuration you must tell node to ignore certificate errors:
6 |
7 | ```javascript
8 | NODE_TLS_REJECT_UNAUTHORIZED=0 mocha lib/server.https.test.js
9 | ```
10 |
--------------------------------------------------------------------------------
/test/unit/field-utils.js:
--------------------------------------------------------------------------------
1 | var tests = require('../../fields/utils/test/utils.test');
2 |
3 | describe('field utils', function () {
4 | tests.testUtils();
5 | });
6 |
--------------------------------------------------------------------------------
/test/unit/lib/email.js:
--------------------------------------------------------------------------------
1 | var demand = require('must');
2 | var proxyquire = require('proxyquire');
3 | var sinon = require('sinon');
4 |
5 | describe('Email', function () {
6 | /**
7 | * SETUP
8 | */
9 | var keystoneEmail;
10 | var Email;
11 |
12 | beforeEach(function () {
13 | // Make the tests work no matter if keystone-email is installed or not, spying on the mocked
14 | // keystone-email
15 | keystoneEmail = sinon.spy();
16 | Email = proxyquire('../../../lib/email', { 'keystone-email': keystoneEmail });
17 | });
18 |
19 | /**
20 | * TESTS
21 | */
22 | it('should require options to be passed in', function () {
23 | demand(Email).throw(/requires a templateName or options argument/);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/website/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "es2015",
4 | "stage-0",
5 | "react",
6 | ],
7 | }
8 |
--------------------------------------------------------------------------------
/website/components/Grid/widths.js:
--------------------------------------------------------------------------------
1 | export default {
2 | '1': '100%',
3 | '1/2': '50%',
4 | '1/3': '33.33%',
5 | '2/3': '66.66%',
6 | '1/4': '25%',
7 | '3/4': '75%',
8 |
9 | '1/5': '20%',
10 | '2/5': '40%',
11 | '3/5': '60%',
12 | '4/5': '80%',
13 |
14 | '1/6': '16.66%',
15 | '5/6': '83.33%',
16 | };
17 |
--------------------------------------------------------------------------------
/website/components/Navbar/Brand.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 |
3 | export default function Brand ({ fill }) {
4 | return (
5 |
10 | );
11 | };
12 |
13 | Brand.propTypes = {
14 | fill: PropTypes.string,
15 | };
16 | Brand.defaultProps = {
17 | fill: '#FFFFFF',
18 | };
19 |
--------------------------------------------------------------------------------
/website/components/Navbar/Menu.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { makeSection } from './utils';
3 | import { api, documentation, gettingStarted, guides } from '../../data/navigation';
4 |
5 | const sections = [gettingStarted, guides, documentation, api];
6 |
7 | export default class Menu extends Component {
8 | render () {
9 | return ;
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/website/components/Navbar/utils/index.js:
--------------------------------------------------------------------------------
1 | import { PropTypes } from 'react';
2 | import makeSection from './makeSection';
3 |
4 | const itemsShape = PropTypes.arrayOf(PropTypes.shape({
5 | section: PropTypes.string,
6 | items: PropTypes.arrayOf(PropTypes.shape({
7 | label: PropTypes.string,
8 | slug: PropTypes.string,
9 | })),
10 | }));
11 |
12 | export default {
13 | itemsShape,
14 | makeSection,
15 | };
16 |
--------------------------------------------------------------------------------
/website/components/Version5.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { compose } from "glamor";
3 |
4 | export default () => (
5 |
13 | );
14 |
15 | const styles = {
16 | wrapper: {
17 | background: "#fff5d7",
18 | color: "black",
19 | padding: "1rem",
20 | display: "flex",
21 | justifyContent: "center",
22 | alignItems: "center",
23 | },
24 | p: {
25 | color: "#856404",
26 | padding: 0,
27 | margin: 0,
28 | },
29 | };
30 |
--------------------------------------------------------------------------------
/website/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as Container } from './Container';
2 | export { default as Grid } from './Grid';
3 | export { default as Navigation } from './Navigation';
4 | export { default as Sidebar } from './Sidebar';
5 |
--------------------------------------------------------------------------------
/website/gatsby-config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | siteMetadata: {
3 | title: 'KeystoneJS',
4 | },
5 | plugins: [
6 | 'gatsby-plugin-react-helmet',
7 | 'gatsby-plugin-glamor',
8 | 'gatsby-transformer-remark',
9 | {
10 | resolve: 'gatsby-source-filesystem',
11 | options: {
12 | name: 'docs',
13 | path: `${__dirname}/../docs`,
14 | },
15 | },
16 | {
17 | resolve: 'gatsby-source-filesystem',
18 | options: {
19 | name: 'fields',
20 | path: `${__dirname}/../fields/types`,
21 | },
22 | },
23 | {
24 | resolve: 'gatsby-plugin-typography',
25 | options: {
26 | pathToConfigModule: 'utils/typography',
27 | },
28 | },
29 | 'gatsby-plugin-netlify',
30 | ],
31 | };
32 |
--------------------------------------------------------------------------------
/website/images/brand-continental.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/brand-continental.png
--------------------------------------------------------------------------------
/website/images/brand-event_cinemas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/brand-event_cinemas.png
--------------------------------------------------------------------------------
/website/images/brand-macmillan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/brand-macmillan.png
--------------------------------------------------------------------------------
/website/images/brand-sony.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/brand-sony.png
--------------------------------------------------------------------------------
/website/images/brand-vodafone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/brand-vodafone.png
--------------------------------------------------------------------------------
/website/images/brand-westpac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/brand-westpac.png
--------------------------------------------------------------------------------
/website/images/keystone_admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/images/keystone_admin.png
--------------------------------------------------------------------------------
/website/images/logo-inverted.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/website/src/layouts/default.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | export default function DefaultLayout({ children, location }) {
4 | // TODO should be explicit prop
5 | // const isHome = location.pathname.length > 1;
6 |
7 | return {children}
;
8 | }
9 |
10 | DefaultLayout.PropTypes = {
11 | children: PropTypes.oneOfType([
12 | PropTypes.arrayOf(PropTypes.node),
13 | PropTypes.node
14 | ]).isRequired
15 | };
16 |
--------------------------------------------------------------------------------
/website/static/_redirects:
--------------------------------------------------------------------------------
1 | # Netlify redirects for Keystone v0.3 docs urls
2 | # See: https://www.netlify.com/docs/redirects/
3 |
4 | # V3 urls that have V4 equivalents
5 | /docs/* /documentation/:splat
6 | /guide /getting-started
7 | /guide/config /documentation/configuration/
8 |
9 | # V3 urls that don't have V4 equivalents yet
10 | /examples https://v3.keystonejs.com/examples 302
--------------------------------------------------------------------------------
/website/static/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/static/favicon-16x16.png
--------------------------------------------------------------------------------
/website/static/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/static/favicon-32x32.png
--------------------------------------------------------------------------------
/website/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keystonejs/keystone-classic/6e5ba1142a0909c64a1a38e20f31fcf9bed6e4db/website/static/favicon.ico
--------------------------------------------------------------------------------
/website/static/robots.txt:
--------------------------------------------------------------------------------
1 | # *
2 | User-agent: *
3 | Disallow: /
4 |
5 | # Host
6 | Host: https://v4.keystonejs.com
7 |
8 | # Sitemaps
9 | Sitemap: https://v4.keystonejs.com/sitemap.xml
10 |
--------------------------------------------------------------------------------
/website/static/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | https://v4.keystonejs.comnever0.12021-06-30T02:35:20.117Z
4 |
5 |
--------------------------------------------------------------------------------