Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a153de

Browse files
committed
Make executable mode change message more user-friendly
1 parent 4fd8a73 commit 2a153de

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lib/views/file-patch-view.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import Commands, {Command} from './commands';
1212
import FilePatchSelection from './file-patch-selection';
1313
import Switchboard from '../switchboard';
1414

15+
const executableText = {
16+
100644: 'non executable <code>100644</code>',
17+
100755: 'executable <code>100755</code>',
18+
};
19+
1520
export default class FilePatchView extends React.Component {
1621
static propTypes = {
1722
commandRegistry: PropTypes.object.isRequired,
@@ -297,12 +302,12 @@ export default class FilePatchView extends React.Component {
297302
</header>
298303
<div className="github-FilePatchView-metaDetails">
299304
File changed mode
300-
<span className="github-FilePatchView-metaDiff github-FilePatchView-metaDiff--removed">
301-
from <code>{executableModeChange.oldMode}</code>
302-
</span>
303-
<span className="github-FilePatchView-metaDiff github-FilePatchView-metaDiff--added">
304-
to <code>{executableModeChange.newMode}</code>
305-
</span>
305+
<span className="github-FilePatchView-metaDiff github-FilePatchView-metaDiff--removed"
306+
dangerouslySetInnerHTML={{__html: 'from ' + executableText[executableModeChange.oldMode]}}
307+
/>
308+
<span className="github-FilePatchView-metaDiff github-FilePatchView-metaDiff--added"
309+
dangerouslySetInnerHTML={{__html: 'to ' + executableText[executableModeChange.newMode]}}
310+
/>
306311
</div>
307312
</div>
308313
</div>

0 commit comments

Comments
 (0)