IO-994 Generic user handling
This commit is contained in:
@@ -16,9 +16,9 @@ import {
|
|||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
import RenderTemplate from "../../utils/RenderTemplate";
|
import RenderTemplate from "../../utils/RenderTemplate";
|
||||||
import { EmailSettings } from "../../utils/TemplateConstants";
|
import { EmailSettings } from "../../utils/TemplateConstants";
|
||||||
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import EmailOverlayComponent from "./email-overlay.component";
|
import EmailOverlayComponent from "./email-overlay.component";
|
||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
modalVisible: selectEmailVisible,
|
modalVisible: selectEmailVisible,
|
||||||
@@ -48,7 +48,10 @@ export function EmailOverlayContainer({
|
|||||||
name: `${currentUser.displayName} @ ${bodyshop.shopname}`,
|
name: `${currentUser.displayName} @ ${bodyshop.shopname}`,
|
||||||
address: EmailSettings.fromAddress,
|
address: EmailSettings.fromAddress,
|
||||||
},
|
},
|
||||||
ReplyTo: { Email: currentUser.email, Name: currentUser.displayName },
|
ReplyTo: {
|
||||||
|
Email: currentUser.validemail ? currentUser.email : bodyshop.email,
|
||||||
|
Name: currentUser.displayName,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export const QUERY_BODYSHOP = gql`
|
|||||||
authid
|
authid
|
||||||
email
|
email
|
||||||
dashboardlayout
|
dashboardlayout
|
||||||
|
validemail
|
||||||
employee {
|
employee {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,6 +219,13 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
yield put(setAuthlevel(authRecord[0] ? authRecord[0].authlevel : 0));
|
yield put(setAuthlevel(authRecord[0] ? authRecord[0].authlevel : 0));
|
||||||
|
yield put(
|
||||||
|
updateUserDetailsSuccess(
|
||||||
|
authRecord[0]
|
||||||
|
? { validemail: authRecord[0].user.validemail }
|
||||||
|
: { validemail: false }
|
||||||
|
)
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
yield put(signInFailure(error.message));
|
yield put(signInFailure(error.message));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
- args:
|
||||||
|
cascade: false
|
||||||
|
read_only: false
|
||||||
|
sql: ALTER TABLE "public"."users" DROP COLUMN "validemail";
|
||||||
|
type: run_sql
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
- args:
|
||||||
|
cascade: false
|
||||||
|
read_only: false
|
||||||
|
sql: ALTER TABLE "public"."users" ADD COLUMN "validemail" boolean NOT NULL DEFAULT
|
||||||
|
true;
|
||||||
|
type: run_sql
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: drop_insert_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
check: {}
|
||||||
|
columns:
|
||||||
|
- authid
|
||||||
|
- email
|
||||||
|
- fcmtokens
|
||||||
|
set: {}
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: create_insert_permission
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: drop_insert_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
check: {}
|
||||||
|
columns:
|
||||||
|
- authid
|
||||||
|
- email
|
||||||
|
- fcmtokens
|
||||||
|
- validemail
|
||||||
|
set: {}
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: create_insert_permission
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: drop_select_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
allow_aggregations: false
|
||||||
|
columns:
|
||||||
|
- authid
|
||||||
|
- created_at
|
||||||
|
- dashboardlayout
|
||||||
|
- email
|
||||||
|
- fcmtokens
|
||||||
|
- updated_at
|
||||||
|
computed_fields: []
|
||||||
|
filter:
|
||||||
|
associations:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
active:
|
||||||
|
_eq: true
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: create_select_permission
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
- args:
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: drop_select_permission
|
||||||
|
- args:
|
||||||
|
permission:
|
||||||
|
allow_aggregations: false
|
||||||
|
columns:
|
||||||
|
- authid
|
||||||
|
- created_at
|
||||||
|
- dashboardlayout
|
||||||
|
- email
|
||||||
|
- fcmtokens
|
||||||
|
- updated_at
|
||||||
|
- validemail
|
||||||
|
computed_fields: []
|
||||||
|
filter:
|
||||||
|
associations:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
active:
|
||||||
|
_eq: true
|
||||||
|
role: user
|
||||||
|
table:
|
||||||
|
name: users
|
||||||
|
schema: public
|
||||||
|
type: create_select_permission
|
||||||
@@ -4156,6 +4156,7 @@ tables:
|
|||||||
- authid
|
- authid
|
||||||
- email
|
- email
|
||||||
- fcmtokens
|
- fcmtokens
|
||||||
|
- validemail
|
||||||
select_permissions:
|
select_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
@@ -4166,6 +4167,7 @@ tables:
|
|||||||
- email
|
- email
|
||||||
- fcmtokens
|
- fcmtokens
|
||||||
- updated_at
|
- updated_at
|
||||||
|
- validemail
|
||||||
filter:
|
filter:
|
||||||
associations:
|
associations:
|
||||||
bodyshop:
|
bodyshop:
|
||||||
|
|||||||
Reference in New Issue
Block a user