Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into backport-background-g…
Browse files Browse the repository at this point in the history
…eopoint-question-to-pyxform
  • Loading branch information
jnm committed Nov 7, 2024
2 parents d717394 + 0e6ea86 commit 189e514
Show file tree
Hide file tree
Showing 150 changed files with 5,476 additions and 976 deletions.
103 changes: 103 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
## This is a comment.
## Each line is a file pattern followed by one or more owners.
## Last matching line wins.




## Default owner for all missed files by more specific matches below.
* @magicznyleszek @noliveleger



################
#### Global section.
/.editorconfig @magicznyleszek
/.git-blame-ignore-revs @magicznyleszek
/.gitattributes @magicznyleszek @noliveleger
/.gitignore @magicznyleszek @noliveleger
/dependabot.yml @magicznyleszek
/kpi.code-workspace @p2edwards
/LICENSE @jnm @tinok

## Translations
/.gitmodules @JacquelineMorrissette @jnm
/.tx/ @JacquelineMorrissette @jnm




################
#### Frontend section.

# Default owner
/.storybook/ @magicznyleszek
/cypress/ @magicznyleszek
/jsapp/ @magicznyleszek
/patches/ @p2edwards
/static/ @magicznyleszek
/webpack/ @magicznyleszek
/.babelrc.json @magicznyleszek
/.browserslistrc @magicznyleszek
/.eslintignore @magicznyleszek
/.eslintrc.js @magicznyleszek
/.node-version @magicznyleszek
/.nvmrc @magicznyleszek
/.prettierrc.js @magicznyleszek
/.stylelintrc.js @magicznyleszek
/.swcrc @magicznyleszek
/.coffeelint.json @magicznyleszek
/package-lock.json @magicznyleszek
/package.json @magicznyleszek
/tsconfig.json @magicznyleszek

# Billing
/jsapp/js/account/ @jamesrkiger
/jsapp/js/components/usageLimits @jamesrkiger




################
#### Backend section

# Default owner
/dependencies/ @jnm @noliveleger
/hub/ @jnm @noliveleger
/kobo/ @jnm @noliveleger
/kobo/apps/audit_log/ @rgraber
/kobo/apps/subsequences/ @Guitlle
/kpi/ @jnm @noliveleger
/test/ @jnm @noliveleger
/.coveragerc @jnm
/.dockerignore @jnm @noliveleger
/format-python.sh @noliveleger
/manage.py @jnm @noliveleger
/pip-compile.sh @jnm @noliveleger
/pyproject.toml @jnm @noliveleger




################
#### Infrastructure section

/docker/ @bufke @jnm @noliveleger
/scripts/ @bufke @jnm @noliveleger
/.github/ @bufke @jnm @noliveleger @magicznyleszek
/.gitlab-ci.yml @bufke
/Dockerfile @bufke @jnm @noliveleger




################
#### Documentation section
/CONTRIBUTING.md @Akuukis @magicznyleszek @noliveleger
/README.md @Akuukis @jnm @magicznyleszek @noliveleger
/.github/CODEOWNERS @Akuukis @jnm @noliveleger @magicznyleszek
/.github/FUNDING.yml @Akuukis @jnm @noliveleger @magicznyleszek
/.github/ISSUE_TEMPLATE.md @Akuukis @jnm @noliveleger @magicznyleszek
/.github/PULL_REQUEST_TEMPLATE.md @Akuukis @jnm @noliveleger @magicznyleszek


69 changes: 50 additions & 19 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,59 @@
## Checklist
### 🗒️ Checklist

