Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Handling failed post delete service calls #79

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
461fa0e
1. introducing error handling in post/delete calls related to Assignm…
Oct 8, 2020
c9e11b1
learncontent- error handling for post and delete calls
maleekha Oct 9, 2020
54a8c0e
using the promise object properly now
maleekha Oct 9, 2020
b00be7a
Error handling for publishStatusChange call
maleekha Oct 9, 2020
969ddd9
error handling for AssignmentLinks - fixes
Oct 9, 2020
4661667
improved publish button action
Oct 9, 2020
dbe145a
removed console.log statement, extra spaces
Oct 9, 2020
5574421
Changing serviceCallInProgress from boolean to number
maleekha Oct 11, 2020
f5ece3b
1. error handling for Assignment APIs
Oct 12, 2020
2f8f3ce
Error handling for get and post calls; added appropraiate error messa…
maleekha Oct 12, 2020
cd55741
Assignment store synced state on publish; warning text
maleekha Oct 12, 2020
e2930dd
Error message for publish status change when the user is unauthorized
maleekha Oct 12, 2020
b9e974c
Updating warning text styles; making assignment link store on-publish…
maleekha Oct 12, 2020
e95f637
Merge branch 'main' into handling-failed-POST-DELETE-service-calls
maleekha Oct 12, 2020
c7dfca9
Updating LearnStore from main
maleekha Oct 12, 2020
f2f3be8
Updating MicrosoftLearnStore -- fixing diff from main to show properl…
maleekha Oct 13, 2020
b730715
Assignment updating spinner; renamed failure message bar; code refact…
maleekha Oct 13, 2020
65cbe8a
error handling for GET call in Links and Learn Content stores
Oct 13, 2020
f70068d
Refactoring learn store
maleekha Oct 13, 2020
ef66b22
Revert "Refactoring learn store"
maleekha Oct 13, 2020
56d1ffe
Modifying student-view to show synced assignment content; updating er…
maleekha Oct 13, 2020
d0b1ca6
Updating student view description and deadline
maleekha Oct 13, 2020
26adb49
removing error handling for getCatalog -- TODO: To be done on server …
maleekha Oct 13, 2020
b2f8f10
Updating Learnstore error handling- including waiting mechanism based…
maleekha Oct 14, 2020
dd73a01
build fix
maleekha Oct 14, 2020
3145cd8
Updating Microsoft Learn Content-item toggle logic to use observables
maleekha Oct 15, 2020
776ad42
Code-refactoring; added call-status
maleekha Oct 15, 2020
9b61ddc
Updated LearnStore to handle error case of clear all call
maleekha Oct 15, 2020
993e0c2
Refactoring LearnStore; removing removeItem-action, as it can be done…
maleekha Oct 16, 2020
65c7dd5
LearnStore code refactoring
maleekha Oct 16, 2020
8b104c5
Disable link action area while an add/update call is in progress for …
maleekha Oct 16, 2020
20bd6ce
Updating AssignmentLinkstore to reflect changes on publish properly; …
maleekha Oct 16, 2020
bc2676a
removing unnecessary comments
maleekha Oct 16, 2020
77365e9
Code refactoring; assignment store updates
maleekha Oct 16, 2020
577c352
removing unused imports
maleekha Oct 16, 2020
408bde7
Removing "isSynced" observables as they are not needed.
maleekha Oct 16, 2020
12efe24
Adding license header to new files
maleekha Oct 16, 2020
5e470a7
Updated assignment store update from synced state on publish; publish…
maleekha Oct 19, 2020
1112f0b
Update AssignmentLinks.store.ts
Oct 19, 2020
8251fdf
Fix for unnecessary links, learn-content, me calls on assignment update
maleekha Oct 19, 2020
3f2808e
Merge branch 'handling-failed-POST-DELETE-service-calls' of https://g…
maleekha Oct 19, 2020
3606311
minor syntax uodates
Oct 19, 2020
478d79e
Soft fade-in fade-out for assignmentUpdateFailureMessageBar
maleekha Oct 20, 2020
fc1f826
Updating links and learn-store to have computed variables storing the…
maleekha Oct 20, 2020
9ff5066
Update AssignmentUpdateFailureMessageBar.tsx
Oct 20, 2020
76c3b08
Update MainLayout.tsx
Oct 20, 2020
fbf4c52
Update AssignmentUpdateFailureMessageBar.tsx
Oct 20, 2020
6e464fb
updating AssignmentFailMessageBar to display store-specific messages.
maleekha Oct 20, 2020
97ddea1
minor updates to make code look cleaner
Oct 20, 2020
5d64de4
Update AssignmentUpdateFailureMessageBar.tsx
Oct 20, 2020
71790b3
Merge branch 'main' into handling-failed-POST-DELETE-service-calls
nehalilani Oct 20, 2020
4931a47
Updated store-specific message in the assignmentUpdateFailureMessageBar
maleekha Oct 20, 2020
53617d5
Fixing issues in Assignment and Links store
maleekha Oct 21, 2020
6c8e6ed
Update AssignmentLinks.store.ts
maleekha Oct 21, 2020
6207f21
LinksStore update
Oct 21, 2020
9d47ea2
Fixing learn store clear-all issue
maleekha Oct 21, 2020
2f6b74f
Removing unnecessary comments
maleekha Oct 21, 2020
abba9d8
Update Assignment.store.ts
Oct 21, 2020
643b26c
Update Assignment.store.ts
Oct 21, 2020
e7ede1a
Update Assignment.store.ts
Oct 21, 2020
cad7743
Update Assignment.store.ts
Oct 21, 2020
f3ce995
Update Assignment.store.ts
Oct 22, 2020
b16c568
updated error messages
Oct 22, 2020
17cbbfc
Update Assignment.store.ts
Oct 22, 2020
736dc4a
Update Assignment.store.ts
maleekha Oct 22, 2020
e1a119f
Temporarily hardcoding the linkid and contentuid in service calls. Wi…
maleekha Oct 22, 2020
601fc77
Fixed issues in learn-store; modified the disable condition for clear…
maleekha Oct 27, 2020
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
Prev Previous commit
Next Next commit
Soft fade-in fade-out for assignmentUpdateFailureMessageBar
  • Loading branch information
