Skip to content
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

Update the looks of My Projects route and add advanced filtering and configuration #4219

Merged
merged 45 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8435f3e
reuse code for my projects route
magicznyleszek Jan 12, 2023
11f3965
Merge branch 'custom-views-integrate-endpoints-into-front-end' into 4…
magicznyleszek Jan 18, 2023
2894318
use different orderable fields for my projects and custom views
magicznyleszek Jan 18, 2023
3396a22
use /projects/home instead of /forms
magicznyleszek Jan 18, 2023
1728ffb
remove all old code /forms route used
magicznyleszek Jan 18, 2023
75d8420
fix typo
magicznyleszek Jan 18, 2023
b0bc3da
add todo comment
magicznyleszek Jan 18, 2023
c7145e6
Merge branch 'custom-views-integrate-endpoints-into-front-end' into 4…
magicznyleszek Jan 18, 2023
b718628
Merge branch 'custom-views-integrate-endpoints-into-front-end' into 4…
magicznyleszek Jan 19, 2023
c0e11a3
add comment
magicznyleszek Jan 19, 2023
5ff876d
use fetchPostUrl
magicznyleszek Jan 19, 2023
198923a
Merge branch 'feature/regional_projects' into 4209-my-projects-redo
magicznyleszek Jan 23, 2023
6bec172
use proper route in nav link
magicznyleszek Jan 23, 2023
df1d964
add checkboxes to ProejctsTable
magicznyleszek Jan 24, 2023
8230712
display action buttons in custom view (WIP)
magicznyleszek Jan 24, 2023
0e3b969
Merge branch 'beta' into 4209-my-projects-redo
magicznyleszek Jan 30, 2023
123ba15
change KoboDropdown option from enum to type to simplify code
magicznyleszek Jan 30, 2023
a2ee273
fix placements leftovers
magicznyleszek Jan 31, 2023
dd5cf75
introduce floatingRoundedBox mixin
magicznyleszek Jan 31, 2023
2f4af7c
split code out of mixins file
magicznyleszek Feb 1, 2023
6988395
define two components for quick action buttons
magicznyleszek Feb 1, 2023
fb3fbea
Merge branch 'beta' into 4209-my-projects-redo
magicznyleszek Feb 1, 2023
9e6d0eb
Merge branch 'feature/my-projects' into 4209-my-projects-redo
magicznyleszek Feb 1, 2023
a9b8ea7
Merge branch 'feature/my-projects' into 4209-my-projects-redo
magicznyleszek Feb 1, 2023
d5eef38
import userCan from new place
magicznyleszek Feb 1, 2023
0732dfb
fix userCan in projectQuickActions component
magicznyleszek Feb 2, 2023
c2401c7
proejct quick actions done
magicznyleszek Feb 6, 2023
8737f96
remove bulk actions for now
magicznyleszek Feb 6, 2023
21a287e
Merge branch 'feature/my-projects' into 4209-my-projects-redo
magicznyleszek Feb 6, 2023
900cc31
WIP handling changes to assets
magicznyleszek Feb 7, 2023
c3a4e66
make sure deleted asset is removed from the list
magicznyleszek Feb 7, 2023
601796c
finish up refetching data code
magicznyleszek Feb 9, 2023
c6a4d82
run prettier on modified code
magicznyleszek Feb 9, 2023
0df968d
Add asset_type and downloads to serializer for Project Views feature
magicznyleszek Feb 9, 2023
a85d6ef
remove leftover todo comment
magicznyleszek Feb 10, 2023
4e75293
update comment
magicznyleszek Feb 10, 2023
2f3028e
remove leftover commented out code
magicznyleszek Feb 10, 2023
3db9770
Make ViewSwitcher display "My Projects" for no views defined
magicznyleszek Feb 22, 2023
192bd80
bring back Dropzone for My Projects route
magicznyleszek Feb 22, 2023
bc10eb0
missing semicolon and run prettier
magicznyleszek Feb 22, 2023
72573b4
Merge branch 'feature/my-projects' into 4209-my-projects-redo
magicznyleszek Feb 22, 2023
6ffcd72
Make the checkbox clicking experience a bit more generous and forgiving
p2edwards Feb 25, 2023
ecb7fb1
Merge branch 'feature/my-projects' into 4209-my-projects-redo
magicznyleszek Mar 1, 2023
6a1a48c
split translation strings
magicznyleszek Mar 1, 2023
11cbdb4
change default ordering to dateModified (was by name)
magicznyleszek Mar 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion jsapp/js/actions.es6
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,13 @@ actions.resources.deployAsset.failed.listen(function(data, redeployment){
alertify.alert(t('unable to deploy'), failure_message);
});

actions.resources.setDeploymentActive.listen(function(details) {
actions.resources.setDeploymentActive.listen(function(details, onComplete) {
dataInterface.setDeploymentActive(details)
.done((data) => {
actions.resources.setDeploymentActive.completed(data.asset);
if (typeof onComplete === 'function') {
onComplete(data);
}
})
.fail(actions.resources.setDeploymentActive.failed);
});
Expand Down
20 changes: 18 additions & 2 deletions jsapp/js/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ import type {Json} from './components/common/common.interfaces';

const JSON_HEADER = 'application/json';

const fetchData = async <T>(path: string, method = 'GET', data?: Json) => {
const fetchData = async <T>(
/** If you have full url to be called, remember to use `prependRootUrl`. */
path: string,
method = 'GET',
data?: Json,
/**
* Useful if you already have a full URL to be called and there is no point
* adding `ROOT_URL` to it.
*/
prependRootUrl = true,
p2edwards marked this conversation as resolved.
Show resolved Hide resolved
) => {
const headers: {[key: string]: string} = {
Accept: JSON_HEADER,
};
Expand All @@ -18,7 +28,9 @@ const fetchData = async <T>(path: string, method = 'GET', data?: Json) => {
headers['Content-Type'] = JSON_HEADER;
}

const response = await fetch(ROOT_URL + path, {
const url = prependRootUrl ? ROOT_URL + path : path;

const response = await fetch(url, {
method: method,
headers,
body: JSON.stringify(data),
Expand All @@ -37,6 +49,10 @@ export const fetchGet = async <T>(path: string) => fetchData<T>(path);
export const fetchPost = async <T>(path: string, data: Json) =>
fetchData<T>(path, 'POST', data);

/** POST data to Kobo API at url */
export const fetchPostUrl = async <T>(url: string, data: Json) =>
fetchData<T>(url, 'POST', data, false);

/** PATCH (update) data to Kobo API at path */
export const fetchPatch = async <T>(path: string, data: Json) =>
fetchData<T>(path, 'PATCH', data);
Expand Down
Loading