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

clark-service-refactor to main #1693

Open
wants to merge 786 commits into
base: main
Choose a base branch
from
Open

clark-service-refactor to main #1693

wants to merge 786 commits into from

Conversation

mfranz1
Copy link
Contributor

@mfranz1 mfranz1 commented Feb 27, 2024

This PR updates clark-client to conform to changes in clark-services. All services have been rewritten except for learning-object-service. All LOS routes are still currently being used to the old service and are referred to as legacy routes in the client.

Majority of file changes are files that have been reorganized into subdirectories of src/app/core. The core module now reflects our clark-service/CLARK-Gateway strutcures.

This pull request is linked to Shortcut Story #28112: Update clark-client to reflect changes in clark-service.

@mfranz1 mfranz1 marked this pull request as ready for review March 4, 2024 21:07
.circleci/config.yml Show resolved Hide resolved
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint && npm run test:unit
npm run lint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would run prettier fix here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good looks

"lint": "npx ng lint clark",
"lint:fix": "npx ng lint clark --fix",
"prettier": "prettier --check .",
"e2e": "ng e2e",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a script for prettier:fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have two cores? One under src/app/admin/core and on under src/app/core?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we purpose ../core/.. is to support any Angular service or guard, in addition to a few client supporting components. The unique part of and *.service.ts file in a core is not always to interact with our API, it's a client service that controls a particular component, for an example. That is the case here in admin/core where most of these service files are controlling logic for client interactions.

To fully answer your question, we should refactor to having one core within src/app however, I argue that moving every existing core to one core is a refactor out of scope of route updates for clark-service

await this.http
.request(
ACCESS_GROUP_ROUTES.REMOVE_ACCESS_GROUP_FROM_USER(memberId),
collection,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This route won't work. The Dto for this route is expecting an accessGroup to remove from the user.

@@ -151,17 +118,14 @@ export class UserService {
* @memberof UserService
*/
getOrganizationMembers(organization: string): Promise<User[]> {
const route = USER_ROUTES.GET_SAME_ORGANIZATION(organization);
const route = LEGACY_USER_ROUTES.GET_SAME_ORGANIZATION(organization);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used? Should we be adding this to clark-service?

src/app/core/user-module/user.service.ts Show resolved Hide resolved
src/app/core/utility-module/utility.routes.ts Show resolved Hide resolved
src/app/core/utility-module/utility.service.ts Outdated Show resolved Hide resolved
// *
// * @returns An observable containing an array of blogs
// */
// async getRecentBlogs(): Observable<Blog[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this is commented out?

Clark-service supports the query recent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch on mfranz1 branch
Clark-service needs to be updated to look at query param not body

* @returns {Promise<void>}
* @memberof UserService
*/
async removeMember(collectionName: string, memberId: string): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function isn't being referenced anywhere

@mfranz1 mfranz1 requested a review from pzalep1 March 8, 2024 17:37
Copy link
Member

@pzalep1 pzalep1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few comments and questions.

- releases
- cyber4all/s3:
context: [AWS, Slack]
bucket: "clark-prod-file-uploads"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this the production upload bucket?

@@ -89,7 +89,7 @@ export class AdminUserCardComponent {
}

async canAddEvaluator() {
const roles = await this.privilegeService.getCollectionRoles(this.user.id);
const roles = await this.accessGroupsService.getUserAccessGroups(this.user.username);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using id?

@@ -73,7 +73,6 @@ export class UserSearchWrapperComponent implements OnInit, OnDestroy {
this.loading = false;
}).catch(error => {
this.toaster.error('Error!', 'There was an error fetching users. Please try again later.');
console.error(error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for cleaning these up.

})
.catch(error => {
this.toaster.error('Error!', 'Could not remove reviewer. Please try again later');
console.log(error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

private ngUnsubscribe = new Subject<void>();
ssoRedirect = environment.apiURL + '/google';
ssoRedirect = AUTH_ROUTES.GOOGLE_SIGNUP();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

c.hasLogo = true;
});
} catch (error) {
console.log(error);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@@ -130,22 +133,22 @@ export class FeaturedObjectsService {
* @returns {Promise<LearningObject[]>}
* @memberof LearningObjectService
*/
getNotFeaturedLearningObjects(query?: Query): Promise<{learningObjects: LearningObject[], total: number}> {
getNotFeaturedLearningObjects(query?: Query): Promise<{ learningObjects: LearningObject[], total: number }> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used on the featured admin page. It gets the learning objects that aren't featured.

@@ -20,9 +22,10 @@ export class HttpConfigInterceptor implements HttpInterceptor {
request: HttpRequest<any>,
next: HttpHandler
): Observable<HttpEvent<any>> {
console.log('intercepted request ... ');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@@ -113,7 +116,7 @@ export class LibraryService {
// Show loading spinner
this._loading$.next(true);
// Url route for bundling
const bundle = USER_ROUTES.OBJECT_BUNDLE(
const bundle = BUNDLING_ROUTES.BUNDLE_LEARNING_OBJECT(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

History: Library used to have a download button and we used to bundle everything on the fly.

* Request to get all learning object stats
* @method GET
*/
GET_LEARNING_OBJECT_STATS() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably related to the weird 2 stats routes we had in library and learning object service.

Cwagne17 and others added 16 commits August 19, 2024 14:31
…revision-of-a-released-learning

Bug/sc 32660/cannot create a revision of a released learning
…hanging-author

Bug/sc 32638/404 error when changing author
should i be surprised this would eventually break?

Signed-off-by: Andreas <git@fsck.rip>
Signed-off-by: Andreas <git@fsck.rip>
Signed-off-by: Andreas <git@fsck.rip>
Signed-off-by: Andreas <git@fsck.rip>
Signed-off-by: Andreas <git@fsck.rip>
…learning-outcome-response-to

Parsing for the new create-outcome JSON response
…to' into bug/sc-32563/deleting-a-learning-outcome-doesn-t-seem

Signed-off-by: Andreas <git@fsck.rip>
Signed-off-by: Andreas <git@fsck.rip>
…or-posting-response-but-it

fix: [sc-32663] Client shows error posting response but it actually added
Romerico David and others added 30 commits September 30, 2024 11:17
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
…e-route-updates-for-clark-refactor

Feature/sc 32779/search module route updates for clark refactor
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
…eleased-learning-objects

Fix for user not seeing their released learning objects in dashboard
…rned-in-learning-object-builder

bug: [sc-33807] No children returned in learning object builder
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
…le-in-staging-timesout

fix: [sc-32939] use URL download instead of blob download
arghh

Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
…rchy-object-for-a-learning

fix: [sc-32707] Creating a hierarchy object for a learning object error
…d-other-learning-objects

Bug/sc 33809/an author can add other learning objects
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
…appears-on-first-submission

fix: [sc-34004] Changelog modal appears on first submission of a learning object
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
Signed-off-by: Andreas <andreas.papacharalampous@secured.team>
…r-removed-in-builder-when

fix: [sc-32498] First contributor removed in builder when enter is clicked
…standard-guidelines-do-not

Bug/sc 34007/suggestions for standard guidelines do not change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants