feat: add public employee profile view and implement ratings review page components
This commit is contained in:
@@ -62,6 +62,7 @@ export default function OrganizationEdit() {
|
||||
const [orgSlug, setOrgSlug] = useState("");
|
||||
const [showPublicScores, setShowPublicScores] = useState(true);
|
||||
const [showPublicOpinions, setShowPublicOpinions] = useState(true);
|
||||
const [showPublicProfessionals, setShowPublicProfessionals] = useState(true);
|
||||
const [servicesShowPublicScores, setServicesShowPublicScores] = useState(true);
|
||||
const [servicesShowPublicOpinions, setServicesShowPublicOpinions] = useState(true);
|
||||
const [originalServicesShowPublicScores, setOriginalServicesShowPublicScores] = useState(true);
|
||||
@@ -76,7 +77,7 @@ export default function OrganizationEdit() {
|
||||
|
||||
const [combosLoaded, setCombosLoaded] = useState<boolean>(false);
|
||||
const ownerSubscription = SessionInfo.organizationSubscriptions[id];
|
||||
const canEditPublicRatingFlags = (ownerSubscription?.plan.price || 0) > 0;
|
||||
const canEditPublicVisibilityFlags = (ownerSubscription?.plan.price || 0) > 0;
|
||||
|
||||
const [categoryFilterContent] = useState<TextObjectModalContent>({
|
||||
header: (
|
||||
@@ -242,6 +243,11 @@ export default function OrganizationEdit() {
|
||||
setOrgPublished(organization.published);
|
||||
setShowPublicScores(organization.showPublicScores !== undefined ? organization.showPublicScores : true);
|
||||
setShowPublicOpinions(organization.showPublicOpinions !== undefined ? organization.showPublicOpinions : true);
|
||||
setShowPublicProfessionals(
|
||||
organization.showPublicProfessionals !== undefined
|
||||
? organization.showPublicProfessionals
|
||||
: true
|
||||
);
|
||||
setServices(loadedServices);
|
||||
setServicesShowPublicScores(
|
||||
loadedServices.every((service) => service.showPublicScores !== false)
|
||||
@@ -302,10 +308,11 @@ export default function OrganizationEdit() {
|
||||
templateWapNotifId: templateWapNotifId === "" ? undefined : templateWapNotifId,
|
||||
templateWapAltaId: templateWapAltaId === "" ? undefined : templateWapAltaId,
|
||||
templateWapCancellationId: templateWapCancellationId === "" ? undefined : templateWapCancellationId,
|
||||
...(canEditPublicRatingFlags
|
||||
...(canEditPublicVisibilityFlags
|
||||
? {
|
||||
showPublicScores,
|
||||
showPublicOpinions,
|
||||
showPublicProfessionals,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
@@ -378,7 +385,7 @@ export default function OrganizationEdit() {
|
||||
const servicesShowPublicOpinionsChanged =
|
||||
originalServicesShowPublicOpinions !== servicesShowPublicOpinions;
|
||||
const changedServices =
|
||||
canEditPublicRatingFlags &&
|
||||
canEditPublicVisibilityFlags &&
|
||||
(servicesShowPublicScoresChanged || servicesShowPublicOpinionsChanged)
|
||||
? services
|
||||
: [];
|
||||
@@ -574,13 +581,18 @@ export default function OrganizationEdit() {
|
||||
/>
|
||||
|
||||
<MaterialAlert severity="info" sx={{ marginTop: "20px" }}>
|
||||
<b>Visibilidad pública:</b> Elegí si querés mostrar puntuaciones y opiniones en el perfil público y las páginas de reserva. Disponible para planes pagos.
|
||||
<b>Visibilidad pública:</b> Elegí si querés mostrar puntuaciones, opiniones y profesionales en el perfil público y las páginas de reserva. Disponible para planes pagos.
|
||||
</MaterialAlert>
|
||||
{!canEditPublicVisibilityFlags && (
|
||||
<MaterialAlert severity="warning" sx={{ marginTop: "10px" }}>
|
||||
Para modificar las opciones de visibilidad pública de opiniones, puntuaciones y profesionales de esta organización y sus servicios, el propietario de la organización necesita un plan pago.
|
||||
</MaterialAlert>
|
||||
)}
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: "10px", marginTop: "10px" }}>
|
||||
<label style={{ display: "flex", alignItems: "center", gap: "10px", fontWeight: 600 }}>
|
||||
<Checkbox
|
||||
checked={showPublicScores}
|
||||
disabled={!canEditPublicRatingFlags}
|
||||
disabled={!canEditPublicVisibilityFlags}
|
||||
onChange={(event) => {
|
||||
setShowPublicScores(event.target.checked);
|
||||
eventHandler.setEventType(EVENT_TYPES.NEED_SAVE);
|
||||
@@ -591,7 +603,7 @@ export default function OrganizationEdit() {
|
||||
<label style={{ display: "flex", alignItems: "center", gap: "10px", fontWeight: 600 }}>
|
||||
<Checkbox
|
||||
checked={showPublicOpinions}
|
||||
disabled={!canEditPublicRatingFlags}
|
||||
disabled={!canEditPublicVisibilityFlags}
|
||||
onChange={(event) => {
|
||||
setShowPublicOpinions(event.target.checked);
|
||||
eventHandler.setEventType(EVENT_TYPES.NEED_SAVE);
|
||||
@@ -599,7 +611,18 @@ export default function OrganizationEdit() {
|
||||
/>
|
||||
Mostrar opiniones públicas
|
||||
</label>
|
||||
{!canEditPublicRatingFlags && (
|
||||
<label style={{ display: "flex", alignItems: "center", gap: "10px", fontWeight: 600 }}>
|
||||
<Checkbox
|
||||
checked={showPublicProfessionals}
|
||||
disabled={!canEditPublicVisibilityFlags}
|
||||
onChange={(event) => {
|
||||
setShowPublicProfessionals(event.target.checked);
|
||||
eventHandler.setEventType(EVENT_TYPES.NEED_SAVE);
|
||||
}}
|
||||
/>
|
||||
Mostrar profesionales en el perfil público
|
||||
</label>
|
||||
{!canEditPublicVisibilityFlags && (
|
||||
<span style={{ color: "var(--gray-darkest)", fontSize: "13px" }}>
|
||||
Disponible para planes pagos.
|
||||
</span>
|
||||
@@ -622,7 +645,7 @@ export default function OrganizationEdit() {
|
||||
<label style={{ display: "flex", alignItems: "center", gap: "10px", fontWeight: 600 }}>
|
||||
<Checkbox
|
||||
checked={servicesShowPublicScores}
|
||||
disabled={!canEditPublicRatingFlags}
|
||||
disabled={!canEditPublicVisibilityFlags}
|
||||
onChange={(event) => {
|
||||
setServicesShowPublicScores(event.target.checked);
|
||||
eventHandler.setEventType(EVENT_TYPES.NEED_SAVE);
|
||||
@@ -633,7 +656,7 @@ export default function OrganizationEdit() {
|
||||
<label style={{ display: "flex", alignItems: "center", gap: "10px", fontWeight: 600 }}>
|
||||
<Checkbox
|
||||
checked={servicesShowPublicOpinions}
|
||||
disabled={!canEditPublicRatingFlags}
|
||||
disabled={!canEditPublicVisibilityFlags}
|
||||
onChange={(event) => {
|
||||
setServicesShowPublicOpinions(event.target.checked);
|
||||
eventHandler.setEventType(EVENT_TYPES.NEED_SAVE);
|
||||
@@ -641,7 +664,7 @@ export default function OrganizationEdit() {
|
||||
/>
|
||||
Mostrar opiniones públicas de los servicios
|
||||
</label>
|
||||
{!canEditPublicRatingFlags && (
|
||||
{!canEditPublicVisibilityFlags && (
|
||||
<span style={{ color: "var(--gray-darkest)", fontSize: "13px" }}>
|
||||
Para cambiar la visibilidad pública de los servicios necesitás un plan pago.
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user