Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
61a314d
added languages and settings tab
pierrekamel5 May 9, 2023
588fa14
Fixes in settings tab
pierrekamel5 May 9, 2023
372d425
added tests for settings and fixes in settings ui
pierrekamel5 May 9, 2023
255ec8d
added skeleton and fix empty image
pierrekamel5 May 10, 2023
c25c3a8
changed alert to drawer for votes and fixes
pierrekamel5 May 10, 2023
412e088
update suggestion model
pierrekamel5 May 10, 2023
3bf1eb3
switched popup to input components when adding new suggestion and cod…
pierrekamel5 May 10, 2023
4e1a5ab
card ui changes and push notification added
pierrekamel5 May 12, 2023
336ce3a
added page details and code changes
pierrekamel5 May 15, 2023
280b970
code fixing
pierrekamel5 May 16, 2023
ff0cd2a
code fixing and settings sync
pierrekamel5 May 16, 2023
7ce4cd8
Removing introduction from language
pierrekamel5 May 16, 2023
17481c4
removed introduction from language tab and code fixes
pierrekamel5 May 17, 2023
a96fb12
added tooltip for settings and camera for input components and fix er…
pierrekamel5 Jun 1, 2023
40ae543
fix bugs and reflect changes
pierrekamel5 Jun 5, 2023
e40eeee
fix bugs
pierrekamel5 Jun 6, 2023
75f79dc
fix dialogs when creating new item
pierrekamel5 Jun 6, 2023
60ffc67
UI fixes
pierrekamel5 Jun 7, 2023
398707b
sort item by date and fix bugs
pierrekamel5 Jun 7, 2023
d2a19ea
fix push notificaiton for user tags
pierrekamel5 Jun 7, 2023
6cc87f5
fix font-weight for title
pierrekamel5 Jun 7, 2023
67fa975
Added spacing betwen comment and icon
pierrekamel5 Jun 7, 2023
4407761
Added spacing betwen comment and icon
pierrekamel5 Jun 7, 2023
f188be1
fix gulp errors
pierrekamel5 Jun 7, 2023
91c9463
bug fixes
pierrekamel5 Jun 8, 2023
b2bd222
removed full screen in wyziwyg
pierrekamel5 Jun 8, 2023
3c29ec9
fixing ui issues
pierrekamel5 Jun 9, 2023
fa64189
add tags component and fix bugs
pierrekamel5 Jun 9, 2023
f8659a2
fix navigate to item details when clicking from notification if app i…
pierrekamel5 Jun 11, 2023
d09630a
fixing bugs
pierrekamel5 Jun 12, 2023
5317dd6
fix header content html
pierrekamel5 Jun 13, 2023
41211b6
bug fixes
pierrekamel5 Jun 15, 2023
15f37e6
Remove encoding from headercontenthtml
pierrekamel5 Jun 15, 2023
bd4d3f1
fixed user upvote on item details when status completed
pierrekamel5 Jun 19, 2023
f95ca20
Added max length when creating item for title property
pierrekamel5 Jun 19, 2023
0a0cd03
fix text not appearing when going to settings tab
pierrekamel5 Jun 19, 2023
d2585c7
Added upvotebyyou property as true when adding new item
pierrekamel5 Jun 19, 2023
0bd15d4
fix plugin name
pierrekamel5 Jun 19, 2023
72adcdb
removed gulpfile.zip file
pierrekamel5 Jun 19, 2023
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
13 changes: 8 additions & 5 deletions control/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
<!-- JS -->
<script src="../../../../scripts/buildfire.min.js"></script>
<!-- build:bundleJSFiles -->
<script src="../../widget/js/Analytics.js"></script>
<script src="../../widget/js/analyticsKeys.js"></script>
<script src="../../widget/assets/js/Analytics.js"></script>
<script src="../../widget/assets/js/analyticsKeys.js"></script>
<!-- endbuild -->

<!-- WYSIWYG -->
<script src="../../../../scripts/tinymce/tinymce.min.js"></script>


<link href="../../../../styles/control/bf-base.css" rel="stylesheet">
<script>
Analytics.init();

Expand Down Expand Up @@ -51,7 +53,6 @@