1. [ ] If you've added code that should be tested, add tests
2. [ ] If you've changed APIs, update (or create!) the documentation
3. [ ] Ensure the tests pass
4. [ ] Run `./python-format.sh` to make sure that your code lints and that you've followed [our coding style](https://github.com/kobotoolbox/kpi/blob/main/CONTRIBUTING.md)
5. [ ] Write a title and, if necessary, a description of your work suitable for publishing in our [release notes](https://community.kobotoolbox.org/tag/release-notes)
6. [ ] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
7. [ ] Open an issue in the [docs](https://github.com/kobotoolbox/docs/issues/new) if there are UI/UX changes
8. [ ] Create a testing plan for the reviewer and add it to the Testing section
1. [ ] run linter locally
2. [ ] update all related docs (API, README, inline, etc.), if any
3. [ ] draft PR with a title `<type>(<scope>)<!>: <title> TASK-1234`
4. [ ] tag PR: at least `frontend` or `backend` unless it's global
5. [ ] fill in the template below and delete template comments
6. [ ] review thyself: read the diff and repro the preview as written
7. [ ] open PR & confirm that CI passes
8. [ ] request reviewers, if needed
9. [ ] delete this section before merging

## Description
### 📣 Summary
<!-- Delete this section if changes are internal only. -->
<!-- One sentence summary for the public changelog, worded for non-technical seasoned Kobo users. -->

Describe the outcome of your work here. A non-programmer who is familiar with KoboToolbox should be able to understand what you've written; more technical details can be added to the Notes section below. You may omit this if the title alone provides enough information. Both the title and this description will be published in the [release notes](https://community.kobotoolbox.org/tag/release-notes) on our forum.

## Notes

Describe what you've changed and why. This should allow the reviewer to understand more easily the scope of the PR. It's good to be thorough here.
### 📖 Description
<!-- Delete this section if summary already said everything. -->
<!-- Full description for the public changelog, worded for non-technical seasoned Kobo users. -->

## Testing

Add a testing plan for the reviewer. This should allow the reviewer to test the basic functionality of the new code.

## Related issues
### 👷 Description for instance maintainers
<!-- Delete this section if everything is already said above. -->
<!-- Full description for the public changelog, worded for technical Kobo instance maintainers. -->

Fixes #ISSUE
Blocked by #ISSUE
Part of #ISSUE


### 👀 Preview steps
<!-- Delete this section if behavior can't change. -->
<!-- If behavior changes or merely may change, add a preview of a minimal happy path. -->

Bug template:
1. ℹ️ have an account and a project
2. do this
3. do that
4. 🔴 [on main] notice that this isn't anywhere BUT it should be here
5. 🟢 [on PR] notice that this is here

Feature/no-change template:
1. ℹ️ have account and a project
2. do this
3. do that
4. 🟢 notice that this is there
5. do that another thing
6. 🟢 notice that this changed like that


### 💭 Notes
<!-- Delete this section if empty. -->
<!-- Anything else useful that's not said above,worded for
reviewers, testers, and future git archaeologist collegues. Examples:
- screenshots, copy-pasted logs, etc.
- what was tried but didn't work,
- conscious short-term vs long-term tradeoffs,
- proactively answer likely questions,
-->
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ We'd love your input! We want to make contributing to this project as easy and t

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [GitHub Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
## All Code Changes Happen Through Pull Requests

Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)).
We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update (or create!) the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!
6. Issue that pull request and follow the pull request template!

## Any contributions you make will be under the GNU Affero General Public License

In short, when you submit code changes, your submissions are understood to be under the same [GNU Affero General Public License](./LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern.
In short, when you submit code changes, your submissions are understood to be under the same [GNU Affero General Public License](./LICENSE) that covers the project.
Feel free to contact the maintainers if that's a concern.

## Report bugs using GitHub's [issues](https://github.com/kobotoolbox/kpi/issues)

Expand Down
21 changes: 21 additions & 0 deletions hub/models/extra_user_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def save(
if not update_fields or (update_fields and 'data' in update_fields):
self.standardize_json_field('data', 'organization', str)
self.standardize_json_field('data', 'name', str)
if not created:
self._sync_org_name()

super().save(
force_insert=force_insert,
Expand All @@ -59,3 +61,22 @@ def save(
self.user.id,
self.validated_password,
)

def _sync_org_name(self):
"""
Synchronizes the `name` field of the Organization model with the
"organization" attribute found in the `data` field of ExtraUserDetail,
but only if the user is the owner.
This ensures that any updates in the metadata are accurately reflected
in the organization's name.
"""
user_organization = self.user.organization
if user_organization.is_owner(self.user):
try:
organization_name = self.data['organization'].strip()
except (KeyError, AttributeError):
organization_name = None

user_organization.name = organization_name
user_organization.save(update_fields=['name'])
67 changes: 67 additions & 0 deletions jsapp/js/account/accountSidebar.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@use 'scss/colors';

.accountSidebar {
margin-top: 10px;
padding: 14px 20px 20px 0;
overflow-y: auto;
overflow-x: hidden;
flex: 1;
color: colors.$kobo-gray-700;
}

.navGroup + .navGroup {
margin-top: 40px;
}

.navlink {
color: inherit;

&:hover {
cursor: pointer;
}
}

.navlinkIcon {
margin: 0 6px 0 1px !important;
}

.navlinkLabel {
display: flex;
flex-direction: row;
align-items: center;
position: relative;
color: inherit;
padding: 0 0 0 18px !important;
border-left: 3px solid transparent;
margin-bottom: 18px;
cursor: pointer;

.newLinkLabelText {
flex: 0.75;
}

&:hover {
color: colors.$kobo-gray-800;
}

i {
font-size: 26px;
margin: 5px 4px 5px 1px;
display: inline-block;
}
}

.activeNavlink {
label {
border-left: 3px solid colors.$kobo-teal;
color: colors.$kobo-gray-800;
}
}

.subhead {
padding: 0 0 0 18px !important;
margin-bottom: 16px;
font-size: 12px;
font-weight: 600;
color: colors.$kobo-gray-600;
}
31 changes: 0 additions & 31 deletions jsapp/js/account/accountSidebar.scss

This file was deleted.

Loading

0 comments on commit 189e514

Please sign in to comment.