How to use the office-ui-fabric-react/lib/MessageBar.MessageBarType.success function in office-ui-fabric-react

To help you get started, we’ve selected a few office-ui-fabric-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DariuS231 / ChromeSPDevTools / src / scripts / actions / spSiteContent / actions / spSiteContentActions.ts View on Github external
return async (dispatch: Dispatch>) => {
        try {
            dispatch(setWorkingOnIt(true));
            const result = await api.setAttachments(item);
            if (result) {
                const msg = `Users ${(!item.enableAttachments ? "CAN" : "CAN NOT")}
                 attach files to items in this list ${item.title}.`;
                const messageData = {
                    message: msg,
                    showMessage: true,
                    type: MessageBarType.success
                } as IMessageData;
                dispatch(getAllSiteContent(messageData));
            } else {
                throw new Error("Error setAttachments returned false");
            }
        } catch (error) {
            // tslint:disable-next-line:no-console
            console.log(error);
            dispatch(setMessageData({
                message: constants.ERROR_MESSAGE_SET_LIST_ATTACHMENTS_ENABLE,
                showMessage: true,
                type: MessageBarType.error
            }));
        }
    };
};
github ryanelian / instapack / templates / react / client / js / components / Hello.tsx View on Github external
render(): JSX.Element {
        return Hello from {this.props.compiler} and {this.props.framework}!
    }
}
github DariuS231 / ChromeSPDevTools / src / scripts / actions / spPropertyBag / reducers / spPropertyBagReducer.ts View on Github external
};
        case actions.UPDATE_PROPERTY:
            const updtdPropperty: IProperty = action.payload;
            const filtered = state.webProperties.map((prop: IProperty) => {
                if (prop.key === updtdPropperty.key) {
                    return updtdPropperty;
                } else {
                    return prop;
                }
            });
            return {
                ...state, isWorkingOnIt: false,
                messageData: {
                    message: constants.MESSAGE_PROPERTY_UPDATED,
                    showMessage: true,
                    type: MessageBarType.success
                },
                webProperties: filtered
            };
        case actions.SET_ALL_PROPERTIES:
            const properties: IProperty[] = action.payload;
            return { ...state, isWorkingOnIt: false, webProperties: properties };
        case actions.SET_FILTER_TEXT:
            const filterText: string = action.payload;
            return { ...state, filterText };
        case actions.SET_MESSAGE_DATA:
            const messageData: IMessageData = action.payload;
            return { ...state, messageData };
        case actions.SET_USER_PERMISSIONS:
            const userHasPermission: boolean = action.payload;
            return { ...state, userHasPermission };
        case actions.SET_WORKING_ON_IT:
github OfficeDev / office-ui-fabric-react / packages / azure-themes / src / azure / styles / MessageBar.styles.ts View on Github external
const IconButtonStyles = (props: IMessageBarStyleProps): IStyle => {
  const { theme, messageBarType } = props;
  const semanticColors = theme.semanticColors as IExtendedSemanticColors;

  return [
    (messageBarType === MessageBarType.error || messageBarType === MessageBarType.severeWarning) &&
      generateBaseStyle(semanticColors.statusErrorBackground, semanticColors.statusErrorText),

    messageBarType === MessageBarType.info &&
      generateBaseStyle(semanticColors.statusInformationBackground, semanticColors.statusInformationText),

    messageBarType === MessageBarType.success &&
      generateBaseStyle(semanticColors.statusSuccessBackground, semanticColors.statusSuccessText),

    (messageBarType === MessageBarType.warning || messageBarType === MessageBarType.blocked) &&
      generateBaseStyle(semanticColors.statusWarningBackground, semanticColors.statusWarningText),

    !messageBarType && generateBaseStyle(semanticColors.bodyBackground, semanticColors.bodyText)
  ];
};
github DariuS231 / ChromeSPDevTools / src / scripts / actions / spFeatures / reducers / spFeaturesReducer.ts View on Github external
export const spFeaturesReducer = (state: IInitialState = initialState, action: IAction): IInitialState => {
    const getFeatureUpdatedMessage = (feature: IFeature): string => {
        return "The web feature " + feature.name + " has been " + (!feature.activated ? "Activated" : "Deactivated");
    };
    switch (action.type) {
        case actions.SET_SITE_FEATURES_AFTER_UPDATE:
            const fSiteFeatures: IFeature[] = action.payload.features;
            const fSiteFeature: IFeature = action.payload.feature;

            return {
                ...state,
                isWorkingOnIt: false,
                messageData: {
                    message: getFeatureUpdatedMessage(fSiteFeature),
                    showMessage: true,
                    type: MessageBarType.success
                },
                siteFeatures: fSiteFeatures
            };
        case actions.SET_WEB_FEATURES_AFTER_UPDATE:
            const fWebFeatures: IFeature[] = action.payload.features;
            const fWebFeature: IFeature = action.payload.feature;

            return {
                ...state,
                isWorkingOnIt: false,
                messageData: {
                    message: getFeatureUpdatedMessage(fWebFeature),
                    showMessage: true,
                    type: MessageBarType.success
                },
                webFeatures: fWebFeatures