maleekha committed Oct 20, 2020
commit 478d79ec4a67c453893e57d390fabe4d31088d8f
29 changes: 17 additions & 12 deletions client/src/Core/Components/AssignmentUpdateFailureMessageBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
* Licensed under the MIT License.
*--------------------------------------------------------------------------------------------*/

import { AnimationClassNames, IMessageBarStyles, MessageBar, MessageBarType, styled } from '@fluentui/react';
import { AnimationClassNames, classNamesFunction, getTheme, IMessageBarStyles, ITheme, MessageBar, MessageBarType } from '@fluentui/react';
import { useObserver } from 'mobx-react-lite';
import React from 'react';
import { useStore } from '../../Stores/Core';
import { ServiceError } from '../Utils/Axios/ServiceError';
import { themedClassNames } from '../Utils/FluentUI';
import { IStylesOnly, IThemeOnlyProps } from '../Utils/FluentUI/typings.fluent-ui';
import { IStylesOnly } from '../Utils/FluentUI/typings.fluent-ui';

interface AssignmentUpdateFailureMessageBarStyleProps {
fade: 'fadeIn' | 'fadeOut';
theme: ITheme;
}

const getErrorMessage = (error: ServiceError | null) => {
switch (error) {
Expand All @@ -29,7 +33,6 @@ const AssignmentUpdateFailureMessageBarInner = ({ styles }: IStylesOnly<IMessage
const assignmentStore = useStore('assignmentStore');
const assignmentLinksStore = useStore('assignmentLinksStore');
const learnStore = useStore('microsoftLearnStore');
const classes = themedClassNames(styles);

return useObserver(() => {
const learnStoreCallsInProgress =
Expand All @@ -42,9 +45,14 @@ const AssignmentUpdateFailureMessageBarInner = ({ styles }: IStylesOnly<IMessage
const hasError = learnStore.hasServiceError || assignmentStore.hasServiceError || assignmentLinksStore.hasServiceError;
const errorMessage = getErrorMessage(hasError);

if (!isCallInProgress && hasError !== null) {
const assignmentUpdateFailureMessageBarClass = classNamesFunction<AssignmentUpdateFailureMessageBarStyleProps, IMessageBarStyles>()(assignmentUpdateFailureMessageBarStyles, {
fade: isCallInProgress? 'fadeOut' : 'fadeIn',
theme: getTheme()
})

if (hasError !== null) {
return (
<MessageBar messageBarType={MessageBarType.warning} isMultiline={true} className={classes.root}>
<MessageBar messageBarType={MessageBarType.warning} isMultiline={true} styles={assignmentUpdateFailureMessageBarClass}>
{errorMessage}
</MessageBar>
);
Expand All @@ -54,11 +62,8 @@ const AssignmentUpdateFailureMessageBarInner = ({ styles }: IStylesOnly<IMessage
});
};

const assignmentUpdateFailureMessageBarStyles = ({ theme }: IThemeOnlyProps): Partial<IMessageBarStyles> => ({
root: [AnimationClassNames.fadeIn200]
const assignmentUpdateFailureMessageBarStyles = ({ fade, theme }: AssignmentUpdateFailureMessageBarStyleProps): Partial<IMessageBarStyles> => ({
root: [fade==='fadeIn'? AnimationClassNames.fadeIn500 : AnimationClassNames.fadeOut500]
});

export const AssignmentUpdateFailureMessageBar = styled(
AssignmentUpdateFailureMessageBarInner,
assignmentUpdateFailureMessageBarStyles
);
export const AssignmentUpdateFailureMessageBar = AssignmentUpdateFailureMessageBarInner