data = obj.data;
tinymce.activeEditor.setContent(obj.data.text);
tinymce.activeEditor.execCommand('mceFullScreen');
});
});
editor.on("keyup", function (saveWithDelay) {
Expand Down Expand Up @@ -85,10 +86,12 @@
</head>

<body>


<div>
<h1>Introduction</h1>
<textarea id="text" ui-tinymce="editorOptions" class="form-control" rows="5" width="100%" height="300px"></textarea>

</div>


<script>
function save(data) {
Expand Down
164 changes: 164 additions & 0 deletions control/settings/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@

const commentInput = document.getElementById("comments")
const allowAllUsersStatusUpdate = document.getElementById("statusUpdateAllUsers")
const allowNoUsersStatusUpdate = document.getElementById("statusUpdateNoUsers")
const allowUsersWithStatusUpdate = document.getElementById("statusUpdateUsersWith")

const itemPushNotificationAllUsers = document.getElementById("pushNotificationAllUsers")
const itemPushNotificationNoUsers = document.getElementById("pushNotificationNoUsers")
const itemPushNotificationUsersWith = document.getElementById("pushNotificationUsersWith")
const userTagsContainer = document.getElementById("userTagsContainer")
const itemPushNotificationTagsContainer = document.getElementById("itemPushNotificationTagsContainer")


const statusUpdatetagsInputContainer = new buildfire.components.control.tagsInput("#statusUpdatetagsInputContainer", {
languageSettings:{
placeholder: "Select Tags",
},
settings:{
sourceType: 'custom',
source: (options, callback) => {
buildfire.auth.showTagsSearchDialog(null, (err, result) => {
if (err) return console.log(err);

if (result && result.length) {
let allTags = result.map(tag => ({value: tag.tagName}));
settings.statusUpdateTags = result;
save();
callback(allTags);
}
});
},
allowAutoComplete: true,
allowUserInput: true,
}
});
const pushNotificationtagsInputContainer = new buildfire.components.control.tagsInput("#pushNotificationtagsInputContainer", {
languageSettings:{
placeholder: "Select Tags",
},
settings:{
sourceType: 'custom',
source: (options, callback) => {
buildfire.auth.showTagsSearchDialog(null, (err, result) => {
if (err) return console.log(err);

if (result && result.length) {
let allTags = result.map(tag => ({value: tag.tagName}));
settings.pushNotificationTags = result;
save();
callback(allTags);
}
});
},
allowAutoComplete: true,
allowUserInput: true,
}
});

statusUpdatetagsInputContainer.onUpdate = (data) => {
settings.statusUpdateTags = data.tags;

save();
}

pushNotificationtagsInputContainer.onUpdate = (data) => {
settings.pushNotificationTags = data.tags;
save();
}

var settings = {}


const init = () => {
Settings.get((err, result)=>{
settings = result;
if(result.enableComments){
commentInput.checked = true;
}
setCheckedInputAllowUsersStatus(result.statusUpdateUsersSegment)
setCheckedInputItemPushNotification(result.pushNotificationUsersSegment)

if(settings.statusUpdateTags && settings.statusUpdateTags.length){
statusUpdatetagsInputContainer.set(settings.statusUpdateTags);
}
if(settings.pushNotificationTags && settings.pushNotificationTags.length){
pushNotificationtagsInputContainer.set(settings.pushNotificationTags);
}
showUsersTagsContainer();
showItemPushNotificationTagsContainer();
})
}

const showUsersTagsContainer = () => {
userTagsContainer.style.display = allowUsersWithStatusUpdate.checked ? "block" : "none"
}
const showItemPushNotificationTagsContainer = () => {
itemPushNotificationTagsContainer.style.display = itemPushNotificationUsersWith.checked ? "block" : "none"
}

const setCheckedInputAllowUsersStatus = (status) => {
switch (status) {
case STATUS_UPDATE_SEGMENT.ALL_USERS:
allowAllUsersStatusUpdate.checked = true;
break;
case STATUS_UPDATE_SEGMENT.NO_USERS:
allowNoUsersStatusUpdate.checked = true;
break;
case STATUS_UPDATE_SEGMENT.TAGS:
allowUsersWithStatusUpdate.checked = true;
break;
default:
allowNoUsersStatusUpdate.checked = true;
break;
}

showUsersTagsContainer();
}

const setCheckedInputItemPushNotification = (status) => {
switch (status) {
case PUSH_NOTIFICATIONS_SEGMENT.ALL_USERS:
itemPushNotificationAllUsers.checked = true;
break;
case PUSH_NOTIFICATIONS_SEGMENT.NO_USERS:
itemPushNotificationNoUsers.checked = true;
break;
case PUSH_NOTIFICATIONS_SEGMENT.TAGS:
itemPushNotificationUsersWith.checked = true;
break;
default:
itemPushNotificationNoUsers.checked = true;
break;
}

showItemPushNotificationTagsContainer();
}

const updateCommentsProperty = () => {
settings.enableComments = commentInput.checked;
save();
}

const changeStatusUpdate = (status) => {
setCheckedInputAllowUsersStatus(status)
settings.statusUpdateUsersSegment = status;
save();
}

const changeItemPushNotification = (status) => {
setCheckedInputItemPushNotification(status)
settings.pushNotificationUsersSegment = status;
save();
}

const save = () => {
Settings.save(settings,()=>{})

buildfire.messaging.sendMessageToWidget({
type: 'UpdateSettings',
data: settings
});
}

init();
138 changes: 138 additions & 0 deletions control/settings/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="../../../../styles/helper.css" rel="stylesheet" />
<link rel="stylesheet" href="../assets/control.css" />
<link href="../../../../styles/control/bf-base.css" rel="stylesheet" />
<link href="./styles.css" rel="stylesheet" />
<link href="../../../../styles/control/siteIcons-control.css" rel="stylesheet" />
<script src="../../../../scripts/buildfire.min.js"></script>
<!-- build:bundleJSFiles -->
<script src="../../widget/assets/js/settings.js"></script>
<!-- endbuild -->


<link href="../../../../styles/components/control/tagsInput/tagsInput.min.css" rel="stylesheet"/>

<script src="../../../../scripts/buildfire/components/control/tagsInput/tagsInput.min.js"></script>
</head>

<body>
<div class="settings-container">


<div class="row margin-bottom-sixteen">

<div class="item clearfix row flex-center">
<div class="labels col-md-4 pull-left tooltip-container">
<span>Comments</span>
<span class="tip btn-info-icon btn-primary"><span class="cp-tooltip">Enabling this option allows users to leave comments on items that have been upvoted. To make this work, you must have the Community Wall feature installed</span>
</div>
<div class="main col-md-8 button-switch">
<input id="comments" type="checkbox" onchange="updateCommentsProperty()"/>
<label for="comments" class="label-success"></label>
</div>
</div>
</div>
<div class="row margin-bottom-sixteen flex-center">
<div class="labels col-md-4 pull-left tooltip-container">
<span>Allow Status Update</span>
<span class="tip btn-info-icon btn-primary"><span class="cp-tooltip">Specify who has permission to mark items as completed</span>
</div>
<div class="main col-md-7 pull-right padding-lr-6">
<span class="radios-row">
<div class="radio radio-primary radio-inline">
<input
id="statusUpdateAllUsers"
type="radio"
name="allowStatusUpdate"
onchange="changeStatusUpdate(1)"
/>
<label class="subtitles-labels" for="statusUpdateAllUsers">All Users</label>
</div>
<div class="radio radio-primary radio-inline">
<input
id="statusUpdateNoUsers"
type="radio"
name="allowStatusUpdate"
onchange="changeStatusUpdate(2)"
/>
<label class="subtitles-labels" for="statusUpdateNoUsers">No Users</label>
</div>
<div class="radio radio-primary radio-inline">
<input
id="statusUpdateUsersWith"
type="radio"
name="allowStatusUpdate"
onchange="changeStatusUpdate(3)"
/>
<label class="subtitles-labels" for="statusUpdateUsersWith">Users With</label>
</div>
</span>
</div>
</div>
<div class="row" id="userTagsContainer" style="margin: 20px 0;padding: 0 !important;">
<div class="col-md-4"></div>
<div class="user-tag-container col-md-8">
<div style="display:flex;width:100%;height: fit-content;">
<label class="user-tag-title" >User Tags</label>
<div id="statusUpdatetagsInputContainer"></div>
</div>
</div>
</div>


<div class="row margin-bottom-sixteen flex-center" >
<div class="labels col-md-4 pull-left tooltip-container">
<span>Allow new item Push notification</span>
<span class="tip btn-info-icon btn-primary"><span class="cp-tooltip">Specify who should receive push notifications whenever a new item is created</span>

</div>
<div class="main col-md-7 pull-right padding-lr-6">
<span class="radios-row">
<div class="radio radio-primary radio-inline">
<input
id="pushNotificationAllUsers"
type="radio"
name="pushNotificationTags"
onchange="changeItemPushNotification(1)"
/>
<label class="subtitles-labels" for="pushNotificationAllUsers">All Users</label>
</div>
<div class="radio radio-primary radio-inline">
<input
id="pushNotificationNoUsers"
type="radio"
name="pushNotificationTags"
onchange="changeItemPushNotification(2)"
/>
<label class="subtitles-labels" for="pushNotificationNoUsers">No Users</label>
</div>
<div class="radio radio-primary radio-inline">
<input
id="pushNotificationUsersWith"
type="radio"
name="pushNotificationTags"
onchange="changeItemPushNotification(3)"
/>
<label class="subtitles-labels" for="pushNotificationUsersWith">Users With</label>
</div>
</span>
</div>
</div>
<div class="row" id="itemPushNotificationTagsContainer"
style="margin: 20px 0;padding: 0 !important;">
<div class="col-md-4"></div>
<div class="user-tag-container col-md-8">
<div style="display:flex;width:100%;height: fit-content;">
<label class="user-tag-title" >User Tags</label>
<div id="pushNotificationtagsInputContainer"></div>
</div>
</div>
</div>
</div>
</body>

<script src="./app.js"></script>
</html>
Loading