Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9f05490
handle introductory page view for users by tags
AlaaN-Smadi Mar 31, 2026
a50a331
set the new intro visibility enums in the constant file
AlaaN-Smadi Mar 31, 2026
c5df284
finalize cp dropdown
AlaaN-Smadi Mar 31, 2026
5f6a846
handle showing user's locations only in the introductory screen
AlaaN-Smadi Mar 31, 2026
96b1600
- add new settings section for custom location fields
AlaaN-Smadi Apr 1, 2026
d295110
add new content custom location fields
AlaaN-Smadi Apr 1, 2026
f309148
resolve css conflicts
AlaaN-Smadi Apr 1, 2026
3711423
set custom inputs max length
AlaaN-Smadi Apr 1, 2026
72be972
add new location custom fields inputs in widget create/edit location …
AlaaN-Smadi Apr 2, 2026
9ec4f17
add new custom fields validation, edit, and save in widget
AlaaN-Smadi Apr 2, 2026
4166ebb
- handle injecting custom actions and content to location details view
AlaaN-Smadi Apr 4, 2026
95ba733
- handle max number of custom fields
AlaaN-Smadi Apr 5, 2026
ef85ba6
handle real time sync of map position design with location details page
AlaaN-Smadi Apr 5, 2026
7c5de12
refactor code modularity
AlaaN-Smadi Apr 5, 2026
52f6ddb
refactor custom fields UI
AlaaN-Smadi Apr 5, 2026
189ed29
refactor custom field name placeholder
AlaaN-Smadi Apr 6, 2026
8ed0a08
refactor custom fields UI
AlaaN-Smadi Apr 6, 2026
10cc185
Merge pull request #63 from BuildFire/fix/global-js-files
mas-iota Apr 6, 2026
58a4023
reflect feedback from code review
AlaaN-Smadi Apr 7, 2026
cd36cd7
- scroll to focused input in create/edit location form
AlaaN-Smadi Apr 9, 2026
9a9d3c5
handle real time widget/cp sync in create/edit location form
AlaaN-Smadi Apr 9, 2026
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
17 changes: 14 additions & 3 deletions src/control/assets/bf_base.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ margin-bottom: .5em;
margin-bottom: 1.5rem;
margin-top: 0;
}
.section-subtitle {
color: var(--c-info);
font-size: 16px !important;
font-weight: 500;
}

