-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
browser: add last modification and document status at the bottom #4531
base: master
Are you sure you want to change the base?
Conversation
and there are other details that maybe I can help with |
Hi Pedro, Thanks for your review!
Indeed there is an issue with that empty div. It should be fixed.
I know that this is a design change but we think that it looks better and this is what we have in our version :). If you have suggestions or any other improvements then go ahead! I'm open to any suggestions/fixes! Thanks! |
browser/css/cool.css
Outdated
|
||
#tb_actionbar_item_right { | ||
text-align: right; | ||
} | ||
#saved-status-label { | ||
background-image: url("data:image/svg+xml,%3Csvg id='Icons' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%235cb82a;%7D.cls-2%7Bfill:%23fff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3E_%3C/title%3E%3Cg id='Funktions-Icons_24' data-name='Funktions-Icons 24'%3E%3Ccircle class='cls-1' cx='10' cy='10' r='10'/%3E%3Crect class='cls-2' x='3.36' y='10.52' width='6.75' height='2.5' rx='0.5' ry='0.5' transform='translate(10.29 -1.31) rotate(45)'/%3E%3Crect class='cls-2' x='5.63' y='8.75' width='11.75' height='2.5' rx='0.5' ry='0.5' transform='translate(-3.7 11.06) rotate(-45)'/%3E%3C/g%3E%3C/svg%3E"); | ||
background-position: left center; | ||
background-repeat: no-repeat; | ||
padding-left: 18px; | ||
margin-left: 15px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to place this near to the other #toolbar-down rules at: browser/css/toolbar.css
}, | ||
{name: _('Last modification'), id: 'last-mod', type: 'action', tablet: false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some integrators and users are avoiding the use of statusbar (by hiding it be that to save vertical space, because they might not use those features or simply for personal taste) and thus I think it would be cool to instead of removing this altogether for everyone to, make it an option within the xml.
@@ -53,6 +53,7 @@ | |||
<group_download_as desc="If set to true, groups download as icons into a dropdown for the notebookbar view." type="bool" default="false">false</group_download_as> | |||
<out_of_focus_timeout_secs desc="The maximum number of seconds before dimming and stopping updates when the browser tab is no longer in focus. Defaults to 120 seconds." type="uint" default="120">120</out_of_focus_timeout_secs> | |||
<idle_timeout_secs desc="The maximum number of seconds before dimming and stopping updates when the user is no longer active (even if the browser is in focus). Defaults to 15 minutes." type="uint" default="900">900</idle_timeout_secs> | |||
<min_saved_message_timeout_secs type="uint" desc="The minimum number of seconds before the last modified message is being displayed." default="6">6</min_saved_message_timeout_secs> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow that's nice!
As in the Notebookbar layout there is no last-mod string, it will be an improvement to have it in the statusbar. And as I'm for no specific cases, if not explicit needed. We can talk about if the statusbar is hidden, the last-mod was shown, BUT there is also the save button which indicate you, that your document is saved or not. So from my point, no duplicated strings and keep it simple. |
b233469
to
3196881
Compare
Hi Gabriel - do you think you can rescue this ? it's very old and we're trying to dung out our old, unresponsive pull requests. Looks like a pretty feature, can we get it in ? =) |
Hi Michael, |
@gmasei11 awesome, good to hear, let me know if there is anything I can help with |
hello 🙋 @gmasei11 I wanted to check in and see how things are going with the task. Have you made any progress or encountered any complications? If you need any assistance, please feel free to reach out. |
Hi @Darshan-upadhyay1110 |
Hi there, I finally started to look into this PR :). A question: should I make it optional within coolwsd.xml ? |
We could have a UI setting for it in the post-message as an option I guess =) some people don't like the status bar for whatever reason - annoyingly then the integration can decide :-) |
https://sdk.collaboraonline.com/docs/postmessage_api.html Users settings are stored in localstorage, you can mimic what we do with |
also worth to mention: https://sdk.collaboraonline.com/docs/theming.html#user-interface-modifications I would prefer to not add additional coolwsd.xml option - as it is a global setting (not per-user) and will only complicate decision-making if we should show the statusbar :) |
3196881
to
503b40f
Compare
Uploaded an initial rework of the Alexandru's patch without making the feature optional for now. It's been a while since then... @eszkadev Could you confirm (or not) if the approach is the right one ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
but in longer run it would be good to move things to separate files (other than Map.js which we plan to reduce), at least the widget code,
thank you for the update! :)
browser/src/map/Map.js
Outdated
@@ -424,6 +453,37 @@ L.Map = L.Evented.extend({ | |||
}, | |||
|
|||
initializeModificationIndicator: function() { | |||
this._docStatusUI = document.getElementById('documentstatus'); | |||
if (this._docStatusUI !== null && this._docStatusUI !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to extract that widget into separate file (not Map.js)
it's inserted to Statusbar as customitem
we can create "widget factory method" like other widgets
also there is mechanism to update the widget there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for update: please see example of onPageChange(e)
in StatusBar.js
for creation of html for a widget: this._generateHtmlItem('statepagenumber'),
which produces widget of type htmlcontent
and it's content is generated in https://github.com/CollaboraOnline/online/blob/master/browser/src/control/jsdialog/Widget.HTMLContent.ts#L121
so would be good to follow the same approach as other widgets and encapsulate a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) This is funny. My first implementation was exactly as you are suggesting. However, I didn't like that updateWidget recreates the whole content of the widget every time there is a change in its content. But if this is the approach that you prefer then I'm OK with it. Just a question: should I also use updateWidget every time the "Last saved" information changes or I can save the element in a data member and just change the text (as it is now) ? Of course, I will use updateWidget for all the other cases (like switching from "Saving..." to "Document Saved").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to extract that widget into separate file (not Map.js)
it's inserted to Statusbar as
customitem
we can create "widget factory method" like other widgets also there is mechanism to update the widget there
A completely new file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to extract that widget into separate file (not Map.js)
A completely new file ?
no, it's fine just to move to the other files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) This is funny. My first implementation was exactly as you are suggesting. However, I didn't like that updateWidget recreates the whole content of the widget every time there is a change in its content. But if this is the approach that you prefer then I'm OK with it. Just a question: should I also use updateWidget every time the "Last saved" information changes or I can save the element in a data member and just change the text (as it is now) ? Of course, I will use updateWidget for all the other cases (like switching from "Saving..." to "Document Saved").
I also don't like that, but for now it will be the best, as later we can rework all of them at once.
The reason is: we have rules of how our "JSDialog" framework works, any hacks to optimize something may lead to worse state.
We have "actions" which can do just a text modification, but let's not overcomplicate now. We need to rework all of the HTMLContent widgets anyway (as it is just an adapter for legacy widgets to JSDialogs)
@@ -479,7 +543,12 @@ L.Map = L.Evented.extend({ | |||
timeout = 60000; | |||
} | |||
|
|||
this.lastModIndicator.innerHTML = dateValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also could do this.fire('lastmodificationupdate', some data)
- then we can handle it in many places by:
map.on('lastmodificationupdate', this.someHandlerFunction, this);
so someHandlerFunction
will do the job - without tight coupling the code
browser/src/map/Map.js
Outdated
@@ -347,6 +351,31 @@ L.Map = L.Evented.extend({ | |||
|
|||
// end of A11y | |||
|
|||
// can be '', 'SAVING', 'MODIFIED' or 'SAVED' | |||
setDocumentStatus: function(status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be moved to StatusBar.js as a handler for a fire
signal on last mod status update
@@ -242,6 +242,7 @@ class StatusBar extends JSDialog.Toolbar { | |||
this._generateHtmlItem('permissionmode'), // spreadsheet, text, presentation | |||
{type: 'toolitem', id: 'signstatus', command: '.uno:Signature', w2icon: '', text: _UNO('.uno:Signature'), visible: false}, | |||
{type: 'spacer', id: 'permissionspacer'}, | |||
{type: 'customtoolitem', id: 'documentstatus'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be generateHtmlItem
as other widgets here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem. But why not all of the items are generated with _generateHtmlItem ? What is the difference ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's just an adapter for old widgets moved from w2ui toolbar to our JSDialog one.
Other widgets are "native" JSDialog's widgets
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro> Change-Id: I89f782cf65f2f104e12cf31ddc059c3481c4eb55
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro> Change-Id: I022433099333483b9274524a1e38e0e9bd975960
f87edcc
to
ae28212
Compare
Signed-off-by: Alexandru Vlăduţu alexandru.vladutu@1and1.ro
Change-Id: I04891ce23e0f250243d9453bfecb0570683cae7a
displays the last modified after a certain delay
text related to the document status (if saved)
Change-Id: I3b21274ed7557b37789f63751e0b9db583469355
Summary
TODO
Checklist
make check
make run
and manually verified that everything looks okay