-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omitting the blank fields to respect knex DB-level defaults #2347
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While submitting a create list form inside Admin-UI, 'null' was explict in the mutation request for blank unedited fields. This was preventing the knex DB-level default to be applied correctly. But omiting the blank (unchanged) field, we managed to completely exclude it while making graphql mutation request, and thus respecting the knew `defaultTo` option.
…knex-db-defaults-form-submit
…stonejs/keystone into knex-db-defaults-form-submit
🦋 Changeset is good to goLatest commit: c42438e We got this. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
singhArmani
force-pushed
the
knex-db-defaults-form-submit
branch
from
February 7, 2020 01:23
a57c440
to
21183ce
Compare
MadeByMike
approved these changes
Feb 10, 2020
This was referenced Feb 27, 2020
Merged
Closed
This was referenced Mar 19, 2020
MadeByMike
added a commit
that referenced
this pull request
Apr 6, 2020
* fix nextjs warning about the public static directory (#2140) * bump cfonts version to ^2.4.8 (#2188) * Upgrade prettier (#2189) * Upgrade knex dependencies. (#2190) * Upgrade mongoose and mongodb dependencies. (#2191) * Clean up changelogs before publishing packages (#2192) * Version Packages (#2147) * Meetup Demo: fixed typo in file name (#2193) Co-authored-by: Tim Leslie <[email protected]> * Fix doc links (#2160) * Add working example (#2201) * Improvement suggestion (#2200) * UX updates to AdminUI search (#2198) * Remove debounce from useListSearch * Fix debounce * Changeset * Remove incorrect information (#2199) * Fix apps which don't define build() (#2202) * Fix website meta tags (#2204) * Fix deprecation message (#2208) * Fix deprecation warnings (#2209) * Consolidate tokenizer code in a single module (#2210) * Correct spelling mistake (#2223) * Update schema.md (#2215) Co-authored-by: Mike <[email protected]> * Fix spelling mistake (#2222) Co-authored-by: Mike <[email protected]> * Show change files Temp adding for debugging * Update run-or-bail.js * Remove first sentence (#2214) After reading the quick start pages, the first page is this one. It talks about KeystoneJS being 3 distinct pieces and then shows some arrow function. However, it is unclear what this is doing here. The schema describes the data model (which is the title of this page) and then it talks about AdminUI and GraphQL ... which, as far as I understand are two separate apps that can be wired in. This piece is confusing to me and I can't place it anywhere in the context, hence the PR to delete it. Co-authored-by: Mike <[email protected]> * Update custom-mutations.md (#2224) Fixed spelling mistakes Co-authored-by: Mike <[email protected]> * Capitalize GraphQL (#2219) Co-authored-by: Mike <[email protected]> * Update README.md (#2213) Capitalize Admin UI Co-authored-by: Mike <[email protected]> * Refactor join-builder internals (#2227) * Update intro-to-graphql.md (#2218) Co-authored-by: Mike <[email protected]> * Refactor relationshipTokenizer return shape (#2228) * Improve blocks UI (#2005) * Fix toolbar z-index * Focus the slate editor when the input is clicked * Make cursour text * Capture keyboard focus * typo * Fix z-index on add button * Fix range error in console * Add a changeset * Simplify the Add block positioning logic and presentation * Better blocks UI * Add changeset * Remove setState * Add color vars * Apply consistent block menu item * remove rouge yarn lock * Same PR without en-US corrections (#2232) * Update custom-server.md (#2225) * Update custom-server.md Corrected position of some sentences * Apply suggestions from code review Co-Authored-By: Mike <[email protected]> Co-authored-by: Mike <[email protected]> * Update relationships.md (#2212) * Update relationships.md Rewrite some of the sentences. Add extra information and examples for clarification. * Apply suggestions from code review Co-Authored-By: Mike <[email protected]> Co-authored-by: Mike <[email protected]> * Simplify parsing with a separate modifier tokenizer (#2229) * Close issue #1548 (#2211) Co-authored-by: Mike <[email protected]> * More filtering tests (#2234) * Correctly load Content field views when field access set to update: false (#2151) * Version Packages (#2194) * Update Content Field README (#2235) * Update Content Field README The README for Content Field should point out that you have to install the `field-content` package separately, the same way the Wysiwig Field docs do. * Update README.md Co-authored-by: Jess Telford <[email protected]> * docs: add justintemps as a contributor (#2236) * Whitespace/comment changes (#2238) * Simplify query parsing in mongoose adapter (#2240) * Bump next.js dep to ^9.2.0 (#2244) * Always run linting tests even when PRs skip other tests (#2233) * Update config.yml * Update config.yml Co-authored-by: Jess Telford <[email protected]> * docs: add wesbos as a contributor (#2245) * docs: update CONTRIBUTING.md [skip ci] * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: Jess Telford <[email protected]> * Correctly show list overflow error (#2087) * Correctly show list overflow error Co-authored-by: Jess Telford <[email protected]> * Simplify mongo queries (#2247) * Replaced s3.putObject with s3.upload in s3 file-adapter (#2249) * Grammar (#2248) Co-authored-by: Tim Leslie <[email protected]> Co-authored-by: Mike <[email protected]> * Use a $project pipeline step, rather than post-processing results. (#2251) * Fixed Typo in ReadMe (#2252) * admin-ui: Fix bug where the search input on the List page would gain focus when the user pressed SHIFT (#2264) * Remove search focus on history change * Changeset * Version Packages (#2246) * Use tmpVar in generated queries (#2261) * Defactor knex adapter in preparation for relationship changes (#2262) * Remove unused query arg from relationship tokenizer (#2267) * Update tests to be more correct (#2263) * Add ._createTables() method to KnexAdapter (#2270) * Clean up join builder tests in prep for relationship changes (#2268) * Version Packages (#2265) * Added support for --name, --adapter and --template CLI arguments for unattended Keystone app creation (#2273) * Added support for --name and --adapter and fixed the --template CLI arguments * Using strict string equality * Added support for unattended app creation using CLI arguments * docs: add gabipetrovay as a contributor (#2275) * docs: update CONTRIBUTING.md [skip ci] * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] * Refactor PasswordAuthStrategy internals (#2280) * Version Packages (#2277) * Added the create-keystone-app CLI argument documentation (#2278) * Added support for --name and --adapter and fixed the --template CLI arguments * Using strict string equality * Added support for unattended app creation using CLI arguments * Updated Keystone app generation documentation with the CLI arguments and sample commands (#2276) * Reverted the manual version change. This should be done automatically using changesets * Moved the create-app package argument documentation to the bottom of the README file * Changeset for the keystone-create-app CLI arguments * docs: add gabipetrovay as a contributor (#2281) * docs: update CONTRIBUTING.md [skip ci] * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] * Updated README.md (#2288) * Added FieldDescription to @arch-ui/fields (#2286) * remove unused dependency from keystone package (#2255) * Added adminDoc option to all fields (#2287) * chore: update todolist to camelCase (#2146) Co-authored-by: Mike <[email protected]> * Added getFilename to S3Adapter (#2250) * Remove adapters output from tests (#2295) * docs: add LiamAttClarke as a contributor (#2294) * docs: add wbarcovsky as a contributor (#2296) * docs: update CONTRIBUTING.md [skip ci] * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: Tim Leslie <[email protected]> * Convert parts of the Admin UI createItemModal to hooks (#2279) * Convert the Admin UI createItemModal to hooks * Fix Knex search (#2292) * Update README.md * Add a check for invalid relationship configurations (#2269) * Mocha version upgrade to latest, and mocha-multi-reporters replaced with cypress-multi-reporters (#2305) Cypress was failing to start when mocha was upgraded to latest version. But replacing mocha-multi-reporters with cypress-multi-reporters seems to resolve the issue. * Allow user to configure apollo graph engine (#2308) * Clean up changelogs prior to release (#2309) * ci(changeset): generate PR with changelog & version updates (#2282) * Add a missing dependency require to build packages (#2310) * ci(changeset): generate PR with changelog & version updates (#2312) * Bump admin ui dependency in fields (#2325) * ci(changeset): generate PR with changelog & version updates (#2326) * Added docs on dropDatabase (#2331) * Remove preconstruct files in AdminUI (#2330) * ci(changeset): generate PR with changelog & version updates (#2335) * Virtual field with Boolean value (#2340) * show boolean value * changeset * Update SocialIconsNav.js * Update hooks.md (#2355) * Don't call postRead hooks on the result of the internal delete function (#2345) * When the `BaseListAdapter` invokes the delete operation on it's child class, it doesn't need to then run the postRead hooks (on the field types) * Changeset * Updating the internal `_delete()` operation on the Mongoose adapter; now returns the number of record removed (will almost always be 1). * Updating changeset description since we've also now clarified/updated an internal API Co-authored-by: Mitchell Hamilton <[email protected]> * Fix typo in documentation (#2375) * Updated Apollo-related dependencies (#2323) * Sync yarn.lock file (#2376) * app-admin-ui AdminMeta typo fix (#2359) * Don't use abbreviations in user-facing is-connecting message (#2353) * Fix default sort on admin UI (#2352) * Updated graphql and graphql-type-json dependencies (#2320) * Added the Content.blocks options (#2317) * Replaced `react-focus-marshal` dependency with `focus-trap-react`. (#2373) * Upgrade to latest changsets packages (#2377) * Fixed build failure on Node 13 caused by old sharp dependency (#2386) * Remove unused dependency (#2379) * Removed deprecated gatsby-mdx dependency (#2387) * Update graphql-playground dependency (#2380) * Upgrade to latest eslint plugins (#2382) * Added headers options for ApolloClient instance for server-side requests (#2332) * Updated user schema field access level control to return boolean (#2327) * ci(changeset): generate PR with changelog & version updates (#2341) * Remove support for Node 8.x (#2391) * ci(changeset): generate PR with changelog & version updates (#2393) * Upgrade to latest jest packages (#2383) * Upgrade all babel packages (#2381) * Upgrade to latest cfonts (#2384) * Update `cross-env` dependency to 7.0.0 (#2390) * Admin UI: split some stuff out from #2354 (#2368) * Converted most field React components to functional ones (#2397) * Updated mongo dependencies (#2392) * Fix 2360 - createItems throws Error when using Lists Back References (#2401) * Fixed invalid argument dereference in Virtual Field (#2402) * Admin UI: fixed everything breaking en-route to Item Not Found (#2406) * Admin UI: refactored out uses of withRouter (#2396) * Admin UI: changed DocTitle component to take a single `title` prop. (#2407) * Admin UI: made active nav item text bold (#2409) * Admin UI: fixed an error when creating an item with a valueless required field (#2408) * Admin UI: fixed some minor issues when deleting items (#2403) * Upgrade emotion (#2395) * allow config option on custom pages (#2415) * Implemented default OEmbed type 'link' for invalid/inaccessible urls (#2356) * Updated Blog demo to use Apollo hooks (#2089) * Update initial-data.md (#2207) * Upgraded Nuxt to 2.11.0 (#2416) * Content Field Tweaks (#2417) * Password field fix (#2421) * Add internal support for the graphql provider framework (#2430) * Refactor the appVersion functionality into a Provider (#2433) * Fix link path for build status badge (#2434) * Update Documentation: Temporarily add schemaNames param to allow user success (#2435) * Fix exports (#2429) * Updated apollo-server-express to 2.10.1 (#2437) * Knex Adapter: skip database version validation when not using a PostgreSQL client (#2431) * Updated tinymce to 5.2.0 (#2445) * Updated Webpack dependencies (#2443) Co-authored-by: Tim Leslie <[email protected]> * ci(changeset): generate PR with changelog & version updates (#2394) * Correct typo for minimum (#2422) * Admin UI: fixed items being flagged as changed even if input did not differ (#2423) * Add docs on custom fields (#2299) * Omitting the blank fields to respect knex DB-level defaults (#2347) * Admin UI: tweaked signin page (#2450) * Add a CustomProvider class (#2436) * Move throwAccessDenied into graphqlErrors.js (#2455) * Admin UI: cleaned up an unnecessary use of <Route> (#2461) * Admin UI: cleaned up handling of admin meta (#2460) * Factor out authentication access control handling (#2456) * Add _executeOperation method to Keystone class (#2459) * Add a provider for authentication against a List (#2457) * Add ListCRUDProvider (#2465) * Remove undocumented DEBUG_GRAPHQL_SCHEMAS (#2467) * update field (#2464) * Switched to official TinyMCE React integration. (#2448) Co-authored-by: Mike <[email protected]> * Handle missing oEmbeds in field-content document (#2458) * Implemented default embed type 'link' for invalid/unaccessable urls Co-authored-by: Mike <[email protected]> * Allow field configuration of the WYSIWYG editor (#2449) * Switched to official TinyMCE React integration. * Remove Keystone.getAdminSchema and add Keystone.getResolvers (#2468) * Returned promise from file-adapter delete methods, made delete params… (#2291) * Updated rollup dependencies (#2476) * refactor ItemHeaderActions (#2478) Co-authored-by: Mike <[email protected]> * Minor doc tweaks and cleanup (#2477) * Update docs * changes to changesets (#2485) * minor change to content field UI - zindex was causing a bug (#2484) Co-authored-by: Dominik Wilkowski <[email protected]> * update manypkg (#2487) * Fixed Select field dropdown zindex (fixes #2451) (#2490) * Update unsplash (#2489) * Upgraded to React 16.13.0 (#2442) * Updated Meetup demo to use Apollo hooks (#2324) * docs: add Noviny as a contributor (#2491) * docs: update CONTRIBUTING.md [skip ci] * docs: update README.md [skip ci] * docs: update .all-contributorsrc [skip ci] Co-authored-by: Tim Leslie <[email protected]> * ci(changeset): generate PR with changelog & version updates (#2447) * fix chrome mac print bug (#2499) * website: Redesign of homepage (#2475) * Website: don't show scrollbars on code cards (#2505) * Website: fix some links (#2506) * Move tutorials into their own section (#2504) * Clean up quick start docs (#2513) * Mention that dropDatabase is ignored in production (#2512) * Update tutorial docs (#2514) * Fixed letters sometimes being cut off in input fields (#2519) * Add support for conditional bcrypt/bcryptjs usage (#2523) * ci(changeset): generate PR with changelog & version updates (#2498) * Create new upcase util (#2524) * Refactored matchFilter to use named args (via an object) (#2525) * Updated to latest vesrsion of globby for discovering test files to run. (#2527) * Less typo (#2530) * website: Fix packages page (#2533) * Fixed a minor typo (#2531) * website: Remove duplicate components/utilities (#2528) * Break out middleware preparation into separate method (#2536) * Fixed access control oversight in starter (fixes #2518) (#2532) * Introduce CRUD testing framework to fix bug in Decimal field (#2537) * Introduce CRUD testing framework to fix bug in Decimal field * Fix bug in Decimal field where updating adjacent fields would wipe out Decimal field's value * Updated mongo dependencies to latest version (#2538) * Factor out appVersion support into a separate package (#2535) * Fixed regression when using custom schema (fixes #2541) (#2542) * ci(changeset): generate PR with changelog & version updates (#2526) * Remove undocumented audiences mechanism (#2540) * Add gatsby-plugin-sitemap (#2547) * Remove useless existingItem field from defaultValue field function (#2549) * Remove useless existingItem field from defaultValue field function * Update .changeset/plenty-donkeys-draw.md Co-Authored-By: Tim Leslie <[email protected]> * Updated docs for defaultValue Co-authored-by: Tim Leslie <[email protected]> * Add asyncForEach to utils package (#2552) * Add rels data structure to adapters (#2543) * Remove the prepareFieldAdapter method (#2544) * website: Add docsearch classes (#2548) * Add reach-router * Add content class * Add sidebar classes * Remove console.log * manypkg fix * Update isPageInGroupActive * Remove content classes from home * Knex adapter internal updates (#2492) * website: Add Algolia Docsearch (#2546) * Initial spike * Cleanup * manypkg fix * Remove unused vars * hardcode keys * Add docsearch * Remove old search * Remove dotenv * Remove comment * Sidebar cleanup * Fix navigate * Remove getHash * A cleaner clean command (#2556) * Replace session package API with a SessionManager class (#2529) * Change docs on defaultValue * Update @babel/core to get tests passing (#2570) * Blog demo uses latest Apollo Next.js patterns (#2563) * Add new @keystonejs/fields-authed-relationship for auto-filling currently logged in user (#2562) * Blog demo requires signin to post + uses AuthedRelationship field for author (#2564) * ci(changeset): generate PR with changelog & version updates (#2545) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Create tables (#2575) * Update README.md * Docs: Sticky Layout (#2579) - align the header columns with the content columns - introduce heading-based page nav - drawer-style navigation on small device - optimised layout for larger devices * Minor doc tidying (#2590) * Make realKeys available on Mongoose field adapters (#2585) * Docs Cleanup (#2592) * first pass - quick start - tutorials * guides * roadmap & plugins * mini styling updates * expose tertiary headings in ToC for better discoverability - also resolve some layout issues on smaller devices * API: general + apps * field types * more api; - field adapters - auth strategies - utilities - database adapters * replace "KeystoneJS" with "Keystone" * consistent "note" variants within docs * missed one... * add missing changeset from #2952 (#2593) * Replacing old github project links (#2560) * Replacing old github project links * Adding changeset * Adding missing package to changeset * Removed apollo-boost dependency (#2603) * More doc improvements (#2594) * Docs: adaptor -> adapter * Docs: mention Mongoose options set by default * Docs/Keystone: list config options and methods in alphabetical order * Docs/Keystone: list `createAuthStrategy` in the methods table * Docs/Create List: list config options in alphabetical order * Docs/Keystone: link to the Authentication guide * Docs/Access Control: improved formatting * Docs/Access Control: document `auth` (resolves #2018) * Docs/Fields: document native type aliases * Docs/File: we now have the S3 adapter available * Docs/WYSIWYG Field: removed credit, we now use tinymce-react directly * Docs/Static App: use table * Docs/Keystone: removed the super-long in-table default for `appVersion` * Docs/Keystone: remove secret method that no longer exists * Docs/Access Control: use Typescript for interface examples (used to be Flow) * Website: allow last table column to wrap Co-authored-by: Joss Mackison <[email protected]> Co-authored-by: Mike <[email protected]> * Updated Next.js to 9.3.2 to incorporate an important security fix (#2608) * Made meetup demo functional again (#2607) * Fix OEmbed field build error (#2611) * Fix OEmbed field build error * Add a changeset * add changelog links (#2600) Co-authored-by: Mike <[email protected]> Co-authored-by: Jed Watson <[email protected]> * Improved list label logic (fixes #2612) (#2615) label was falling back on the pluralized form of the label autogenerated from the list key regardless of whether a custom plural was provided or not. This change ensures custom label, singular, and plural settings are properly used. Addresses an old request from @jossmac (#58 (review)), since custom plurals will now be considered before deeming the list label invalid. * Docs/Authentication: documented generated auth types (#2621) * use manypkg run over yarn --cwd (#2599) * Docs: Cleanup table of contents (#2622) Fix table-of-contents in docs pages: - resolve out-of-sync ID issue (`github-slugger` VS `@sindresorhus/slugify`) - allow items to wrap, without looking like separate items * Fix checkbox field layout (#2616) * Improve Checkbox Field Layout * Adding changeset * Uncaught GraphQLError when no list is defined (#2573) * Update forty-suns-hunt.md (#2626) * Update @sindresorhus/slugify (#2623) * improve readability and discoverability (#2625) * update readme.md for quickstart (#2495) * Document missing argument in custom resolver functions (#2627) * Docs: Code Block Meta (#2631) Add meta data to code blocks: * copy functionality * display language * optional title Unrelated changes: * fix bug with focus on heading anchors * filter out paragraphs that contain badges * Add some implementations Co-authored-by: Gautam Singh <[email protected]> Co-authored-by: Jeff Hooton <[email protected]> Co-authored-by: Tim Leslie <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Charles Dang <[email protected]> Co-authored-by: Tim Leslie <[email protected]> Co-authored-by: Mitchell Hamilton <[email protected]> Co-authored-by: Bart Duisters <[email protected]> Co-authored-by: Jordan Overbye <[email protected]> Co-authored-by: Vladimir Barcovsky <[email protected]> Co-authored-by: Jess Telford <[email protected]> Co-authored-by: Justin Smith <[email protected]> Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Liam Clarke <[email protected]> Co-authored-by: Mirza Hashir Baig <[email protected]> Co-authored-by: Gabriel Petrovay <[email protected]> Co-authored-by: Raymond Jia <[email protected]> Co-authored-by: Alexander Jaroszewicz <[email protected]> Co-authored-by: Amandeep Singh <[email protected]> Co-authored-by: Kevin Brown <[email protected]> Co-authored-by: Fuh Austin <[email protected]> Co-authored-by: John Molomby <[email protected]> Co-authored-by: Zack Sunderland <[email protected]> Co-authored-by: Marcos RJJunior <[email protected]> Co-authored-by: Jan Šafařík <[email protected]> Co-authored-by: VinayaSathyanarayana <[email protected]> Co-authored-by: Corey Jepperson <[email protected]> Co-authored-by: SeanDoyleGit <[email protected]> Co-authored-by: Michael Zaporozhets <[email protected]> Co-authored-by: Agney Menon <[email protected]> Co-authored-by: Wes Bos <[email protected]> Co-authored-by: Dominik Wilkowski <[email protected]> Co-authored-by: Mike <[email protected]> Co-authored-by: Raúl R Pearson <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Joss Mackison <[email protected]> Co-authored-by: Jed Watson <[email protected]> Co-authored-by: Ben Conolly <[email protected]> Co-authored-by: Olof Sjögren <[email protected]> Co-authored-by: Maryam Mostajir <[email protected]> Co-authored-by: iamacup <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For keystone config as follows:
submitting a create list form inside Admin-UI,
null
was explicit in the mutation request for blank unedited fields. This was preventing the knex DB-level default to be applied correctly. But omitting the blank (unchanged) field, we managed to completely exclude it while making graphql mutation request and thus respecting the knewdefaultTo
option.closes #1398