.text-secondary {
color: var(--c-gray6);
Expand Down Expand Up @@ -160,8 +165,14 @@ span.required{
flex: auto;
}

.input-control.has-error input{
border: 1px solid var(--c-danger);
.has-error .form-control,
.input-control.has-error input {
border-color: var(--c-danger) !important;
}

#locationCustomFieldsContainer .custom-field-label {
border-color: var(--c-gray3) !important;
box-shadow: none !important;
}
.date__group input {
margin: 0 1.5rem;
Expand Down Expand Up @@ -573,7 +584,7 @@ p.info-note.info-note-transparent {
padding: 8px;
position: absolute;
font-size: 12px;
z-index: 2;
z-index: 1001;
bottom: 50%;
transform-origin: left;
pointer-events: none;
Expand Down
59 changes: 57 additions & 2 deletions src/control/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ p.info::before {
}

.list-image-holder {
width: 120px;
height: 80px;
width: 96px;
height: 96px;
}

.icon-holder img, .list-image-holder img {
Expand Down Expand Up @@ -316,3 +316,58 @@ p.info::before {
.radio input[type="radio"]:disabled + label {
cursor: default;
}

.dropdown-menu.dropup {
top: unset !important;
bottom: 100% !important;
margin-bottom: 2px;
}
.font-size-14 {
font-size: 14px;
}
.font-size-15 {
font-size: 15px;
}

.custom-field-section .add-field-btn {
text-align: left !important;
padding: 15px !important;
padding-left: 37px !important;
height: auto !important;
font-size: 15px !important;
color: var(--c-info) !important;
border: 1px dashed var(--c-gray4) !important;
border-radius: 8px;
position: relative;
}

.custom-field-section .add-field-btn::before {
content: "";
width: 1rem;
top: 50%;
transform: translateY(-50%);
left: 0.8rem;
display: inline-block;
height: 2px;
background-color: var(--c-info);
margin-right: .5rem;
position: absolute;
}

.custom-field-section .add-field-btn::after {
content: "";
width: 1rem;
top: 50%;
transform: translateY(-50%) rotate(90deg);
left: 0.8rem;
display: inline-block;
height: 2px;
background-color: var(--c-info);
margin-right: .5rem;
position: absolute;
}

.custom-field-section .d-item .icon-cross2::before {
font-size: 14px;
color: var(--c-gray5);
}
4 changes: 2 additions & 2 deletions src/control/content/content.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Categories from '../../repository/Categories';
import Settings from '../../repository/Settings';
import Categories from '../../widget/js/global/repository/Categories';
import Settings from '../../widget/js/global/repository/Settings';

export default {
getSettings() {
Expand Down
8 changes: 8 additions & 0 deletions src/control/content/css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "../../../../../../styles/siteIcons.css";
@import "../../../../../../styles/components/control/tagsInput/tagsInput.min.css";
@import "../../../../../styles/helper.css";
@import "../../assets/bf_base.css";
@import "../../assets/linearicons/cpIcons.css";
Expand Down Expand Up @@ -82,3 +84,9 @@ table#locations-items tbody {
opacity: 0.5;
cursor: not-allowed;
}

.intro-visibility-container {
display: flex;
flex-direction: column;
gap: 15px;
}
1 change: 1 addition & 0 deletions src/control/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<script src="../../../../scripts/buildfire/components/aiStateSeeder/aiStateSeeder.js"></script>
<script src="../../../../scripts/buildfire/services/searchEngine/searchEngine.js"></script>
<script src="../../../../scripts/buildfire/services/notifications/pushNotifications.js"></script>
<script src="../../../../scripts/buildfire/components/control/tagsInput/tagsInput.min.js"></script>
</head>
<body>
<div id="google-api-key-message" class="warning-message-container hidden">
Expand Down
2 changes: 1 addition & 1 deletion src/control/content/js/categories/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-loop-func */
/* eslint-disable no-restricted-syntax */
import Categories from '../../../../repository/Categories';
import Categories from '../../../../widget/js/global/repository/Categories';
import authManager from '../../../../UserAccessControl/authManager';
import Analytics from '../../../../utils/analytics';

Expand Down
7 changes: 4 additions & 3 deletions src/control/content/js/categories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import CategoriesController from "./controller";
import CategoriesListUI from "./categoriesListUI";
import SubcategoriesListUI from "./subcategoriesListUI";
import DialogComponent from "../dialog/dialog";
import Category from "../../../../entities/Category";
import { generateUUID, createTemplate, handleInputError, showProgressDialog } from "../../utils/helpers";
import Category from "../../../../widget/js/global/data/Category";
import { createTemplate, handleInputError, showProgressDialog } from "../../utils/helpers";
import { downloadCsv, jsonToCsv, csvToJson, readCSVFile } from "../../utils/csv.helper";
import globalState from '../../state';
import authManager from '../../../../UserAccessControl/authManager';
import { generateUUID } from "../../../../widget/js/global/helpers";

const state = {
categories: [],
Expand Down Expand Up @@ -105,7 +106,7 @@ const cropImage = (url, options) => {
if (!url) {
return "";
}
return buildfire.imageLib.cropImage(url, options);
return buildfire.imageLib.cropImage(url, options) + '&crop=entropy';
};

const setCategoryIcon = (icon, type) => {
Expand Down
2 changes: 1 addition & 1 deletion src/control/content/js/listView/controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Settings from '../../../../repository/Settings';
import Settings from '../../../../widget/js/global/repository/Settings';
import authManager from '../../../../UserAccessControl/authManager';

export default {
Expand Down
86 changes: 73 additions & 13 deletions src/control/content/js/listView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
/* eslint-disable no-use-before-define */
import SettingsController from "./controller";
import LocationsController from "../locations/controller";
import { generateUUID } from "../../utils/helpers";
import { generateUUID } from "../../../../widget/js/global/helpers";
import PinnedLocationsList from "./pinnedLocationsList";
import Location from "../../../../entities/Location";
import Location from "../../../../widget/js/global/data/Location";
import loadAreaRadiusMap from "./introMap";
import state from "../../state";
import constants from "../../../../widget/js/constants";
import constants from "../../../../widget/js/global/constants";
import BaseDropdown from "../../../../shared/baseDropdown";

const listViewSection = document.querySelector("#main");

Expand All @@ -35,40 +36,76 @@ const initListViewWysiwyg = () => {
});
};

window.onShowListViewChanged = (e) => {
state.settings.showIntroductoryListView = e.target.checked;
window.onShowListViewChanged = (value) => {
state.settings.introductoryListView.visibilityOptions.value = value;
saveSettingsWithDelay();

const introVisibilityTagsSelection = document.querySelector("#introVisibilityTagsSelection");
if (value === constants.IntroViewVisibilityOptions.TAGS) {
introVisibilityTagsSelection?.classList?.remove('hidden');
} else {
introVisibilityTagsSelection?.classList?.add('hidden');
}
};

window.onSortLocationsChanged = (sorting) => {
const onSortLocationsChanged = (sorting) => {
if (!sorting) {
return;
}
state.settings.introductoryListView.sorting = sorting;
state.settings.introductoryListView.sorting = sorting.value;
saveSettingsWithDelay();
};

window.onShowLocationsModeChanged = (showMode) => {
const onShowLocationsModeChanged = (showMode) => {
const areaRadiusOptionsContainer = document.querySelector("#areaRadiusOptionsContainer");
if (showMode === constants.SearchLocationsModes.AreaRadius) {
if (showMode.value === constants.SearchLocationsModes.AreaRadius) {
areaRadiusOptionsContainer?.classList?.remove('hidden');
} else {
areaRadiusOptionsContainer?.classList?.add('hidden');
}
const locationSourceNote = document.querySelector("#locationSourceNote");
if (showMode.value === constants.SearchLocationsModes.MyLocations) {
locationSourceNote?.classList?.remove('hidden');
} else {
locationSourceNote?.classList?.add('hidden');
}

if (state.settings.introductoryListView.searchOptions) {
state.settings.introductoryListView.searchOptions.mode = showMode;
state.settings.introductoryListView.searchOptions.mode = showMode.value;
} else {
state.settings.introductoryListView.searchOptions = { mode: showMode };
state.settings.introductoryListView.searchOptions = { mode: showMode.value };
}

saveSettingsWithDelay();
};

const initIntroDropDowns = () => {
const sourceDropdown = new BaseDropdown('#locationsSourceDropdown', {
items: [
{ label: 'All Locations', value: constants.SearchLocationsModes.All, id: constants.SearchLocationsModes.All },
{ label: "User's Position", value: constants.SearchLocationsModes.UserPosition, id: constants.SearchLocationsModes.UserPosition },
{ label: 'Local Area', value: constants.SearchLocationsModes.AreaRadius, id: constants.SearchLocationsModes.AreaRadius },
{ label: 'My Locations', value: constants.SearchLocationsModes.MyLocations, id: constants.SearchLocationsModes.MyLocations }
],
dropToTop: true,
selectedId: state.settings.introductoryListView.searchOptions?.mode || constants.SearchLocationsModes.All,
handleSelect: onShowLocationsModeChanged,
});

const sortDropdown = new BaseDropdown('#sortLocationsDropdown', {
items: [
{ label: 'Distance', value: constants.SortingOptions.Distance, id: constants.SortingOptions.Distance },
{ label: 'Alphabetical', value: constants.SortingOptions.Alphabetical, id: constants.SortingOptions.Alphabetical },
{ label: 'Newest', value: constants.SortingOptions.Newest, id: constants.SortingOptions.Newest }
],
dropToTop: true,
selectedId: state.settings.introductoryListView.sorting || constants.SortingOptions.Distance,
handleSelect: onSortLocationsChanged,
});
}

const patchListViewValues = () => {
console.log(state.settings.introductoryListView.images);
const showBtn = listViewSection.querySelector('#listview-show-introduction-btn');
showBtn.checked = state.settings.showIntroductoryListView;
listViewImagesCarousel.loadItems(state.settings.introductoryListView.images);
const sortRadioBtns = listViewSection.querySelectorAll('input[name="sortLocationBy"]');
for (const radio of sortRadioBtns) {
Expand All @@ -82,6 +119,29 @@ const patchListViewValues = () => {
radio.checked = true;
}
}
const introVisibilityRadioBtns = listViewSection.querySelectorAll('input[name="introVisibility"]');
for (const radio of introVisibilityRadioBtns) {
if (radio.value === state.settings.introductoryListView.visibilityOptions?.value) {
radio.checked = true;
if (radio.value === constants.IntroViewVisibilityOptions.TAGS) {
const introVisibilityTagsSelection = document.querySelector("#introVisibilityTagsSelection");
introVisibilityTagsSelection?.classList?.remove('hidden');
}
}
}

const userTagsInput = new buildfire.components.control.userTagsInput("#introVisibilityTagsSelection", {
languageSettings: {
placeholder: "User Tags"
}
});
userTagsInput.onUpdate = (data) => {
state.settings.introductoryListView.visibilityOptions.tags = data.tags;
saveSettingsWithDelay();
}
userTagsInput.append(state.settings.introductoryListView.visibilityOptions.tags);

initIntroDropDowns();
};

const handlePinnedLocationEmptyState = (isLoading) => {
Expand Down
7 changes: 6 additions & 1 deletion src/control/content/js/listView/introMap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable max-len */
import state from "../../state";
import { isCameraControlVersion } from "../../../../shared/utils/mapUtils";
import constants from "../../../../widget/js/global/constants";

const convertMileToMeter = (distanceInMiles) => {
if (typeof distanceInMiles === "number") {
Expand Down Expand Up @@ -180,9 +181,13 @@ const setGoogleMapsScript = (key) => {

const loadAreaRadiusMap = () => {
const areaRadiusOptionsContainer = document.querySelector("#areaRadiusOptionsContainer");
if (state.settings.introductoryListView.searchOptions && state.settings.introductoryListView.searchOptions.mode === "AreaRadius") {
if (state.settings.introductoryListView.searchOptions && state.settings.introductoryListView.searchOptions.mode === constants.SearchLocationsModes.AreaRadius) {
areaRadiusOptionsContainer?.classList?.remove('hidden');
}
const locationSourceNote = document.querySelector("#locationSourceNote");
if (state.settings.introductoryListView.searchOptions.mode && state.settings.introductoryListView.searchOptions.mode === constants.SearchLocationsModes.MyLocations) {
locationSourceNote?.classList?.remove('hidden');
}
buildfire.getContext((error, context) => {
setGoogleMapsScript(context.apiKeys.googleMapKey);
});
Expand Down
8 changes: 4 additions & 4 deletions src/control/content/js/locations/controller.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable max-len */
import Location from '../../../../repository/Locations';
import Location from '../../../../widget/js/global/repository/Locations';
import Analytics from '../../../../utils/analytics';
import DeepLink from '../../../../utils/deeplink';
import SearchEngine from '../../../../repository/searchEngine';
import SearchEngine from '../../../../widget/js/global/repository/searchEngine';
import authManager from '../../../../UserAccessControl/authManager';
import { generateUUID } from '../../utils/helpers';
import Settings from '../../../../repository/Settings';
import { generateUUID } from '../../../../widget/js/global/helpers';
import Settings from '../../../../widget/js/global/repository/Settings';

export default {
createLocation(location) {
Expand Down
Loading