-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Google Groups in the approver field (#661)
* Prep for groups in the PeopleSelect * Explore XDropdownList * More basicDropdown discovery * Improve types and styles * Update nav.hbs * Add offset, improve styles * Improve dropdown design * Style tweak * WIP "Loading" * Improve loading states * Cleanup * Update people-select-test.ts * Tweak styles and offset * Prevent dropdown from opening on ArrowUp/Down * Set up `includeGroups` arg * Revert unnecessary change * Flatten array instead of groups * Reduce diff * Start of EmberData files * Clean Mirage People route * More prep for EmberData requests * Add notes from meeting with Josh * Rename/reorganize * Post-merge resolutions * Add conditional approve button and text * Improve group handling * Add group logic to maybeFetchPeople * Track cachedValue in `editableField` * Fix test; WIP update-editable-field function * Put TODO catch block on OPTIONS call * Get list to update on groupApproverClick * Remove approvers from drafts POST request - this isn't used in the frontend * Add groups API * Support group approvals * Forgot document group review model * WIP OPTIONS call * Add members of approver groups as individual approvers in the database * Load group with `maybeFetchPeople` * Filter departed users * Fix errors * Add/update tests; cleanup and documentation * Enable setting a Google Groups prefix * Only apply prefix if it looks like the user isn't beginning to type it * Add "remove me" assertion * Return results with and without a configured groups prefix --------- Co-authored-by: Josh Freda <[email protected]>
- Loading branch information
Showing
33 changed files
with
632 additions
and
123 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import DS from "ember-data"; | ||
import ApplicationAdapter from "./application"; | ||
import RSVP from "rsvp"; | ||
|
||
export default class GroupAdapter extends ApplicationAdapter { | ||
/** | ||
* The Query method for the group model. | ||
* Returns an array of groups that match the query. | ||
* Also used by the `queryRecord` method. | ||
*/ | ||
query(_store: DS.Store, _type: DS.Model, query: { query: string }) { | ||
const results = this.fetchSvc | ||
.fetch(`/api/${this.configSvc.config.api_version}/groups`, { | ||
method: "POST", | ||
body: JSON.stringify({ | ||
// Spaces throw an error, so we replace them with dashes | ||
query: query.query.replace(" ", "-"), | ||
}), | ||
}) | ||
.then((r) => r?.json()); | ||
|
||
return RSVP.hash({ results }); | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.